Building a concrete alternative to IDA - Radare2 to the rescue!
Transcript of Building a concrete alternative to IDA - Radare2 to the rescue!
![Page 1: Building a concrete alternative to IDA - Radare2 to the rescue!](https://reader031.fdocuments.net/reader031/viewer/2022030320/586a37821a28ab17578c398d/html5/thumbnails/1.jpg)
building a concrete alternative to idaRadare2 to the rescue!
Jeffrey (crowell) Crowell – Julien (jvoisin) VoisinJune 20, 2015
REcon 2015 – Montreal
![Page 2: Building a concrete alternative to IDA - Radare2 to the rescue!](https://reader031.fdocuments.net/reader031/viewer/2022030320/586a37821a28ab17578c398d/html5/thumbnails/2.jpg)
we’re sorry
1
![Page 3: Building a concrete alternative to IDA - Radare2 to the rescue!](https://reader031.fdocuments.net/reader031/viewer/2022030320/586a37821a28ab17578c398d/html5/thumbnails/3.jpg)
who are we?
crowell
∙ Work at Google∙ raxcity.com∙ Shellphish∙ Boston Key Party
jvoisin
∙ Soon graduated∙ <redacted>∙ dustri.org∙ Knows some english
2
![Page 4: Building a concrete alternative to IDA - Radare2 to the rescue!](https://reader031.fdocuments.net/reader031/viewer/2022030320/586a37821a28ab17578c398d/html5/thumbnails/4.jpg)
toolbag
Professional
∙ IDA Pro∙ ImmunityDBG∙ WinDBG∙
Amateur
∙ IDA Pro∙ WineDBG∙ Hopper∙ OllyDBG
3
![Page 5: Building a concrete alternative to IDA - Radare2 to the rescue!](https://reader031.fdocuments.net/reader031/viewer/2022030320/586a37821a28ab17578c398d/html5/thumbnails/5.jpg)
toolbag
Professional
∙ IDA Pro ($5000)∙ ImmunityDBG∙ WinDBG∙
Amateur
∙ IDA Pro (pirated)∙ WineDBG (pirated Windows)∙ Hopper (probably not)∙ OllyDBG (not maintained)
3
![Page 6: Building a concrete alternative to IDA - Radare2 to the rescue!](https://reader031.fdocuments.net/reader031/viewer/2022030320/586a37821a28ab17578c398d/html5/thumbnails/6.jpg)
ida pro
∙ Created by Ilfak Guilfanov
∙ First DataRescue, then Hex-Rays∙ Closed-source and expensive∙ Lots of architectures are supported∙ Decompilation!∙ Awesome piece of software
4
![Page 7: Building a concrete alternative to IDA - Radare2 to the rescue!](https://reader031.fdocuments.net/reader031/viewer/2022030320/586a37821a28ab17578c398d/html5/thumbnails/7.jpg)
ida pro
∙ Created by Ilfak Guilfanov∙ First DataRescue, then Hex-Rays
∙ Closed-source and expensive∙ Lots of architectures are supported∙ Decompilation!∙ Awesome piece of software
4
![Page 8: Building a concrete alternative to IDA - Radare2 to the rescue!](https://reader031.fdocuments.net/reader031/viewer/2022030320/586a37821a28ab17578c398d/html5/thumbnails/8.jpg)
ida pro
∙ Created by Ilfak Guilfanov∙ First DataRescue, then Hex-Rays∙ Closed-source and expensive
∙ Lots of architectures are supported∙ Decompilation!∙ Awesome piece of software
4
![Page 9: Building a concrete alternative to IDA - Radare2 to the rescue!](https://reader031.fdocuments.net/reader031/viewer/2022030320/586a37821a28ab17578c398d/html5/thumbnails/9.jpg)
ida pro
∙ Created by Ilfak Guilfanov∙ First DataRescue, then Hex-Rays∙ Closed-source and expensive∙ Lots of architectures are supported
∙ Decompilation!∙ Awesome piece of software
4
![Page 10: Building a concrete alternative to IDA - Radare2 to the rescue!](https://reader031.fdocuments.net/reader031/viewer/2022030320/586a37821a28ab17578c398d/html5/thumbnails/10.jpg)
ida pro
∙ Created by Ilfak Guilfanov∙ First DataRescue, then Hex-Rays∙ Closed-source and expensive∙ Lots of architectures are supported∙ Decompilation!
∙ Awesome piece of software
4
![Page 11: Building a concrete alternative to IDA - Radare2 to the rescue!](https://reader031.fdocuments.net/reader031/viewer/2022030320/586a37821a28ab17578c398d/html5/thumbnails/11.jpg)
ida pro
∙ Created by Ilfak Guilfanov∙ First DataRescue, then Hex-Rays∙ Closed-source and expensive∙ Lots of architectures are supported∙ Decompilation!∙ Awesome piece of software
4
![Page 12: Building a concrete alternative to IDA - Radare2 to the rescue!](https://reader031.fdocuments.net/reader031/viewer/2022030320/586a37821a28ab17578c398d/html5/thumbnails/12.jpg)
radare2, cet inconnu
![Page 13: Building a concrete alternative to IDA - Radare2 to the rescue!](https://reader031.fdocuments.net/reader031/viewer/2022030320/586a37821a28ab17578c398d/html5/thumbnails/13.jpg)
history
∙ radare in 2006
∙ forensics tool∙ radare2 in 2009∙ written in pure C∙ 350k LoC under LGPL∙ multi-purpose suite of tools
6
![Page 14: Building a concrete alternative to IDA - Radare2 to the rescue!](https://reader031.fdocuments.net/reader031/viewer/2022030320/586a37821a28ab17578c398d/html5/thumbnails/14.jpg)
history
∙ radare in 2006∙ forensics tool
∙ radare2 in 2009∙ written in pure C∙ 350k LoC under LGPL∙ multi-purpose suite of tools
6
![Page 15: Building a concrete alternative to IDA - Radare2 to the rescue!](https://reader031.fdocuments.net/reader031/viewer/2022030320/586a37821a28ab17578c398d/html5/thumbnails/15.jpg)
history
∙ radare in 2006∙ forensics tool∙ radare2 in 2009
∙ written in pure C∙ 350k LoC under LGPL∙ multi-purpose suite of tools
6
![Page 16: Building a concrete alternative to IDA - Radare2 to the rescue!](https://reader031.fdocuments.net/reader031/viewer/2022030320/586a37821a28ab17578c398d/html5/thumbnails/16.jpg)
history
∙ radare in 2006∙ forensics tool∙ radare2 in 2009∙ written in pure C
∙ 350k LoC under LGPL∙ multi-purpose suite of tools
6
![Page 17: Building a concrete alternative to IDA - Radare2 to the rescue!](https://reader031.fdocuments.net/reader031/viewer/2022030320/586a37821a28ab17578c398d/html5/thumbnails/17.jpg)
history
∙ radare in 2006∙ forensics tool∙ radare2 in 2009∙ written in pure C∙ 350k LoC under LGPL
∙ multi-purpose suite of tools
6
![Page 18: Building a concrete alternative to IDA - Radare2 to the rescue!](https://reader031.fdocuments.net/reader031/viewer/2022030320/586a37821a28ab17578c398d/html5/thumbnails/18.jpg)
history
∙ radare in 2006∙ forensics tool∙ radare2 in 2009∙ written in pure C∙ 350k LoC under LGPL∙ multi-purpose suite of tools
6
![Page 19: Building a concrete alternative to IDA - Radare2 to the rescue!](https://reader031.fdocuments.net/reader031/viewer/2022030320/586a37821a28ab17578c398d/html5/thumbnails/19.jpg)
history
∙ likely packaged in your distribution
∙ install from source though ;-)∙ more than 50 contributors for thelatest release
∙ RSoC (+GSoC)
7
![Page 20: Building a concrete alternative to IDA - Radare2 to the rescue!](https://reader031.fdocuments.net/reader031/viewer/2022030320/586a37821a28ab17578c398d/html5/thumbnails/20.jpg)
history
∙ likely packaged in your distribution∙ install from source though ;-)
∙ more than 50 contributors for thelatest release
∙ RSoC (+GSoC)
7
![Page 21: Building a concrete alternative to IDA - Radare2 to the rescue!](https://reader031.fdocuments.net/reader031/viewer/2022030320/586a37821a28ab17578c398d/html5/thumbnails/21.jpg)
history
∙ likely packaged in your distribution∙ install from source though ;-)∙ more than 50 contributors for thelatest release
∙ RSoC (+GSoC)
7
![Page 22: Building a concrete alternative to IDA - Radare2 to the rescue!](https://reader031.fdocuments.net/reader031/viewer/2022030320/586a37821a28ab17578c398d/html5/thumbnails/22.jpg)
history
∙ likely packaged in your distribution∙ install from source though ;-)∙ more than 50 contributors for thelatest release
∙ RSoC (+GSoC)
7
![Page 23: Building a concrete alternative to IDA - Radare2 to the rescue!](https://reader031.fdocuments.net/reader031/viewer/2022030320/586a37821a28ab17578c398d/html5/thumbnails/23.jpg)
r2tools
∙ ragg2∙ radiff2∙ rabin2
∙ rafind2∙ rahash2∙ rarun2
∙ rasm2∙ rax2∙ radare2
Compile programs into tiny binaries for x86-32/64 and arm.
8
![Page 24: Building a concrete alternative to IDA - Radare2 to the rescue!](https://reader031.fdocuments.net/reader031/viewer/2022030320/586a37821a28ab17578c398d/html5/thumbnails/24.jpg)
r2tools
∙ ragg2∙ radiff2∙ rabin2
∙ rafind2∙ rahash2∙ rarun2
∙ rasm2∙ rax2∙ radare2
Binary diffing
8
![Page 25: Building a concrete alternative to IDA - Radare2 to the rescue!](https://reader031.fdocuments.net/reader031/viewer/2022030320/586a37821a28ab17578c398d/html5/thumbnails/25.jpg)
r2tools
∙ ragg2∙ radiff2∙ rabin2
∙ rafind2∙ rahash2∙ rarun2
∙ rasm2∙ rax2∙ radare2
Binary program info extractor (think readelf )
8
![Page 26: Building a concrete alternative to IDA - Radare2 to the rescue!](https://reader031.fdocuments.net/reader031/viewer/2022030320/586a37821a28ab17578c398d/html5/thumbnails/26.jpg)
r2tools
∙ ragg2∙ radiff2∙ rabin2
∙ rafind2∙ rahash2∙ rarun2
∙ rasm2∙ rax2∙ radare2
Search for byte patterns in files
8
![Page 27: Building a concrete alternative to IDA - Radare2 to the rescue!](https://reader031.fdocuments.net/reader031/viewer/2022030320/586a37821a28ab17578c398d/html5/thumbnails/27.jpg)
r2tools
∙ ragg2∙ radiff2∙ rabin2
∙ rafind2∙ rahash2∙ rarun2
∙ rasm2∙ rax2∙ radare2
Block based hashing utility
8
![Page 28: Building a concrete alternative to IDA - Radare2 to the rescue!](https://reader031.fdocuments.net/reader031/viewer/2022030320/586a37821a28ab17578c398d/html5/thumbnails/28.jpg)
r2tools
∙ ragg2∙ radiff2∙ rabin2
∙ rafind2∙ rahash2∙ rarun2
∙ rasm2∙ rax2∙ radare2
Run programs in exotic environments
8
![Page 29: Building a concrete alternative to IDA - Radare2 to the rescue!](https://reader031.fdocuments.net/reader031/viewer/2022030320/586a37821a28ab17578c398d/html5/thumbnails/29.jpg)
r2tools
∙ ragg2∙ radiff2∙ rabin2
∙ rafind2∙ rahash2∙ rarun2
∙ rasm2∙ rax2∙ radare2
Assembler/disassembler
8
![Page 30: Building a concrete alternative to IDA - Radare2 to the rescue!](https://reader031.fdocuments.net/reader031/viewer/2022030320/586a37821a28ab17578c398d/html5/thumbnails/30.jpg)
r2tools
∙ ragg2∙ radiff2∙ rabin2
∙ rafind2∙ rahash2∙ rarun2
∙ rasm2∙ rax2∙ radare2
Base converter
8
![Page 31: Building a concrete alternative to IDA - Radare2 to the rescue!](https://reader031.fdocuments.net/reader031/viewer/2022030320/586a37821a28ab17578c398d/html5/thumbnails/31.jpg)
r2tools
∙ ragg2∙ radiff2∙ rabin2
∙ rafind2∙ rahash2∙ rarun2
∙ rasm2∙ rax2∙ radare2
Combine everything together
8
![Page 32: Building a concrete alternative to IDA - Radare2 to the rescue!](https://reader031.fdocuments.net/reader031/viewer/2022030320/586a37821a28ab17578c398d/html5/thumbnails/32.jpg)
platforms
Runs on
∙ Windows∙ GNU/Linux∙ *BSD∙ OSX∙ Android and iOS∙ Smartwatch∙ Web browser∙ QNX∙ …
Handles
∙ MZ/PE+/PE/COFF∙ ELF, ELF64∙ Fatmach0/Mach0∙ DEX/JAVA∙ BIOS/TE∙ GB/GBA/DS∙ XBOX∙ Plan9∙ BIOS
9
![Page 33: Building a concrete alternative to IDA - Radare2 to the rescue!](https://reader031.fdocuments.net/reader031/viewer/2022030320/586a37821a28ab17578c398d/html5/thumbnails/33.jpg)
architectures
∙ 8051∙ arc∙ arm∙ avr
∙ brainfuck∙ cr16∙ csr∙ dalvik
∙ dcpu16∙ ebc∙ gb∙ h8300
10
![Page 34: Building a concrete alternative to IDA - Radare2 to the rescue!](https://reader031.fdocuments.net/reader031/viewer/2022030320/586a37821a28ab17578c398d/html5/thumbnails/34.jpg)
architectures
∙ i4004∙ i8080∙ java∙ LH5801
∙ m68k∙ malbolge∙ mips∙ msil
∙ msp430∙ nios2∙ powerpc∙ rar
10
![Page 35: Building a concrete alternative to IDA - Radare2 to the rescue!](https://reader031.fdocuments.net/reader031/viewer/2022030320/586a37821a28ab17578c398d/html5/thumbnails/35.jpg)
architectures
∙ ART∙ sh∙ sparc∙ spc700∙ sysz
∙ tms320∙ v850∙ whitespace∙ x86∙ xcore
∙ z80∙ propeller∙ snes∙ psosvm∙ 6502
10
![Page 36: Building a concrete alternative to IDA - Radare2 to the rescue!](https://reader031.fdocuments.net/reader031/viewer/2022030320/586a37821a28ab17578c398d/html5/thumbnails/36.jpg)
r2 internals
![Page 37: Building a concrete alternative to IDA - Radare2 to the rescue!](https://reader031.fdocuments.net/reader031/viewer/2022030320/586a37821a28ab17578c398d/html5/thumbnails/37.jpg)
r2 is a library
∙ At it’s heart, a library.∙ Swig/Valabind∙ Build your own toolson top of radare2
12
![Page 38: Building a concrete alternative to IDA - Radare2 to the rescue!](https://reader031.fdocuments.net/reader031/viewer/2022030320/586a37821a28ab17578c398d/html5/thumbnails/38.jpg)
r2 is a library, with r2pipe included
Bindings are boring, let’s call r2 instead!
13
![Page 39: Building a concrete alternative to IDA - Radare2 to the rescue!](https://reader031.fdocuments.net/reader031/viewer/2022030320/586a37821a28ab17578c398d/html5/thumbnails/39.jpg)
r2 is pluggable
3rd party (or 1st party) plugins
∙ r_asm, assembler and disassembler∙ r_anal, code analysis (opcode, type, esil)∙ r_reg, registers∙ r_syscall, system calls∙ r_debug, debugger∙ r_io, io layer∙ r_search, search engine∙ …
14
![Page 40: Building a concrete alternative to IDA - Radare2 to the rescue!](https://reader031.fdocuments.net/reader031/viewer/2022030320/586a37821a28ab17578c398d/html5/thumbnails/40.jpg)
feature comparison
![Page 41: Building a concrete alternative to IDA - Radare2 to the rescue!](https://reader031.fdocuments.net/reader031/viewer/2022030320/586a37821a28ab17578c398d/html5/thumbnails/41.jpg)
ida has a book, r2 is self-documented (and also has a book too)
∙ R2 is like vim∙ Combine intuitives commands∙ Just append ? everywhere
16
![Page 42: Building a concrete alternative to IDA - Radare2 to the rescue!](https://reader031.fdocuments.net/reader031/viewer/2022030320/586a37821a28ab17578c398d/html5/thumbnails/42.jpg)
ida has plugins, r2 has more bindings
∙ Python∙ NodeJS∙ C∙ Lua∙ Lisp∙ Vala
∙ Ruby∙ Go∙ Rust∙ Perl∙ OCaml∙ …
17
![Page 43: Building a concrete alternative to IDA - Radare2 to the rescue!](https://reader031.fdocuments.net/reader031/viewer/2022030320/586a37821a28ab17578c398d/html5/thumbnails/43.jpg)
ida has some graphs, r2 does too (but in ascii)
∙ Minimap∙ Debugger-compliant∙ Interactive
18
![Page 44: Building a concrete alternative to IDA - Radare2 to the rescue!](https://reader031.fdocuments.net/reader031/viewer/2022030320/586a37821a28ab17578c398d/html5/thumbnails/44.jpg)
ida is clever but also interactive, so is r2
∙ name functions∙ mark flags∙ define code/data∙ leave comments∙ name stack variables∙ mark structures∙ use types∙ define/modifyfunctions
19
![Page 45: Building a concrete alternative to IDA - Radare2 to the rescue!](https://reader031.fdocuments.net/reader031/viewer/2022030320/586a37821a28ab17578c398d/html5/thumbnails/45.jpg)
ida has a nice gui, so does, well, err, mh, …
20
![Page 46: Building a concrete alternative to IDA - Radare2 to the rescue!](https://reader031.fdocuments.net/reader031/viewer/2022030320/586a37821a28ab17578c398d/html5/thumbnails/46.jpg)
actually…
It’s not all that scary!
∙ Visual Mode - friendly enough?∙ Familiar vim keybindings.∙ Web UI - The future of collaborative reversing!∙ Communicate over r2pipe.
21
![Page 47: Building a concrete alternative to IDA - Radare2 to the rescue!](https://reader031.fdocuments.net/reader031/viewer/2022030320/586a37821a28ab17578c398d/html5/thumbnails/47.jpg)
ida has an old-school tui mode, r2 has a better one.
∙ Ncurses-like∙ Static∙ Dynamic∙ Analysis∙ Try it, really.
22
![Page 48: Building a concrete alternative to IDA - Radare2 to the rescue!](https://reader031.fdocuments.net/reader031/viewer/2022030320/586a37821a28ab17578c398d/html5/thumbnails/48.jpg)
ida has no web-ui, r2 does.
23
![Page 49: Building a concrete alternative to IDA - Radare2 to the rescue!](https://reader031.fdocuments.net/reader031/viewer/2022030320/586a37821a28ab17578c398d/html5/thumbnails/49.jpg)
ida has a debugger, so does r2
∙ Classic features∙ Visual mode too∙ Severalbackends
∙ Tracing∙ Remote
24
![Page 50: Building a concrete alternative to IDA - Radare2 to the rescue!](https://reader031.fdocuments.net/reader031/viewer/2022030320/586a37821a28ab17578c398d/html5/thumbnails/50.jpg)
ida has kick-ass analysis, r2 has some too
∙ Functions detection∙ Local var detection∙ FLIRT integration∙ zignatures∙ (X)REF∙ DWARF and PDB
25
![Page 51: Building a concrete alternative to IDA - Radare2 to the rescue!](https://reader031.fdocuments.net/reader031/viewer/2022030320/586a37821a28ab17578c398d/html5/thumbnails/51.jpg)
ida some internal il, r2 has an open one
∙ ESIL∙ RPN-ish∙ Documented∙ Emulation∙ Decompilation∙ Analysis
26
![Page 52: Building a concrete alternative to IDA - Radare2 to the rescue!](https://reader031.fdocuments.net/reader031/viewer/2022030320/586a37821a28ab17578c398d/html5/thumbnails/52.jpg)
ida has plugins for pwnage, r2 put this in core
∙ Regexp ROP hunter∙ Mitigations detection∙ Emulation∙ Patterns∙ Environment control
27
![Page 53: Building a concrete alternative to IDA - Radare2 to the rescue!](https://reader031.fdocuments.net/reader031/viewer/2022030320/586a37821a28ab17578c398d/html5/thumbnails/53.jpg)
ida has plugins for bindiffing, r2 put this in core
28
![Page 54: Building a concrete alternative to IDA - Radare2 to the rescue!](https://reader031.fdocuments.net/reader031/viewer/2022030320/586a37821a28ab17578c398d/html5/thumbnails/54.jpg)
summary
![Page 55: Building a concrete alternative to IDA - Radare2 to the rescue!](https://reader031.fdocuments.net/reader031/viewer/2022030320/586a37821a28ab17578c398d/html5/thumbnails/55.jpg)
and now?
∙ GSoC∙ Stabilization∙ A fresh release∙ Second edition of our RSoC∙ ~1000 LoC modified per week
30
![Page 56: Building a concrete alternative to IDA - Radare2 to the rescue!](https://reader031.fdocuments.net/reader031/viewer/2022030320/586a37821a28ab17578c398d/html5/thumbnails/56.jpg)
current drawbacks
∙ Super-steep learningcurve
∙ A lot of features∙ Fast-moving target∙ IDA is friendlier
31
![Page 57: Building a concrete alternative to IDA - Radare2 to the rescue!](https://reader031.fdocuments.net/reader031/viewer/2022030320/586a37821a28ab17578c398d/html5/thumbnails/57.jpg)
current
∙ Free-software∙ Exotic arch support∙ Active development∙ A lot of features∙ More and more users
32
![Page 58: Building a concrete alternative to IDA - Radare2 to the rescue!](https://reader031.fdocuments.net/reader031/viewer/2022030320/586a37821a28ab17578c398d/html5/thumbnails/58.jpg)
who uses r2 currently?
∙ Some top-notch ctf teams∙ Shellphish∙ Dragon Sector∙ …
∙ Anti-malware companies∙ AlienVault∙ IOActive∙ …
∙ Some popular RE projects∙ Coreboot∙ Magic lantern∙ …
∙ Cool wargames∙ io from smashthestack∙ OverTheWire∙ …
We do!Do you?
33
![Page 59: Building a concrete alternative to IDA - Radare2 to the rescue!](https://reader031.fdocuments.net/reader031/viewer/2022030320/586a37821a28ab17578c398d/html5/thumbnails/59.jpg)
who uses r2 currently?
∙ Some top-notch ctf teams∙ Shellphish∙ Dragon Sector∙ …
∙ Anti-malware companies∙ AlienVault∙ IOActive∙ …
∙ Some popular RE projects∙ Coreboot∙ Magic lantern∙ …
∙ Cool wargames∙ io from smashthestack∙ OverTheWire∙ …
We do!Do you?
33
![Page 60: Building a concrete alternative to IDA - Radare2 to the rescue!](https://reader031.fdocuments.net/reader031/viewer/2022030320/586a37821a28ab17578c398d/html5/thumbnails/60.jpg)
and tomorrow?
∙ Complete-emulation∙ Decompilation∙ A complete GUI∙ What do you want?
34
![Page 61: Building a concrete alternative to IDA - Radare2 to the rescue!](https://reader031.fdocuments.net/reader031/viewer/2022030320/586a37821a28ab17578c398d/html5/thumbnails/61.jpg)
conclusion
Question IDA supremacy1.Monoculture is bad.
1And don’t pirate it!35
![Page 62: Building a concrete alternative to IDA - Radare2 to the rescue!](https://reader031.fdocuments.net/reader031/viewer/2022030320/586a37821a28ab17578c398d/html5/thumbnails/62.jpg)
conclusion
Radare2 is nice.You should use it.1
1Or at least try it35
![Page 63: Building a concrete alternative to IDA - Radare2 to the rescue!](https://reader031.fdocuments.net/reader031/viewer/2022030320/586a37821a28ab17578c398d/html5/thumbnails/63.jpg)
resources
∙ TV channel - http://radare.tv/∙ Book - http://maijin.gitbooks.io/radare2book/content/∙ Blog - http://radare.today/∙ Homepage - http://rada.re/∙ Source code - http://github.com/radare/radare2/∙ IRC channel - irc://irc.freenode.net/radare
Come talk to us!
36
![Page 64: Building a concrete alternative to IDA - Radare2 to the rescue!](https://reader031.fdocuments.net/reader031/viewer/2022030320/586a37821a28ab17578c398d/html5/thumbnails/64.jpg)
Questions?
37