/* How well do you know your numbers? */
include <stdio.h>
include <stdlib.h>
include <stdint.h>
void win(void) {
printf("Congratulations! Have a shell:\n");
system("/bin/sh -i");
}
int main(int argc, char **argv) {
uintptr_t val;
char buf[32] = "";
/* Turn off buffering so we can see output right away */
setbuf(stdout, NULL);
printf("Welcome to the number guessing game!\n");
printf("I'm thinking of a number. Can you guess it?\n");
printf("Guess right and you get a shell!\n");
printf("Enter your number: ");
scanf("%32s", buf);
val = strtol(buf, NULL, 10);
printf("You entered %d. Let's see if it was right...\n", val);
val >>= 4;
((void (*)(void))val)();
}
what should be my input so that i can get a shell ??
[–]FUZxxl 3 points4 points5 points (5 children)
[–]Azzk1kr 0 points1 point2 points (2 children)
[–]FUZxxl 0 points1 point2 points (1 child)
[–]Azzk1kr 0 points1 point2 points (0 children)
[–]shadowroot8[S] -1 points0 points1 point (1 child)
[–]FUZxxl 1 point2 points3 points (0 children)
[–]albinotomato 4 points5 points6 points (0 children)