Home

Awesome

Exploit example on Xtensa

Sample exploit (buffer overflow) on Xtensa

How to use example

Configure the project

make menuconfig

Make sure:
Stack smashing protection mode is set to Strong
if you're running on QEMU emalator enable FreeRTOS run on first core option.

Build and Flash

Build the project and flash it to the board, then run monitor tool to view serial output:

make -j4 flash monitor

(To exit the serial monitor, type Ctrl-].)

See the Getting Started Guide for full steps to configure and use ESP-IDF to build projects.

Example Output

There is the console output for this example:

I (255) cpu_start: Starting scheduler on PRO CPU. E (280) test: Stack Canary ->>> de2062b5

E (280) test: Print address function ->>> 800d1e93

E (280) test: Stack pointer for main_task function sp 3ffb39a0 ->>> 3ffb39e0

E (290) test: app_main: SHALL RETURN TO print_error E (290) test: print_error: First, SHALL NOT BE HERE! Second Argument is equal to deadbeef E (300) test: print_error: First, SHALL NOT BE HERE! Second Argument is equal to deadbeef E (310) test: print_error: First, SHALL NOT BE HERE! Second Argument is equal to deadbeef E (320) test: print_error: First, SHALL NOT BE HERE! Second Argument is equal to deadbeef E (330) test: print_error: First, SHALL NOT BE HERE! Second Argument is equal to deadbeef