티스토리 뷰

Reversing

Cutter : Radare2 공식 GUI 툴

RCE_Mania 2018. 6. 20. 11:15

Cutter : Radare2 공식 GUI 툴

Radare2

R2(Radare2)는 오픈소스 포터블 리버싱 프레임워크로 아래와 같은 작업이 가능하다.

기능

  • Disassemble (and assemble for) many different architectures
  • Debug with local native and remote debuggers (gdb, rap, webui, r2pipe, winedbg, windbg)
  • Run on Linux, *BSD, Windows, OSX, Android, iOS, Solaris and Haiku
  • Perform forensics on filesystems and data carving
  • Be scripted in Python, Javascript, Go and more
  • Support collaborative analysis using the embedded webserver
  • Visualize data structures of several file types
  • Patch programs to uncover new features or fix vulnerabilities
  • Use powerful analysis capabilities to speed up reversing
  • Aid in software exploitation

Architectures:
6502, 8051, CRIS, H8/300, LH5801, T8200, arc, arm, avr, bf, blackfin, xap, dalvik, dcpu16, gameboy, i386, i4004, i8080, m68k, malbolge, mips, msil, msp430, nios II, powerpc, rar, sh, snes, sparc, tms320 (c54x c55x c55+), V810, x86-64, zimg, risc-v.

File Formats:
bios, CGC, dex, elf, elf64, filesystem, java, fatmach0, mach0, mach0-64, MZ, PE, PE+, TE, COFF, plan9, dyldcache, Commodore VICE emulator, Game Boy (Advance), Nintendo DS ROMs and Nintendo 3DS FIRMs.

Operating Systems:
Android, GNU/Linux, [Net|Free|Open]BSD, iOS, OSX, QNX, w32, w64, Solaris, Haiku, FirefoxOS

Bindings:
Vala/Genie, Python (2, 3), NodeJS, Lua, Go, Perl, Guile, php5, newlisp, Ruby, Java, OCaml, …

가장 좋은 점은 멀티플랫폼 디버거로 Android, MacOS, Linux, Windows에서 여러 파일 포맷을 디버깅할 수 있다는 것이나 치명적인 단점이… CLI라는 점이다.

단점 극복을 위해 R2를 포팅한 GUI Project가 진행되어 왔으나 성공하지 못했고, 나역시 CLI라는 이유로 R2를 멀리하던 차에 드디어 R2가 공식 GUI 툴로 Cutter를 인정했다는 소식을 듣고 Cutter 사용법에 대한 간단한 튜토리얼을 작성하고자 한다.

Cutter 설치

Cutter는 Windows/Linux, OS X에서 사용가능하며 최신 릴리즈다운로드해 설치하면 된다.

소스를 빌드에서 사용하고 싶을 경우 컴파일 설명을 참고하면 된다.

Cutter 사용법

윈도우의 경우 최신 릴리즈가 zip파일로 배포된다. 압축을 해제한 Cutter폴더에서 cutter.exe를 실행하면 아래와 같이 디버거 실행을 위해 대상 파일을 선택할 수 있다.



파일과 프로젝트를 선택할 수 있으며, 파일을 선택할 경우 아래와 같이 분석 레벨을 설정할 수 있다. 기본적으로 Auto-Analysis(aaa)레벨로 설정되어 있으나, 고급 옵션이나 분석 레벨을 향상시키면 R2의 다양한 분석옵션이 적용 가능하다.



선택 파일 분석이 완료되면 아래와 같이 메인 윈도우가 활성화되며, 기본적인 틀은 IDA의 UI와 비슷하다.



메인 윈도우의 탭은 Dashboard, Disassembly, Graph, Hexdump, Pseudocode, Entry Points, Strings, Imports, Symbols, Jupyter로 구성되어 있다. 위 그림에서 보여지는 Dashboard탭에서는 파일의 정보와 해쉬 값, 라이브러리 정보를 보여준다.

Cutter에서 지원하는 Windows의 종류는 아래와 같다.

  • Dashboard
  • Disassembly
  • Graph
  • Hexdump
  • Pseudocode
  • Sidebar
  • Entry Point
  • Functions
  • Classes
  • Imports
  • Exports
  • Symbols
  • SDB Browser
  • Resources
  • VTables
  • Types
  • Search
  • Relocs
  • Strings
  • Flags
  • Sections
  • Comments
  • Console
  • Jupyter

enter image description here


enter image description here


기존 IDA를 사용해본 사용자라면 쉽게 이해하고 조작할 수 있는 기능들이 많으며, Sidebar에서 X-Ref를 바로 확인할 수 있는 점과 Jupyter와 R2pipe를 이용한 강력한 스크립팅 기능은 굉장히 만족스럽다.

댓글