1.查看文件保护64位,开启了NX(数据不可执行)、Canary(栈保护)和Full RELRO(无法修改GOT表)运行程序图画之后的提示中有两个secretsecret[0] is 12b32a0secret[1] is 12b32a4用户输入名字后,出现一大段故事,接着有两次选择:(1)east or up?选up后会让用户重新选择,所以只能选east(2)选east后:there(1)or leave(0)?输入0选择leave,则程序输出一段字符后程序退出输入1后程序提示用户输入一个地址和一个愿望,接着程序输出一段字符后退出2.IDA静态分析(1)main程序逻辑分析:1)启动计时器后执行sub_400996,接着定义数组v4,且v4[0]=68,v4[1]=852)第13、14行给出的secret是v4[0](68)和v4[1](85)的地址3)输出一系列字符串后执行sub_400D72(2)sub_400996输出off_603010,跟进后发现为asc_400F98,内容为龙的图画(3)sub_400D72判断角色名长度小于0x28,执行之后三个函数1)sub_400A7
1.查看文件保护32位,只开启了NX(数据不可执行)kali中运行程序一个留言板程序,用户可以输出名字和一条信息。2.IDA静态分析(1)main(2)hello第29行fgets接收用户输入到变量name中,双击跟进发现其在.bss段,地址为0804A080函数末尾发现gets()函数,并且数组s与ebp的位移为0x26,因此写0x26+4个字节后即可覆盖返回地址(3)查看字符串窗口没有发现/bin/sh字符串,但是左侧函数窗口中有system函数,地址为08048420还找到一个pwn函数,执行系统命令输出字符串,由此得call __system地址为0804855A因此构造一个/bin/sh作为system执行的参数即可getshell(4)思路整理利用fgets函数溢出后返回地址修改成system()函数,内容用/bin/sh覆盖EXP代码如下:from pwn import * p = remote('61.147.171.105', 63915) payload=b'a'*(0x26+4)+p32(0x0804855A)+p32(0x0804A080) # 或者是直接调
Norman1z