Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //gcc source.c -m32 -o binary -fno-stack-protector
- #include <stdio.h>
- #include <stdlib.h>
- #include <unistd.h>
- void print_flag(long a) {
- if (a == 1701064803){
- system("cat flag.txt");
- }
- else {
- fprintf(stdout, "You can't!!\nTry somewhere else.");
- fflush(stdout);
- }
- exit(0);
- }
- int main() {
- long a;
- char buf[64];
- fprintf(stdout, "Can you pwn us, n00b?\n");
- sleep(1);
- fprintf(stdout, "Enter your name : ");
- fflush(stdout);
- scanf("%s", buf);
- sleep(1);
- print_flag(a);
- exit(0);
- }
Add Comment
Please, Sign In to add comment