Skip to content

Commit 4a1b165

Browse files
authored
Update README.md
add a short description and guideline for this project
1 parent a2414b8 commit 4a1b165

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,21 @@
11
# return-to-libc-attack
22
a simple return-to-libc attack example
3+
4+
tips:
5+
(1) 32 bit Linux Platform
6+
(2) you need to be root,and run "sysctl -w kernel.randomize_va_space=0" to shut the random space down
7+
(3) export MYSH=/bin/sh to tell the getenv the vaiable value(it's a way to pass paramters)
8+
(4) chmod 4777 retlib (you need to be root)
9+
(5) run getenv.c first to get the "/bin/bash" address,and use the value to alter exploit.c and run it.run the retlib at last.you'll see the "$" indicator for root.
10+
11+
tips(chinese version):
12+
13+
运行条件:
14+
(1) 32位Linux平台
15+
(2)切换root用户 运行 sysctl -w kernel.randomize_va_space=0 (禁用随机栈空间)
16+
(3)在当前bash中export 一个环境变量 例如 export MYSH=/bin/sh (这个环境变量在程序中是向system提供参数用的)
17+
(3) 使用 gcc -z execstack -fno-stack-protector retlib.c -o retlib 编译retlib.c (root用户)
18+
(4) chmod 4777 retlib (root 用户)
19+
(5)先运行getenv程序,得到/bin/sh字符串地址,修改exploit程序,(下面代码中数值已经填充好),编译、运行exploit 程序,然后运行retlib , 可以看到bash提示符,并且当前用户为root
20+
21+
Thanks to http://www.cis.syr.edu/~wedu/seed/labs.html SEED project!!!

0 commit comments

Comments
 (0)