File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change 1
1
CC =gcc
2
2
CFLAGS =-I.
3
3
4
+ # Turns out modern compilers have a lot of default settings to prevent vulnerable code
5
+ # -fno-stack-protector: Disable stack canary: https://ctf101.org/binary-exploitation/stack-canaries/
6
+ # -no-pie: Disables ASLR essentially, loads executable to the same address every time
7
+ # -Wno-stringop-overflow: Disable complaining about fgets overflow
4
8
buffer_overflow : buffer_overflow.c
5
9
$(CC ) -o buffer_overflow buffer_overflow.c -fno-stack-protector -no-pie -Wno-stringop-overflow
6
10
Original file line number Diff line number Diff line change 1
- #include <stdio.h> // for puts and gets
2
- #include <unistd.h>
1
+ #include <stdio.h> // For puts and fgets
2
+ #include <unistd.h> // For execve
3
3
4
4
void access_vault () {
5
5
puts ("Access granted" );
You can’t perform that action at this time.
0 commit comments