Difference between pages "Geeks on a Train" and "Tutorials/Reverse engineering embedded software using Radare2"

From LCA2015 Delegate wiki
(Difference between pages)
Jump to: navigation, search
(Saturday 17 January)
 
 
Line 1: Line 1:
KiwiRail's Northern Explorer is a well-known scenic train journey that operates three days a week from Auckland to Wellington.
+
This page describes preparation for [http://linux.conf.au/schedule/30102/view_talk?day=thursday Reverse engineering embedded software using Radare2]
  
A group of intrepid LCA delegates are taking the train down on Saturday 17 January.
+
== Outline ==
  
[http://www.seat61.com/northern-explorer.htm Seat61] has a great summary of the journey.
+
We will try and get through all the following:
  
== Tickets ==
+
* Introduction to Radare2 reverse engineering tool
 +
* The Radare2 utilities
 +
* Basics of using the Radare to examine a binary you probably have on your laptop
 +
* Looking at an arduino binary
 +
* Introduction to MIPS architecture and disassembly
 +
* Extracting firmware images
  
Are available from [http://kiwirailscenic.co.nz Kiwi Rail Scenic]
+
You might like to bring your own binary to play with as well instead!
  
If you don't live in NZ, the only ticket price available is the Flexi fare, which is NZD$199. Cheaper tickets, starting at NZD$139 at the time of writing are available for online booking from NZ, or if you do location spoofing.
+
==Important - please make an rc file ==
  
* [https://hola.org/ Hola] seems to work just fine for purpose, though it's not free software.
+
Radare2 was created by other, many people. Radare2 will by default print fortune cookies. Please, turn this feature off, by making the following file, in case there is a possibility of NSFW output.
* [https://www.torproject.org/ Tor] will also work, provided you restrict to NZ-based exit nodes.
+
  
Kiwi Rail accept all the major credit cards including Amex.
+
Instructions for Linux/Unix systems:
  
== Attending ==
+
    echo 'e cfg.fortunes=false' > ~/.radare2rc
  
 +
== Prerequisites ==
  
=== To Auckland ===
+
If during the tutorial you are planning to follow the examples and/or try your own ideas, you really want to get this sorted before the event.
  
=== To Wellington ===
+
Minimum requirements:
 +
* a C compiler and libraries needed to build radare2 - the "apt-gettable" version is out of date
 +
* xdot for viewing callgraphs
 +
* binwalk and srecord for firmware hacking
  
==== Saturday 17 January ====
+
Various other tools may be helpful, and indeed needed (e.g. an editor) to complete some of the examples
  
Please only list yourselves on this list once your ticket is booked. If at all possible, please list your name as it appears on your ticket, as I'll use this page to ask KiwiRail to seat as many of us together as possible.
+
If you are using a Debian-derived distro, for example:
  
* Christopher Neugebauer
+
    sudo apt-get install build-essential git xdot eog ghex binwalk vim gedit srecord
* Jack Scott
+
* Cory Thompson
+
* Jethro Carr
+
* Clinton Roy
+
* Joshua Berkus
+
* Geordie Millar
+
* Michael Wheeler
+
* maia sauren
+
  
== Kiwi Train Songs ==
+
It should be possible to build radare2 on Linux, FreeBSD/NetBSD etc, Max OS/X and Windows and possibly on Android if you try hard enough (using a Debian root, for example)
  
* [http://www.folksong.org.nz/taumarunui/index.html Taumaranui on the Main Trunk Line] (lyrics + youtube vid). [http://www.nzhistory.net.nz/media/photo/railway-songs NZ History net page on the song]
+
However, the tutorial examples have only been tested using Debian Wheezy.
* [http://folksong.org.nz/trainsongs.html List of NZ Train songs]. Some are on  youtube but not linked. eg [https://www.youtube.com/watch?v=ZWNzMm0vB_c Okaihau express]
+
 
 +
=== Clone & build radare2 ===
 +
 
 +
Note, changing to the lca2015_tutorial branch is important, because the software is under active development there could be breakage in master upstream
 +
 
 +
    git clone http://github.com/pastcompute/radare2
 +
    cd radare2
 +
    git checkout tutorial_branch
 +
    ./configure
 +
    make -j
 +
    sudo make symstall
 +
 
 +
Note, you can install as a normal user if you need to:
 +
 
 +
    ./configure --prefix=$HOME/path/to/wherever
 +
    make -j
 +
    sudo make symstall
 +
    export PATH=$HOME/path/to/wherever:$PATH
 +
 
 +
Clone the examples repository, ready for use during the tutorial
 +
 
 +
    cd
 +
    git clone http://github.com/pastcompute/lca2015-radare2-tutorial
 +
 
 +
I have already added prebuilt examples to git but there are instructions for building them in git, you will need the arduino IDE or an openwrt buildroot.
 +
 
 +
==Troubleshooting==
 +
 
 +
The tutorial is not until Thursday afternoon. If you need help with the above ping me on Twitter, preferably before the day! [https://twitter.com/pastcompute @pastcompute]

Revision as of 22:35, 10 January 2015

This page describes preparation for Reverse engineering embedded software using Radare2

Outline

We will try and get through all the following:

  • Introduction to Radare2 reverse engineering tool
  • The Radare2 utilities
  • Basics of using the Radare to examine a binary you probably have on your laptop
  • Looking at an arduino binary
  • Introduction to MIPS architecture and disassembly
  • Extracting firmware images

You might like to bring your own binary to play with as well instead!

Important - please make an rc file

Radare2 was created by other, many people. Radare2 will by default print fortune cookies. Please, turn this feature off, by making the following file, in case there is a possibility of NSFW output.

Instructions for Linux/Unix systems:

   echo 'e cfg.fortunes=false' > ~/.radare2rc

Prerequisites

If during the tutorial you are planning to follow the examples and/or try your own ideas, you really want to get this sorted before the event.

Minimum requirements:

  • a C compiler and libraries needed to build radare2 - the "apt-gettable" version is out of date
  • xdot for viewing callgraphs
  • binwalk and srecord for firmware hacking

Various other tools may be helpful, and indeed needed (e.g. an editor) to complete some of the examples

If you are using a Debian-derived distro, for example:

   sudo apt-get install build-essential git xdot eog ghex binwalk vim gedit srecord

It should be possible to build radare2 on Linux, FreeBSD/NetBSD etc, Max OS/X and Windows and possibly on Android if you try hard enough (using a Debian root, for example)

However, the tutorial examples have only been tested using Debian Wheezy.

Clone & build radare2

Note, changing to the lca2015_tutorial branch is important, because the software is under active development there could be breakage in master upstream

   git clone http://github.com/pastcompute/radare2
   cd radare2
   git checkout tutorial_branch
   ./configure
   make -j
   sudo make symstall

Note, you can install as a normal user if you need to:

   ./configure --prefix=$HOME/path/to/wherever
   make -j
   sudo make symstall
   export PATH=$HOME/path/to/wherever:$PATH

Clone the examples repository, ready for use during the tutorial

   cd
   git clone http://github.com/pastcompute/lca2015-radare2-tutorial

I have already added prebuilt examples to git but there are instructions for building them in git, you will need the arduino IDE or an openwrt buildroot.

Troubleshooting

The tutorial is not until Thursday afternoon. If you need help with the above ping me on Twitter, preferably before the day! @pastcompute