6. Getting Shell
Last updated
Was this helpful?
Last updated
Was this helpful?
Run the following msfvenom command on Kali, using your Kali VPN IP as the LHOST and updating the -b option with all the badchars you identified (including \x00):
Copy the generated python code and integrate it into your script, e.g. by setting the payload variable equal to the buf variable from the code.
Prepend NOPs
Since an encoder was likely used to generate the payload, you will need some space in memory for the payload to unpack itself. You can do this by setting the padding variable to a string of 16 or more "No Operation" (\x90) bytes:
Exploit!
With the correct prefix, offset, return address, padding, and payload set, you can now exploit the buffer overflow to get a reverse shell.
Start a netcat listener on your Kali box using the LPORT you specified in the msfvenom command (4444 if you didn't change it).
Restart oscp.exe in Immunity and run the modified script again. Your netcat listener should catch a reverse shell!