The other day when I read the buffer overflow post by "genjix", I experimented a little with the code and tried to find out what was wrong. I didn't actually found what was wrong, however I came across something else when I tried to compile a sample code from "Hacking: The Art of Exploitation" by Jon Erickson.
Voulnerable program: http://www.phiral.com/book_code/chap2/vuln.c
Exploit program: http://www.phiral.com/book_code/chap2/exploit.c
When I tried to compile and run it, I knew something wasn't right, because I got a segmentation fault when I tried to run it (with kernel 2.6.12.1). Then I remembered I have read an article for a long time ago about Exec shield overflow protection in the 2.4.2x kernels so I thought maybe they had finally get it to work in the late 2.6.x kernels. Then after experimenting a little with the code I tried to compile and run it with kernel 2.4.29 and the exploit program worked.
Have anyone of experienced any of this? Is it the exec shield overflow protection which causes the segmentation fault in the 2.6.12.1 kernel, or is it some new protection feature in gcc?
I have not much experience in kernel and compiling security field so I'm hoping any of you guys have some thoughts about this.
Thanks in advance
Voulnerable program: http://www.phiral.com/book_code/chap2/vuln.c
Exploit program: http://www.phiral.com/book_code/chap2/exploit.c
When I tried to compile and run it, I knew something wasn't right, because I got a segmentation fault when I tried to run it (with kernel 2.6.12.1). Then I remembered I have read an article for a long time ago about Exec shield overflow protection in the 2.4.2x kernels so I thought maybe they had finally get it to work in the late 2.6.x kernels. Then after experimenting a little with the code I tried to compile and run it with kernel 2.4.29 and the exploit program worked.
Have anyone of experienced any of this? Is it the exec shield overflow protection which causes the segmentation fault in the 2.6.12.1 kernel, or is it some new protection feature in gcc?
I have not much experience in kernel and compiling security field so I'm hoping any of you guys have some thoughts about this.
Thanks in advance
Comment