목록picoCTF 2018 (48)
Bace

소스를 봐보았다. #include #include #include #include #include #include "asm.h" #define BUFSIZE 32 #define FLAGSIZE 64 void win() { char buf[FLAGSIZE]; FILE *f = fopen("flag.txt","r"); if (f == NULL) { printf("Flag File is Missing. Problem is Misconfigured, please contact an Admin if you are running this on the shell server.\n"); exit(0); } fgets(buf,FLAGSIZE,f); printf(buf); } void vuln(){ char buf[BUF..

주어진 주소와 포트에 접속해보면 다음과 같은 문자열을 받는다. 중간에 flag 형식과 유사한 구문이 있다. 해당 구문만 복호화해보았다. 다음과 같이 flag가 나온다. picoCTF{f1gd3r3_m1ph3rs_ar3n7_lat_095bkccc}

0x76을 주었을 때 어떤 값이 return 되냐고 한다. 문제에서 주어진 소스 파일을 확인해보았다. .intel_syntax noprefix .bits 32 .global asm1 asm1: pushebp movebp,esp cmpDWORD PTR [ebp+0x8],0x98 jg part_a cmpDWORD PTR [ebp+0x8],0x8 jnepart_b moveax,DWORD PTR [ebp+0x8] addeax,0x3 jmppart_d part_a: cmpDWORD PTR [ebp+0x8],0x16 jnepart_c moveax,DWORD PTR [ebp+0x8] subeax,0x3 jmppart_d part_b: moveax,DWORD PTR [ebp+0x8] subeax,0x3 jmppart_..