forked from hardenedlinux/linux-exploit-development-tutorial
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstack.c
More file actions
16 lines (14 loc) · 319 Bytes
/
stack.c
File metadata and controls
16 lines (14 loc) · 319 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/*
* gcc -fno-stack-protector -m32 -z execstack -o level1 stack.c
*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
void vulnerable_function() {
char buf[128];
read(STDIN_FILENO, buf, 256);
}
int main(int argc, char** argv) {
vulnerable_function();
write(STDOUT_FILENO, "Hello, World\n", 13);
}