一、实验说明
1、实验环境:
Distributor ID: Ubuntu
Description: Ubuntu 16.04.1 LTS
Release: 16.04
Codename: xenial
2、实验工具:
gdb
3、源码
/* abo2.c *
* specially crafted to feed your brain by gera@core-sdi.com */
/* This is a tricky example to make you think *
* and give you some help on the next one */
int main(int argv,char **argc) {
char buf[256];
strcpy(buf,argc[1]);
exit(1);
}
4、实验目的
构造字符串,实现栈溢出。
5、编译
二、调试
1、首先使用disas main查看汇编代码:

abo2直接使用exit()函数退出程序,可以溢出,但是没办法修改返回地址。