This repository contains UNO's code for the 2019 MITRE eCTF.
This document contains instructions to set up the development environment.
To host the VM using Vagrant you must have the following tools installed on your host machine:
- VirtualBox (can be installed from distro repository)
- VirtualBox Extension Pack (this too)
- Vagrant (install specifically from this site)
Install VirtualBox and the VirtualBox Extension Pack first.
On Linux, you will also need to add your user to the vboxusers
group.
Next, install the latest version of Vagrant.
- At least 50GB of disk space once all the above tools are installed. You will need more if you decide to install Vivado.
- At least 4 CPU threads. You can operate with less but you will need to change the number of CPUs in
provision/config.rb
- At least 8 GB of ram. You can operate with less but you will need to modify the amount of provisioned ram in
provision/config.rb
. We recommend using no more than half of the total amount of RAM on your system.
Follow the below instructions to provision the development environment.
Note, this will take a LONG time so be patient!
When the petalinux tools are being installed, you may want to get up and do something else while it works.
It could take over an hour depending on your system specs.
- Clone the Vagrant Setup repository onto your machine.
- Navigate to the directory where this
README
is located; this should be where theVagrantfile
is. - Modify configuration options contained in
provision/config.rb
, change $petalinux_git value tohttps://$USER:$PASS@github.com/$NULLIFYGITHUB/$REPO
. - Download the Petalinux Tools with username and password and put it in the
downloads
folder. - Create, boot, and provision the VM via the
vagrant up
command. The GUI will appear before the vagrant provisioning process has completed. Wait for the vagrant process to finish before interacting with the VM. - Restart the VM for all changes to take place with
vagrant halt && vagrant up
. - Login the vm with username and password
vagrant:vagrant
or ssh into VM withvagrant ssh
Note: To start the provisioning process again use
vagrant destroy
and go back to step 4.
- Ensure all previous steps have been completed.
- Go into MES tools directory
cd ~/MES/tools
- Build the system:
python3 provisionSystem.py demo_files/demo_users.txt demo_files/demo_default.txt
- Build the games:
python3 provisionGames.py files/generated/FactorySecrets.txt demo_files/demo_games.txt
- Package the system:
python3 packageSystem.py files/generated/SystemImage.bif
- Insert SD card into host computer and passthrough to VM.
- Identify SD card in VM
lsblk
- Deploy system to SD card:
python3 deploySystem.py /dev/sdX files/uno_BOOT.BIN files/generated/MES.bin files/generated/games
(replacing/dev/sdX
with the appropriate device) - Remove SD card and place it in the board
- Plug in the board to the host computer and on the Arty Z7 board, move jumper JP4 to the two pins labeled 'SD'
- Access UART
sudo minicom -D /dev/ttyUSB1
. You will need to disable thehardware flow control
setting to have UART work appropriately. To do so, presscontrol A
and thenz
while runningminicom
, then hitO
, go toSerial port setup
, and then pressF
. You may want to save this configuration so you don't need to set this up every time you runminicom
. - Press the
PORB
button on the board to reset it. You should now see the mesh shell boot and will be greeted with the login prompt - Log in with the demo credentials
demo:00000000
- List Mesh commands with
help
Note: Games will boot to an external display through HDMI-out.