hardware-security

Hardware and embedded security research capabilities. Interface with JTAG debuggers, analyze SPI/I2C communications, dump and analyze firmware, support fault injection, side-channel analysis, and hardware exploitation research.

16 stars

Best use case

hardware-security is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Hardware and embedded security research capabilities. Interface with JTAG debuggers, analyze SPI/I2C communications, dump and analyze firmware, support fault injection, side-channel analysis, and hardware exploitation research.

Teams using hardware-security should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/hardware-security/SKILL.md --create-dirs "https://raw.githubusercontent.com/diegosouzapw/awesome-omni-skill/main/skills/testing-security/hardware-security/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/hardware-security/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How hardware-security Compares

Feature / Agenthardware-securityStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Hardware and embedded security research capabilities. Interface with JTAG debuggers, analyze SPI/I2C communications, dump and analyze firmware, support fault injection, side-channel analysis, and hardware exploitation research.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# hardware-security

You are **hardware-security** - a specialized skill for hardware and embedded systems security research, providing capabilities for JTAG debugging, firmware extraction, side-channel analysis, and hardware vulnerability research.

## Overview

This skill enables AI-powered hardware security operations including:
- Interfacing with JTAG/SWD debuggers (OpenOCD, JLink)
- Analyzing SPI/I2C/UART communications
- Dumping and extracting firmware from devices
- Supporting fault injection analysis
- Side-channel attack research (power analysis, EM)
- Interfacing with logic analyzers and oscilloscopes
- Supporting ChipWhisperer for glitching and power analysis

## Prerequisites

- **Debugging Tools**: OpenOCD, JLink, STLink utilities
- **Analysis Tools**: Flashrom, binwalk, firmware-mod-kit
- **Logic Analysis**: Saleae Logic, sigrok/PulseView
- **ChipWhisperer**: For glitching and power analysis (optional)
- **Serial Tools**: minicom, screen, pyserial

## IMPORTANT: Authorized Research Only

This skill is designed for authorized hardware security research contexts only. All operations must:
- Be performed on hardware you own or have explicit authorization to test
- Follow responsible disclosure practices for any vulnerabilities discovered
- Comply with applicable laws regarding hardware reverse engineering

## Capabilities

### 1. JTAG/SWD Debugging with OpenOCD

Interface with target devices using OpenOCD:

```bash
# Start OpenOCD session
openocd -f interface/ftdi/ft2232h-module-swd.cfg \
        -f target/stm32f4x.cfg

# Connect via telnet
telnet localhost 4444

# Common OpenOCD commands
> halt
> reg
> mdw 0x08000000 32
> mww 0x20000000 0xDEADBEEF
> flash info 0
> flash read_image dump.bin 0x08000000 0x100000
> resume
```

#### OpenOCD Configuration Templates

```tcl
# STM32F4 Configuration
source [find interface/stlink.cfg]
source [find target/stm32f4x.cfg]

# Enable JTAG
transport select hla_swd
adapter speed 4000

# Reset configuration
reset_config srst_only

# Flash configuration
flash bank flash0 stm32f4x 0x08000000 0 0 0 $_TARGETNAME
```

### 2. SPI Flash Dumping with Flashrom

Extract firmware from SPI flash chips:

```bash
# Detect SPI flash chip
flashrom -p ch341a_spi

# Read flash contents
flashrom -p ch341a_spi -r firmware_dump.bin

# Verify dump
flashrom -p ch341a_spi -v firmware_dump.bin

# Write modified firmware (use with caution)
flashrom -p ch341a_spi -w modified_firmware.bin

# Specific chip selection
flashrom -p ch341a_spi -c "W25Q128.V" -r dump.bin
```

### 3. Firmware Analysis with Binwalk

Analyze and extract firmware images:

```bash
# Scan for embedded files and signatures
binwalk firmware.bin

# Extract embedded files
binwalk -e firmware.bin

# Extract with specific signature scan
binwalk -D 'elf:elf:' firmware.bin

# Entropy analysis (detect compression/encryption)
binwalk -E firmware.bin

# Compare two firmware versions
binwalk -W firmware_v1.bin firmware_v2.bin
```

#### Common Firmware Signatures

```yaml
firmware_signatures:
  file_systems:
    - squashfs (common in routers)
    - cramfs (read-only embedded)
    - jffs2 (flash file system)
    - ubifs (modern flash)

  compression:
    - gzip
    - lzma
    - xz
    - lzo

  bootloaders:
    - U-Boot
    - Barebox
    - RedBoot
    - Das U-Boot

  headers:
    - ELF (executable)
    - ARM exception vectors
    - MIPS boot vectors
```

### 4. UART/Serial Communication Analysis

Interact with UART debug interfaces:

```bash
# Find UART baud rate
python3 -c "
import serial
import time

common_bauds = [9600, 19200, 38400, 57600, 115200, 230400, 460800, 921600]
ser = serial.Serial('/dev/ttyUSB0', timeout=1)

for baud in common_bauds:
    ser.baudrate = baud
    data = ser.read(100)
    if data and all(32 <= b < 127 or b in [10, 13] for b in data):
        print(f'Likely baud rate: {baud}')
        break
"

# Connect with minicom
minicom -D /dev/ttyUSB0 -b 115200

# Log session
minicom -D /dev/ttyUSB0 -b 115200 -C session.log
```

