LA CTF 2023 - crypto / rolling in the mud
·
CTF/Solved
1. intro 2. code 및 분석 2.1. code 2.2. 분석 딱 보자마자 영문 / 기호 대응 문제이다. 맨 마지막 기호가 lactf라고 가정하고 아래와 같이 만들어보았다. 다만 일부는 확인하기 어려웠다. 이를 기준으로 복호화 해보면 아래와 같고, 나머지는 충분히 추측할 수 있다. {emoh_og_?gip_eht_litn?_gnillor_dna_gnillor_dna_gnillor}ftcal 3. exploit lactf{rolling_and_rolling_and_rolling_until_the_pigs_go_home}
LA CTF 2023 - crypto / one-more-time-pad
·
CTF/Solved
1. intro 2. code 및 분석 2.1. code from itertools import cycle pt = b"Long ago, the four nations lived together in harmony ..." key = cycle(b"lactf{??????????????}") ct = "" for i in range(len(pt)): b = (pt[i] ^ next(key)) ct += f'{b:02x}' print("ct =", ct) #ct = 200e0d13461a055b4e592b0054543902462d1000042b045f1c407f18581b56194c150c13030f0a5110593606111c3e1f5e305e174571431e 2.2. 분석 xor으로 구성된 단순한 문제..
LA CTF 2023 - pwn/rut-roh-relro
·
CTF/Solved
1. intro 2. code 및 분석 2.1. code #include int main(void) { setbuf(stdout, NULL); puts("What would you like to post?"); char buf[512]; fgets(buf, 512, stdin); printf("Here's your latest post:\n"); printf(buf); printf("\nWhat would you like to post?\n"); fgets(buf, 512, stdin); printf(buf); printf("\nYour free trial has expired. Bye!\n"); return 0; } 2.2. 분석 앞선 문제와 유사하지만, 이번에는 두번 입력받고 두번 출력해준다. 3. ..
LA CTF 2023 - pwn / rickroll
·
CTF/Solved
1. intro 2. code 및 분석 2.1. code #include int main_called = 0; int main(void) { if (main_called) { puts("nice try"); return 1; } main_called = 1; setbuf(stdout, NULL); printf("Lyrics: "); char buf[256]; fgets(buf, 256, stdin); printf("Never gonna give you up, never gonna let you down\nNever gonna run around and "); printf(buf); printf("Never gonna make you cry, never gonna say goodbye\nNever gonn..
LA CTF 2023 - pwn/bot
·
CTF/Solved
1. intro 2. code 및 분석 2.1. code #include #include #include #include int main(void) { setbuf(stdout, NULL); char input[64]; volatile int give_flag = 0; puts("hi, how can i help?"); gets(input); if (strcmp(input, "give me the flag") == 0) { puts("lol no"); } else if (strcmp(input, "please give me the flag") == 0) { puts("no"); } else if (strcmp(input, "help, i have no idea how to solve this") == 0..
LA CTF 2023 - pwn/gatekeep
·
CTF/Solved
1. intro 2. code 및 분석 2.1. code #include #include #include #include #include void print_flag() { char flag[256]; FILE* flagfile = fopen("flag.txt", "r"); if (flagfile == NULL) { puts("Cannot read flag.txt."); } else { fgets(flag, 256, flagfile); flag[strcspn(flag, "\n")] = '\0'; puts(flag); } } int check(){ char input[15]; char pass[10]; int access = 0; // If my password is random, I can gatekee..