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
一、查看文件保护ELF32 开启了NX(堆栈不可执行)以及 CANNARY(栈保护),未开启 PIE 程序内存加载基地址随机化保护机制(即静态反汇编的地址可以直接使用)kali中运行如下让我们输入一个名字和一条信息后,输出hello以及我们输入的信息,最后输出“Thank you”后退出程序二、IDA静态分析(1)main程序逻辑分析:1. 接收由用户输入字符串 buf 和 s,依次作为名字和信息进行打印; 2. 注意如果 pwnme == 8 这个条件满足,则执行 system(“cat flag”) 输出我们想要的目标信息 flag 值; (2)跟进变量pwnme发现是.bss段上的全局变量(3)整理思路main函数中第22行的print(s)存在格式化字符串漏洞所以解题思路为:借助格式化字符串漏洞,实现任意地址写,篡改 pwnme 全局变量的值并令其等于 8,即可获得 Flag。三、解题任意地址覆写格式化字符串漏洞的任意地址覆写的利用步骤跟任意地址读取的利用步骤类似:1. 确定格式化字符串漏洞受控参数在栈中的偏移量 n; 2. 确定你需要读内存的地址 target_address
Norman1z