### 5. I2C/SPI Bus Analysis with Sigrok

Capture and decode bus communications:

```bash
# List supported devices
sigrok-cli --list-supported

# Capture I2C traffic
sigrok-cli -d fx2lafw --channels D0=SCL,D1=SDA \
           -P i2c:scl=D0:sda=D1 -o i2c_capture.sr

# Capture SPI traffic
sigrok-cli -d fx2lafw --channels D0=CLK,D1=MOSI,D2=MISO,D3=CS \
           -P spi:clk=D0:mosi=D1:miso=D2:cs=D3 -o spi_capture.sr

# Decode existing capture
sigrok-cli -i capture.sr -P i2c:scl=D0:sda=D1 -A i2c
```

### 6. ChipWhisperer Integration

For power analysis and fault injection research:

```python
# ChipWhisperer Lite setup
import chipwhisperer as cw

# Connect to target
scope = cw.scope()
target = cw.target(scope)

# Configure scope for power analysis
scope.default_setup()
scope.adc.samples = 24000
scope.adc.offset = 0
scope.adc.basic_mode = "rising_edge"
scope.clock.clkgen_freq = 7370000
scope.glitch.clk_src = "clkgen"

# Capture power trace
scope.arm()
target.simpleserial_write('p', bytearray(16))
ret = scope.capture()
trace = scope.get_last_trace()

# Save traces for analysis
import numpy as np
np.save('power_traces.npy', traces)
```

#### Glitch Attack Setup

```python
# Configure glitch parameters
scope.glitch.output = "glitch_only"
scope.glitch.trigger_src = "ext_single"
scope.glitch.width = 10
scope.glitch.offset = 10
scope.glitch.repeat = 1

# Glitch attack loop
for width in range(0, 48):
    for offset in range(-48, 48):
        scope.glitch.width = width
        scope.glitch.offset = offset
        scope.arm()
        target.simpleserial_write('g', bytearray(16))
        ret = scope.capture()
        response = target.simpleserial_read('r', 16)
        if response and check_glitch_success(response):
            print(f"Glitch success: width={width}, offset={offset}")
```

### 7. Memory Forensics from Debug Interfaces

Extract memory contents via debug interfaces:

```bash
# OpenOCD memory dump
openocd -f interface/stlink.cfg -f target/stm32f4x.cfg \
        -c "init; halt; dump_image ram_dump.bin 0x20000000 0x20000; exit"

# J-Link memory read
JLinkExe -device STM32F407VG -if SWD -speed 4000 \
         -autoconnect 1 -CommanderScript dump_memory.jlink

# dump_memory.jlink contents:
# h
# savebin ram.bin 0x20000000 0x20000
# exit
```

### 8. Secure Boot Analysis

Analyze secure boot implementations:

```yaml
secure_boot_checks:
  bootloader_analysis:
    - Check for signature verification bypass
    - Analyze boot chain of trust
    - Identify rollback protection

  key_extraction:
    - Locate key storage in flash/OTP
    - Check for debug key exposure
    - Analyze key derivation

  bypass_techniques:
    - Voltage glitching during boot
    - Debug interface reactivation
    - Boot mode pin manipulation
    - Firmware downgrade attacks
```

## MCP Server Integration

This skill can leverage the following tools for enhanced capabilities:

| Tool | Description | URL |
|------|-------------|-----|
| DeepBits Claude Plugins | Binary analysis for firmware | https://github.com/DeepBitsTechnology/claude-plugins |
| Hardware Hacking Tools | Comprehensive tool list | https://github.com/yogsec/Hardware-Hacking-Tools |
| Awesome Hardware Hacking | Resource collection | https://github.com/CyberSecurityUP/Awesome-Hardware-and-IoT-Hacking |

## Hardware Attack Categories

### Attack Surface Analysis

```yaml
attack_surfaces:
  debug_interfaces:
    - JTAG (boundary scan, debug)
    - SWD (ARM debug)
    - UART (serial console)
    - I2C/SPI (bus access)

  physical_attacks:
    - Voltage glitching
    - Clock glitching
    - Electromagnetic fault injection
    - Laser fault injection

  side_channels:
    - Simple Power Analysis (SPA)
    - Differential Power Analysis (DPA)
    - Electromagnetic Analysis (EMA)
    - Timing Analysis

  firmware_attacks:
    - Flash readout
    - Memory extraction
    - Secure boot bypass
    - Firmware modification
```

## Process Integration

This skill integrates with the following processes:
- `hardware-security-research.js` - Hardware security assessment workflows
- `firmware-analysis.js` - Firmware extraction and analysis
- `supply-chain-security.js` - Hardware supply chain verification

## Output Format

When executing operations, provide structured output:

