리버싱CTF 23

[MOBISEC] Pincode (10)

Pincode (10) MainActivity 메인엑티비티를 분석해보면 Pinchecker.checkPin() 매소드에서 Pin번호를 검증한다. 올바른 Pincode를 입력할 경우 검증 과정에서 사용되는 매소드들이 True가 계속 반환되며 화살표 순으로 진행된다. 그리고 최종적으로 서버와의 통신을 통해 Flag를 반환받을 수 있다. 핵심 로직은 Pincheck.checkPin() 매소드를 분석해보자. PinChecker.checkPin() PinChecker클래스의 checkPin 매소들를 분석해보면 Pin은 6글자이고 MD5로 다이제스트한 값이 "d04988522ddfed3133cc24fb6924eae9"과 동일해야한다는 것을 알 수 있다. 6글자의 숫자이기 때문에 브루트포스로 충분히 찾아낼 수 있겠다..

[MOBISEC] BabyRev (10)

MOBISEC babyrev (10) Jadx-gui를 이용해서 APK파일을 디스어셈블한다. MainActivity 분석 다음과 같은 코드를 사용하면 ID를 지정하고 리소스에 매핑된 문자열을 불러올 수 있다. 아래 필드를 따라가보면 ID넘버가 존재하며 이 ID넘버와 매핑되는 값을 strings.xml에서 찾는다. 개발에 대한 자세한 내용은 아래에 정리한 부록1을 참고한다. final EditText flagWidget = (EditText) findViewById(C0055R.C0057id.flag); final TextView resultWidget = (TextView) findViewById(C0055R.C0057id.result); 아래의 조건문에 맞는 문자열이 이 문제의 Flag값이라는 것을 알..

SD4RK's KeyMe

A simple CrackMe, you have to write a keygen. All other info is in the README. Good luck : simple CrackMe,u have to write a keygen. All other info is in the README. Good luck Easy, C/C++, Windows A simple CrackMe, you have to write a keygen. All other info is in the README. Good luc 그래프를 봐도 루틴 파악이 어렵네요.. 머리가 나빠서 코드 하나씩 실행해가며 해석하였고 5시간 정도 멍떄리다 3시간 집중해서 겨우 풀었습니다 ㅎㅎ 미친 내 소중한 일요일... 문자 6번째까지의 연산 str..

Stack5 (Success)

About Stack5 is a standard buffer overflow, this time introducing shellcode. This level is at /opt/protostar/bin/stack5 Hints At this point in time, it might be easier to use someone elses shellcode If debugging the shellcode, use \xcc (int3) to stop the program executing and return to the debugger remove the int3s once your shellcode is done. Key point 1. 버퍼오버플로우 취약점을 이용해 실제로 쉘코드를 실행해보는 문제다. 2...

Stack5(Fail)

About Stack5 is a standard buffer overflow, this time introducing shellcode. This level is at /opt/protostar/bin/stack5 Hints At this point in time, it might be easier to use someone elses shellcode If debugging the shellcode, use \xcc (int3) to stop the program executing and return to the debugger remove the int3s once your shellcode is done. 버퍼오버플로우 취약점을 이용해 실제로 쉘코드를 실행해보는 문제다. 쉘코드를 만드는 과정은 쉽지..

Stack3

About Stack3 looks at environment variables, and how they can be set, and overwriting function pointers stored on the stack (as a prelude to overwriting the saved EIP) Hints both gdb and objdump is your friend you determining where the win() function lies in memory. This level is at /opt/protostar/bin/stack3 Point - 이전 문제와 비슷하다. - 다른점은 환경변수가 아닌 사용자 입력 값을 버퍼에 덮어 씌울때를 악용하여 다음에 실행될 명령어(PC)의 값을 수정하는..

Stack2

AboutStack2 looks at environment variables, and how they can be set. This level is at /opt/protostar/bin/stack2 Key Point- 소스코드를 참고하자.- GREENIE 환경변수에 입력된 값을 이용해서 풀어야한다. 1.패턴생성pattern create 환경변수에 패턴입력export GREEIE=패턴 입력 2.확인echo $GREENIE 3.GDB 실행 후 코드 확인0x1053c cmp r3, r2bne 0x10550 4.레지스터 상태 확인r2= 0x0d0a0d0ar3=qaaa(나의 패턴 값) 5.qaaa 패턴 위치 확인gef> pattern search qaaa[+] Searching 'qaaa'[+] Found at..