hacking(2)
-
Robot Only 풀이
#!/usr/bin/env python3 import random import signal import sys MENU_GAMBLE = 1 MENU_VERIFY = 2 MENU_FLAG = 3 MENU_LEAVE = 4 money = 500 verified = False def show_menu(): print('=======================================') print('1. go to gamble') print('2. verify you\'re a robot') print('3. buy flag') print('4. leave') def get_randn(): return random.randint(0, 0xfffffffe) def gamble(): global money ..
2023.09.05 -
sint 풀이
#include #include #include #include void alarm_handler() { puts("TIME OUT"); exit(-1); } void initialize() { setvbuf(stdin, NULL, _IONBF, 0); setvbuf(stdout, NULL, _IONBF, 0); signal(SIGALRM, alarm_handler); alarm(30); } void get_shell() { system("/bin/sh"); } int main() { char buf[256]; int size; initialize(); signal(SIGSEGV, get_shell); printf("Size: "); scanf("%d", &size); if (size > 256 || s..
2022.05.31