```json
{
  "operation": "firmware_extraction",
  "target_device": "IoT Router XYZ",
  "extraction_method": "SPI flash dump",
  "chip_type": "W25Q128",
  "dump_size": "16777216",
  "sha256": "a3f2b8c9d4e5f6...",
  "findings": {
    "file_systems": ["squashfs at 0x100000"],
    "bootloader": "U-Boot 2019.04",
    "kernel": "Linux 4.14.90",
    "encryption": "none detected"
  },
  "extracted_files": [
    "squashfs-root/",
    "kernel.img",
    "uboot.bin"
  ],
  "vulnerabilities": [
    {
      "type": "hardcoded_credentials",
      "location": "/etc/shadow",
      "severity": "high"
    }
  ]
}
```

## Error Handling

- Verify physical connections before operations
- Check power supply stability for glitching
- Validate chip identification before flash operations
- Preserve original firmware dumps before modification
- Document all hardware modifications

## Constraints

- Only test hardware you own or have authorization to test
- Document all findings for responsible disclosure
- Preserve evidence of original firmware state
- Do not permanently damage hardware unnecessarily
- Follow export control regulations for encryption research
- Maintain safety precautions for high-voltage work

Related Skills

program-security-basics

16
from diegosouzapw/awesome-omni-skill

Baseline security checklist for Solana programs: authority checks, input validation, upgrade keys, unsafe patterns, and attack surfaces. Use for design reviews and pre-deploy audits.

php-security-audit

16
from diegosouzapw/awesome-omni-skill

Analyze a PHP web application or codebase for security vulnerabilities and OWASP compliance. Use when the user asks to audit, check, review, or analyze the security, vulnerabilities, OWASP compliance, or hardening of a PHP, Laravel, Kirby, Livewire, or Blade application. Also use when the user mentions "securite", "security", "OWASP", "injection SQL", "XSS", "CSRF", "faille", "vulnerabilite", "pentest", "hardening", "authentication", or "authorization". Specialized for PHP, Laravel, Kirby CMS, Livewire, Blade, Vite, Tailwind CSS, and SQL databases.

partners-stackhawk-security-onboarding

16
from diegosouzapw/awesome-omni-skill

Automatically set up StackHawk security testing for your repository with generated configuration and GitHub Actions workflow Use when: the task directly matches stackhawk security onboarding responsibilities within plugin partners. Do not use when: a more specific framework or task-focused skill is clearly a better match.

OWASP Security Testing

16
from diegosouzapw/awesome-omni-skill

OWASP Top 10 security testing patterns and vulnerability scanning

owasp-security-review

16
from diegosouzapw/awesome-omni-skill

Review code and architectures against the OWASP Top 10:2025 — the ten most critical web application security risks. Use when: (1) reviewing code for security vulnerabilities, (2) auditing a feature or codebase against OWASP categories, (3) providing remediation guidance for identified vulnerabilities, (4) writing new code and needing secure coding patterns. Triggers: 'review for security', 'OWASP audit', 'check for vulnerabilities','security checklist', 'is this code secure', 'security review', 'fix vulnerability'.

owasp-mobile-security-checker

16
from diegosouzapw/awesome-omni-skill

Analyze Flutter and mobile applications for OWASP Mobile Top 10 (2024) security compliance. Use this skill when performing security audits, vulnerability assessments, or compliance checks on mobile applications. Performs automated scans for hardcoded secrets, insecure storage, weak cryptography, network security issues, and provides detailed remediation guidance.

mobile-security

16
from diegosouzapw/awesome-omni-skill

Android security patterns for secure storage, network security, input validation, and authentication.

moai-security-auth0

16
from diegosouzapw/awesome-omni-skill

Auth0 security specialist covering attack protection, multi-factor authentication, token security, sender constraining, and compliance. Use when implementing Auth0 security features, configuring attack defenses, setting up MFA, or meeting regulatory requirements.

mesh-security

16
from diegosouzapw/awesome-omni-skill

Analyze Istio, Consul, and Linkerd service mesh configurations for security vulnerabilities with NIST 800-53 control mappings. Use when users need to audit mesh security, identify misconfigurations, check mTLS settings, review ACL policies, or prepare for FedRAMP assessments. Triggers on keywords like "mesh config", "istio security", "consul ACL", "linkerd policy", "service mesh audit", or "NIST compliance".

laravel-security-audit

16
from diegosouzapw/awesome-omni-skill

Security auditor for Laravel applications. Analyzes code for vulnerabilities, misconfigurations, and insecure practices using OWASP standards and Laravel security best practices.

information-security-manager-iso27001

16
from diegosouzapw/awesome-omni-skill

ISO 27001 ISMS implementation and cybersecurity governance for HealthTech and MedTech companies. Use for ISMS design, security risk assessment, control implementation, ISO 27001 certification, security audits, incident response, and compliance verification. Covers ISO 27001, ISO 27002, healthcare security, and medical device cybersecurity.

Global Security

16
from diegosouzapw/awesome-omni-skill

Your approach to handling global security. Use this skill when working on files where global security comes into play.