Level2
拿到题目本能就check一下啦

发现又是一题只开NX的题目
拖进ida里看一下它的main函数

我们发现有一个函数(秉持着能点开则点开的优良传统我们就点开来看一下咯)

然后就刚好看到的我们的system函数,接下来很明显就是要找”/bin/sh”了啦
然后shift+fn+f12打开字符串查找

一眼就看到了/bin/sh了,点进去看它的地址

然后,我发现我忘了找偏移量了,(好的,我们倒回去看偏移)还记得上面第三张图吗?(那个有system的函数)

就可以看到这个偏移量是0x88了啊,然后我们写脚本

因为32位的题在system函数调用之后会有有一个返回地址,所以我们在p32(system)之后还要再p32(0)或者“aaaa”(输入四个垃圾字符),最后再将binsh的地址打包上去。

然后运行,就大功告成啦~
�
网友评论