From d0fd618943d6e24234ca194ebea8c1016dab07a7 Mon Sep 17 00:00:00 2001 From: Omar Santos Date: Wed, 16 Jan 2019 14:29:29 -0500 Subject: [PATCH] Update README.md --- buffer_overflow_example/README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/buffer_overflow_example/README.md b/buffer_overflow_example/README.md index 7bb02c0..a51497f 100644 --- a/buffer_overflow_example/README.md +++ b/buffer_overflow_example/README.md @@ -29,3 +29,16 @@ int main() ``` The `char buffer[20];` is a really bad idea. The rest will be demonstrated in the course. + +You can compile this code or use the already-compiled binary [here](https://github.com/The-Art-of-Hacking/h4cker/raw/master/buffer_overflow_example/vuln_program). + +For 32 bit systems you can use [gcc](https://www.gnu.org/software/gcc/) as shown below: +``` +gcc vuln.c -o vuln -fno-stack-protector +``` +For 64 bit systems + +``` +gcc vuln.c -o vuln -fno-stack-protector -m32 +``` +`-fno-stack-protector` disabled the stack protection. Smashing the stack is now allowed. `-m32` made sure that the compiled binary is 32 bit. You may need to install some additional libraries to compile 32 bit binaries on 64 bit machines.