분류 전체보기 205

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. 버퍼오버플로우 취약점을 이용해 실제로 쉘코드를 실행해보는 문제다. 쉘코드를 만드는 과정은 쉽지..

StackFrame

출처: https://securely.tistory.com/entry/NO13-Stack-Frame과-변수-공간-확보에-대해 [Securely의 정보보안블로그] Stack Frame을 사용하는 경우 함수는 항상 Frame Pointer를 셋업하는 코드 구문으로 시작하게 됩니다. Stack Frame? 1. 함수가 사용하게 되는 Stack영역 입니다. 2. 실행 중인 함수는 자신 만의 Stack영역을 사용하게 됩니다. 3. 함수가 실행하게 되면 Stack Frame을 오픈하게 되고, 함수가 종료하게 되면 Stack Frame을 닫게 됩니 일반적인 셋업코드구문을 보겠습니다. x86 PUSH EBP => caller의 Stack Frame Pointer를 백업합니다. MOV EBP, ESP => ESP값을 E..

기본개념 2020.01.01

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..

A journey into Radare 2 – Part 1: Simple crackme 번역 및 실습

원문링크 https://www.megabeets.net/a-journey-into-radare-2-part-1/제세한 내용 및 실습은 원문을 참고하기 바랍니다. radare2 실행 >실행컨텍스트 안에서 radare2쉘은 rabin2 등을 사용할 수 있다. Informations오픈한 파일에 대한 각종 정보를 검색할 수 있음 >i? (show information-anything) >ie (information entrypoint) Analysisaaa 또는 -A 옵션을 사용해 바이너리에 대한 분석이 가능함 >a? (analyse) >aa (analyse all): 명령과 달리 모든 분석X, 추가 명령어가 뒤에 붙어서 분석될 수 있음 aa 또는 aaa 이후 아래 명령어들을 통해 추가적인 내용 분석이 가능함..

Debugger/radare2 2019.12.31

Internetwache CTF 2016 : SPIM

Internetwache CTF 2016 : SPIM Points : 50 Solves : 208 Description :Description: My friend keeps telling me, that real hackers speak assembly fluently. Are you a real hacker? Decode this string: "IVyN5U3X)ZUMYC 아아 어렵다....;;; 아직도 이해가 안됨 관련개념에 대한 검색과 주어진 주석을 최대한 활용했어야 했다. 주석이 알고리즘을 만드는 힌트였음.. http://www.mrc.uidaho.edu/mrc/people/jff/digital/MIPSir.html In layman terms, in our main function, we're ..

Sharif University CTF 2016 : SRM

Sharif University CTF 2016 : SRM Points : 50 Solves : 173 Description : The flag is : The valid serial number Download RM.exe 핵심 함수 찾아서 차근차근 하드코딩된 문자를 풀면 플래그를 얻을 수 있었다!! 롸잇업 없이 풀어서 뿌듯함 굿 유용한 파이썬 함수! hex(숫자) => 숫자를 헥사코드로 변환 chr(숫자) => 숫자를 아스키 문자로 변환 ord('문자') => 문자를 아스키코드로 변환

Sharif University CTF 2016 : Serial

Sharif University CTF 2016 : Serial Points : 150 Solves : 108 Description Run and capture the flag! Download serial 리눅스 원격디버깅 방법과 IDA를 통한 리버싱을 익힐 수 있었다. 하드코딩된 시리얼넘버였지만 단순하게 박혀있는 타입이 아니였다. 로직은 코드의 일부분이 오버랩되어 IDA에 의해 디컴파일이 불가한 상태였다. 롸잇업을 보고나서야 점프코드 부분이 다른 코드와 오버랩 되어있다는 사실을 알았다. 그리고 단축키 C와 D를 이용해서 코드를 변환할 수 있다는 사실을 알고 놀라웠다. C: Code로 변환 D: DATA변환 R: 헥스 값을 아스키 케릭터로 변환 한글자씩 시리얼 넘버를 비교하고 다음에는 길이를 비교하는 ..