Radare2 - 情報セキュリティ株式会社Information Security Confidential - Partner Use Only...

19
Information Security Inc. Radare2

Transcript of Radare2 - 情報セキュリティ株式会社Information Security Confidential - Partner Use Only...

Page 1: Radare2 - 情報セキュリティ株式会社Information Security Confidential - Partner Use Only Dependencies 4 •radare2 can be built without any special dependency, just use make

Information Security Inc.

Radare2

Page 2: Radare2 - 情報セキュリティ株式会社Information Security Confidential - Partner Use Only Dependencies 4 •radare2 can be built without any special dependency, just use make

Information Security Confidential - Partner Use Only

Contents

2

• What is Radare2?

• Dependencies

• Testing Setup

• Installing Radare2

• Using Radare2

• References

Page 3: Radare2 - 情報セキュリティ株式会社Information Security Confidential - Partner Use Only Dependencies 4 •radare2 can be built without any special dependency, just use make

Information Security Confidential - Partner Use Only

What is Radare2?

3

• Advanced commandline hexadecimal editor, disassembler and

debugger

Page 4: Radare2 - 情報セキュリティ株式会社Information Security Confidential - Partner Use Only Dependencies 4 •radare2 can be built without any special dependency, just use make

Information Security Confidential - Partner Use Only

Dependencies

4

• radare2 can be built without any special dependency, just use

make and get a working toolchain (gcc, clang, tcc, ..)

• Optionally you can use libewf for loading EnCase disk image.

• To build the bindings you need latest valabind, g++ and swig2

Page 5: Radare2 - 情報セキュリティ株式会社Information Security Confidential - Partner Use Only Dependencies 4 •radare2 can be built without any special dependency, just use make

Information Security Confidential - Partner Use Only

Testing Setup

5

• Kali Linux 2018.1

Page 6: Radare2 - 情報セキュリティ株式会社Information Security Confidential - Partner Use Only Dependencies 4 •radare2 can be built without any special dependency, just use make

Information Security Confidential - Partner Use Only

Installing Radare2

6

• Using apt

Page 7: Radare2 - 情報セキュリティ株式会社Information Security Confidential - Partner Use Only Dependencies 4 •radare2 can be built without any special dependency, just use make

Information Security Confidential - Partner Use Only

Installing Radare2

7

• From GitHub

Page 8: Radare2 - 情報セキュリティ株式会社Information Security Confidential - Partner Use Only Dependencies 4 •radare2 can be built without any special dependency, just use make

Information Security Confidential - Partner Use Only

Using Radare2

8

• Solving fauxware (https://github.com/angr/angr-

doc/blob/master/examples/fauxware/fauxware.c)

Page 9: Radare2 - 情報セキュリティ株式会社Information Security Confidential - Partner Use Only Dependencies 4 •radare2 can be built without any special dependency, just use make

Information Security Confidential - Partner Use Only

Using Radare2

9

• Run the program >>> Password Challenge! Apparently, its just a

simple program that tests a password entered by the user

Page 10: Radare2 - 情報セキュリティ株式会社Information Security Confidential - Partner Use Only Dependencies 4 •radare2 can be built without any special dependency, just use make

Information Security Confidential - Partner Use Only

Using Radare2

10

• Starting Radare2 with analyze and debug options

Page 11: Radare2 - 情報セキュリティ株式会社Information Security Confidential - Partner Use Only Dependencies 4 •radare2 can be built without any special dependency, just use make

Information Security Confidential - Partner Use Only

Using Radare2

11

• Let’s look at the functions present in the binary, main is at address

0x557e51699875

Page 12: Radare2 - 情報セキュリティ株式会社Information Security Confidential - Partner Use Only Dependencies 4 •radare2 can be built without any special dependency, just use make

Information Security Confidential - Partner Use Only

Using Radare2

12

• The code in the main function, “s main” (seek main)

Page 13: Radare2 - 情報セキュリティ株式会社Information Security Confidential - Partner Use Only Dependencies 4 •radare2 can be built without any special dependency, just use make

Information Security Confidential - Partner Use Only

Using Radare2

13

• The code in the main function, “pdf @main” (print disassemble

function)

Page 14: Radare2 - 情報セキュリティ株式会社Information Security Confidential - Partner Use Only Dependencies 4 •radare2 can be built without any special dependency, just use make

Information Security Confidential - Partner Use Only

Using Radare2

14

• We can see the code jumps to 0x557e51699925 (sym.rejected) if

eax is zero (test eax,eax)

Page 15: Radare2 - 情報セキュリティ株式会社Information Security Confidential - Partner Use Only Dependencies 4 •radare2 can be built without any special dependency, just use make

Information Security Confidential - Partner Use Only

Using Radare2

15

• Let’s modify the program and unconditionally jump to

0x557e5169991e (sym.accepted)

Page 16: Radare2 - 情報セキュリティ株式会社Information Security Confidential - Partner Use Only Dependencies 4 •radare2 can be built without any special dependency, just use make

Information Security Confidential - Partner Use Only

Using Radare2

16

• Open the program in writing mode using the “w” keyword

Page 17: Radare2 - 情報セキュリティ株式会社Information Security Confidential - Partner Use Only Dependencies 4 •radare2 can be built without any special dependency, just use make

Information Security Confidential - Partner Use Only

Using Radare2

17

• Open the program in writing mode using the “w” keyword, use the

command “wa jmp 0x0000091e @ 0x00000917

Page 18: Radare2 - 情報セキュリティ株式会社Information Security Confidential - Partner Use Only Dependencies 4 •radare2 can be built without any special dependency, just use make

Information Security Confidential - Partner Use Only

Using Radare2

18

• Run the program again and got “Welcome to the admin console,

trusted user!” Done!

Page 19: Radare2 - 情報セキュリティ株式会社Information Security Confidential - Partner Use Only Dependencies 4 •radare2 can be built without any special dependency, just use make

Information Security Confidential - Partner Use Only

References

19

• GitHub

https://github.com/radare/radare2

• Official website

http://www.radare.org/r/

• Tutorials

https://moveax.me/radare-basics/

https://www.megabeets.net/a-journey-into-radare-2-part-1/

https://www.megabeets.net/a-journey-into-radare-2-part-2/