Getting Set Up
Over the course of this training, you'll solve challenges that use real hardware and software. Before each challenge, you'll want to take a moment to set up your host PC and GreatFET devices.
Most challenges will include one or more types of binaries or python scripts:
- Binaries and python scripts with a icon are intended to run on your host computer, and are "statically linked"-- which means they include most of their dependencies.
They've been tested with the Ubuntu image distributed during in-person classes, but will likely also work on other Linux installations.
- Binaries with a icon are intended to run on a GreatFET .
You'll program these to one of the two GreatFET devices provided with the course-- allowing the GreatFET to simulate a target device.
Ensuring you're on the latest verisons
The live USB image provied with the course ships with copies of each of the open-source projects used in the course. Before you being, run the following commands to ensure you have the latest versions:
# Update the GreatFET repo
cd ~/greatfet; git pull
# Update the FaceDancer repo
cd ~/facedancer; git pull
# Update the Course Materials repo
cd ~/usb-course-materials; git pull
Loading a GreatFET Binary
The easiest way to load GreatFET Target binaries is using the
greatfet firmware tool (
gf fw for short). To keep things simple, we'll load from Device Firmware Update (DFU) mode -- which works no matter the state of your GreatFET and makes selecting which GreatFET you're working with easy.
Entering DFU mode is simple:
- Press and hold the
DFUbutton on your GreatFET.
- Without releasing the
DFUbutton, press and release the
- Release the
DFUbutton. Your GreatFET should not have any illuminated LEDs, and should show up as a
NXP Semiconductors LPC, 1fc9:000C.
Once the device is in DFU mode, you can load a GreatFET binary with the following command:
greatfet firmware -d -w <bin_filename>
or, for short:
gf fw -dw <bin_filename>
For example, if your binary was called
single_packet_analysis.bin, you could load and run it with the following command:
greatfet firmware -d -w single_packet_analysis.bin
You can use the same process to restore the default GreatFET firmware. An appropriate version of the GreatFET firmware is built into the host tools distribution. You can restore the original firmware at any time by running the following command with the GreatFET in DFU mode:
greatfet firmware -d --autoflash
Running a Host Binary
Host binaries are designed to run from the training's live environment or docker image, but will likely run on any modern Linux machine. You can run these binaries in the same way you'd run any other Linux script or binary. To run a program called
host_communication, you'd simply run the binary from the Linux command line: