BLE CTF: How to flash the ESP32


If you want to do Hackgnar’s BLE CTF but you’ve been struggling with flashing the ESP worry not! I have created a vagrant developer environment just for this.

The environment can be found here:

To use it you need to have Vagrant and VirtualBox installed.

After you got those installed, clone the repo and run the following commands on the terminal. This will start up the VM and ssh into it.

vagrant up && vagrant ssh

This will take a while, there’s a lot of dependencies that have to be installed.
After the command has completed you should now be logged in into the vagrant machine. Now plug in your ESP32 and make sure that it’s recognised, run lsusb to list all devices and check for /dev/ttyUSB0, if that isn’t present then flashing won’t work. The last step is to flash.

cd ble_ctf
make flash

Screen Shot 2018-07-09 at 18.41.47

I only tested this setup on my own machine. It might not detect all boards automatically, because the boards are made by different manufacturers and I did not fingerprint them all (see Vagrantfile). In case your board is not detected, an easy fix is to fire up VirtualBox, login with vagrant:vagrant and right click settings -> USB -> add new usb device.

Check my How to get started with FreeRTOS and ESP8266  post as it has more details on how to do that.

If the board is not seen by your operating system then there are several things you could try:

  • Try different USB cables. Some cables support only power transfer.
  • Try installing the driver required by the board’s serial communication chip.
  • Make sure your board is not broken. :/

Happy hacking!

3 thoughts on “BLE CTF: How to flash the ESP32

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.