You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 29, 2023. It is now read-only.
The problem is that stuff is only of size 4 and big can be very big (it is as big as the size of file...), so if we managed to execute the strcpy we should be able to trigger a buffer overflow and rewrite the rip.
Now, the condition size == port is true if the size of the file is equal to the port. The port number is generated "randomly" by the function getRandomPort:
However, the seed for the rand function is never initialized, and therefore is constant between executions of the server. The generated port numbers will always be the same. We can easily generate a file with the size of a port and include a payload in it to trigger the overflow.
Exploit:
This gist contains a python exploit generator that will:
generate a payload.txt of size 31872 (first port generated by getRandomPort
generate a overflow1.in file containing a sequence of command that will run the exploit
login q
pass q
put payload.txt 31873
The text was updated successfully, but these errors were encountered:
Looking at the function
receiveFileUpload
we can see the following snippet:my_ass_on_your_grass/src/network/ServerSocket.cpp
Lines 199 to 200 in 355151c
The problem is that
stuff
is only of size 4 andbig
can be very big (it is as big as the size of file...), so if we managed to execute the strcpy we should be able to trigger a buffer overflow and rewrite the rip.Now, the condition
size == port
is true if the size of the file is equal to the port. The port number is generated "randomly" by the functiongetRandomPort
:my_ass_on_your_grass/src/network/ServerSocket.cpp
Lines 152 to 157 in 355151c
However, the seed for the rand function is never initialized, and therefore is constant between executions of the server. The generated port numbers will always be the same. We can easily generate a file with the size of a port and include a payload in it to trigger the overflow.
Exploit:
This gist contains a python exploit generator that will:
payload.txt
of size 31872 (first port generated bygetRandomPort
overflow1.in
file containing a sequence of command that will run the exploitThe text was updated successfully, but these errors were encountered: