Debugger 15

Radare2 디버깅 커맨드

Radare2 디버깅 radare2 -d [파일명]: 디버거 모드 오픈 radare2 -w [파일명]: 쓰기 모드 오픈 | o [file] open [file] file in read-only | o+ [file] open file in read-write mode | on [file] 0x4000 map raw file at 0x4000 (no r_bin involved) | oo[?] reopen current file (kill+fork in debugger) | ood 현재파일 디버거 모드로 재실행 - 비쥬얼 모드 toggl breakpoints with F2 single-step with F7 (s) step-over with F8 (S) continue with F9 - 커맨드 모드 | db ..

Debugger/radare2 2020.01.07

[GDB] 라이브러리 함수 분기에 대하여...

왜 사용자 함수는 되고 공유라이브러리? 함수 분기에 대한 disassemble은 안되는지...? 0x000104f0 : ldr r3, [pc, #92] ; 0x10554 0x000104f4 : ldr r3, [r3] 0x000104f8 : mov r0, r3 0x000104fc : bl 0x10374 막상 s를 입력하여 0x10374로 분기하면 그 다음 명령어들은 건너뛰고 printf함수로 이동되었다. gef> x/10i 0x20718 0x20718: andeq r0, r0, r0 0x2071c: andeq r0, r0, r0 gef> x/5i 0x10374 0x10374: add r12, pc, #0, 12 gef> disassemble 0x10374 No function contains specifi..

Debugger/GDB 2020.01.05

[GEF] Pattern 생성과 활용

GEF에서는 리턴 명령어가 존재하는 오프셋을 검색할 수 있도록 패턴 기능을 제공한다. - pattern create [크기] - pattern search [패턴] 하지만 꼭 개념을 정리해야 되는 것이 있다. 패턴서치는 리틀엔디안 검색과 빅엔디안 검색 둘다 출력하는데, 바이트오더로 인해 그 결과는 차이가 있다. pattern search를 해보면 혼동이 올 수 있는데, 시스템 고유 방식이 아닌 내가 검색한 엔디안 방식에 따른 오프셋을 참조하면된다. 예를 들어, Program received signal SIGSEGV, Segmentation fault. 0x61616174 in ?? () [ Legend: Modified register | Code | Heap | Stack | String ] ----..

Debugger/GDB 2020.01.04

Disassembling_with_radare2

Tomas_Antecky 윈도우즈에서 실습하기 때문에 Reversing_kr의 Easy_Crackme.exe로 실습해보았다. >ij~{} :informations, output of command in json format, json indent 더 자세한 표현식은 아래 명령어를 통해 참고 >?@? : 출력 표현식 리스트 b : 블락 크기 출력, 기본 100블럭임 b [크기] : 블락크기 설정, 32비트에서는 참고로 4블락당 1개의 명령어가 출력됨 [0x00401188]> b 12 [0x00401188]> pd ;-- entry0: ;-- eip: 0x00401188 55 push ebp 0x00401189 8bec mov ebp, esp 0x0040118b 6aff push 0xfffffffffffff..

Debugger/radare2 2020.01.03

THC2018

THC2018 PDF 필요한 슬라이드만 뽑아봄 v1: 2020/01/02 Seek History >s- :undo > s+:redo - Usee u and U keys to go back/forward in the visual seek history. - 비쥬얼 모드에서 !를 입력하면 Panel로 바꿀 수 있다. - 스페이스바를 통해 그래프모드비쥬얼모드 전환 가능하다. - 쉘에서 Vc를 입력하면 비쥬얼 커서모드를 이용할 수 있다. - pds: 디스어셈블 요약 - pdc: C슈도코드 radare2 지원 디컴파일러 ● Boomerang Abandoned ● Snowman Supported ● Retdec supported ● Radeco wip (gsoc) ● r2dec Actively maintained ..

Debugger/radare2 2020.01.02

A journey into Radare 2 – Part 2: Exploitation (미완료)

* 실습 바이너리 파일이 ELF 즉, 리눅스 파일이며 디버그 모드를 실행해야하기 때문에 윈도우에서는 실습이 불가능하다. 리눅스에서 다시해보는걸로!! ㅠ Our binary this time is quite similar to the one from the previous post with a few slight changes to the main() function: •Compiled without -z execstac to enable NX bit •Receives user input with scanf and not from program’s arguments •Uses mostly puts to print to screen •Little changes to the program’s output ra..

Debugger/radare2 2020.01.02