Created
September 29, 2023 19:11
-
-
Save eyberg/8cd238bbf5b6e2186bf9fe49ba9d0f6f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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