首先,先在虚拟机里check easy的保护:

发现只开了堆栈不可执行。
把文件拖进ida里,打开main函数

发现是gets溢出,转到汇编

发现偏移量为0X40
或者在gdb里生成垃圾字符,写入文件。64位的文件,得到爆出来的地址在下图位置,取后八位为地址输入语句 cyclic -l 地址


可知需要72个垃圾字符(72=0x40+8)
然后我们再倒回去看ida里,我们发现有个system函数

我们看到有个command,我们选择打开汇编,点击command

发现/bin/sh就在里面,而command是传向system 的,所以我们去找那个赋值语句(将/bin/sh 传入command)的地址0x4006AE

我们就以写出脚本啦

然后就可以交互啦(貌似本地打不出flag,远程的IP也不记得了)
网友评论