Skip to content

Instantly share code, notes, and snippets.

@eyberg
Created September 29, 2023 19:11
Show Gist options
  • Save eyberg/8cd238bbf5b6e2186bf9fe49ba9d0f6f to your computer and use it in GitHub Desktop.
Save eyberg/8cd238bbf5b6e2186bf9fe49ba9d0f6f to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <string.h>
int vuln(char* src) {
int admin = 0;
char buf[2];
strcpy(buf, src);
printf("%d\n", admin);
return admin;
}
int main() {
if (vuln("ADMIN!!!")) {
printf("we're admin!\n");
} else {
printf("we are not admin\n");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment