Skip to content
Skillpedia
Analysis & spreadsheets35k · #6121

performing-plc-firmware-security-analysis

Helps your agent analyze programmable logic controller (PLC) firmwares for flaws.

What it does

This tool analyzes the internal software (firmware) of Programmable Logic Controllers (PLCs) to find security flaws. It looks for hidden passwords, insecure update methods, and other vulnerabilities.

When to use it

  • ✓When checking a PLC's security before using it in critical locations.
  • ✓When suspecting that a PLC's software has been altered.
  • ✓When testing the security of new types of PLCs in a lab environment.

Example of what to ask your AI

“Analyze the firmware security of this Siemens S7 PLC.”

Want more? Open the sections below.

How to use

The easiest way: copy the message below and paste it into Claude, ChatGPT, Cursor or any AI. It reads the skill and follows the instructions.

Skill link

https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/performing-plc-firmware-security-analysis/SKILL.md

Ready-to-paste message

Use this skill to help me: https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/performing-plc-firmware-security-analysis/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
How it works

The tool extracts the PLC's software and examines it for known issues. It compares the current software against a trusted version to see if any changes have occurred.

Installation

Easiest way: copy the skill link and paste it into Claude, ChatGPT or Cursor asking it to follow the instructions.

In the terminal (Claude Code, Codex, Cursor), in your project folder:

npx skills add mukul975/Anthropic-Cybersecurity-Skills --skill performing-plc-firmware-security-analysis

Or download just the file:

curl -L https://raw.githubusercontent.com/mukul975/Anthropic-Cybersecurity-Skills/main/skills/performing-plc-firmware-security-analysis/SKILL.md -o SKILL.md
Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

Performing PLC Firmware Security Analysis

When to Use

  • When assessing PLC security as part of an IEC 62443 component security evaluation (IEC 62443-4-2)
  • When validating firmware integrity after a suspected compromise or supply chain attack
  • When evaluating the security of a new PLC platform before deployment in critical infrastructure
  • When performing vulnerability research on industrial control system devices in an authorized lab
  • When responding to an incident where PLC logic or firmware tampering is suspected

Do not use on live production PLCs without explicit authorization and safety controls in place. Firmware extraction and analysis should be performed on lab devices or offline backups. Never upload PLC firmware to public analysis services. See performing-ics-penetration-testing for authorized live testing procedures.

Prerequisites

  • Isolated lab environment with the target PLC hardware or an emulated environment
  • PLC programming software for the target platform (Siemens TIA Portal, Rockwell Studio 5000, Schneider EcoStruxure)
  • Firmware extraction tools (binwalk, firmware-mod-kit, JTAG/SWD debugger)
  • Static analysis tools (Ghidra, IDA Pro, Binary Ninja with ARM/MIPS/PowerPC support)
  • Understanding of PLC architecture (real-time OS, ladder logic execution, I/O scanning)
  • Reference copy of known-good firmware for integrity comparison

Workflow

Step 1: Acquire PLC Firmware for Analysis

Extract or obtain PLC firmware through authorized methods. This can be done by downloading from the vendor, extracting from a lab device, or obtaining from a project backup.

#!/usr/bin/env python3
"""PLC Firmware Acquisition and Integrity Verification.

Supports firmware extraction from project files, network downloads,
and binary image comparison against known-good baselines.
"""

import hashlib
import json
import os
import struct
import sys
import zipfile
from datetime import datetime
from pathlib import Path


class PLCFirmwareAcquisition:
    """Handles PLC firmware acquisition from various sources."""

    def __init__(self, output_dir="firmware_analysis"):
        self.output_dir = Path(output_dir)
        self.output_dir.mkdir(exist_ok=True)
        self.manifest = {
            "acquisition_date": datetime.now().isoformat(),
            "firmware_samples": [],
        }

    def extract_from_siemens_project(self, project_path):
        """Extract firmware/program blocks from Siemens TIA Portal project.

        TIA Portal projects (.ap16/.ap17) are ZIP archives containing
        XML-encoded PLC program blocks and system configuration.
        """
        print(f"[*] Analyzing Siemens project: {project_path}")
        results = {"platform": "Siemens", "blocks": []}

        if zipfile.is_zipfile(project_path):
            with zipfile.ZipFile(project_path, "r") as zf:
                for info in zf.infolist():
                    # Program blocks are stored as XML in specific paths
                    if "ProgramBlocks" in info.filename or "SystemBlocks" in info.filename:
                        block_data = zf.read(info.filename)
                        block_hash = hashlib.sha256(block_data).hexdigest()

                        block_path = self.output_dir / info.filename.replace("/", "_")
                        block_path.write_bytes(block_data)

                        results["blocks"].append({
                            "name": info.filename,
                            "size": info.file_size,
                            "sha256": block_hash,
                            "extracted_to": str(block_path),
                        })
                        print(f"  [+] Extracted: {info.filename} ({info.file_size} bytes)")

        self.manifest["firmware_samples"].append(results)
        return results

    def extract_from_rockwell_project(self, acd_path):
        """Extract program data from Rockwell Studio 5000 ACD file.

        ACD files contain controller program, tags, and configuration.
        """
        print(f"[*] Analyzing Rockwell project: {acd_path}")
        results = {"platform": "Rockwell/Allen-Bradley", "blocks": []}

        with open(acd_path, "rb") as f:
            header = f.read(256)
            # ACD files have a specific signature
            if b"RSLogix" in header or b"Studio 5000" in header:
                f.seek(0)
                full_data = f.read()
                file_hash = hashlib.sha256(full_data).hexdigest()


…
FAQ

What is a PLC?

A Programmable Logic Controller (PLC) is an industrial computer used to control machines and processes in factories and other facilities.

What is firmware?

Firmware is the basic software that controls a device's hardware, like a PLC. It's like a computer's operating system.

Can I use this on a live PLC?

No, never use this tool on a PLC that is controlling a real process without explicit authorization and safety controls. Analysis should be done on lab equipment or offline backups.

Details

Original description by the author

This skill covers analyzing Programmable Logic Controller (PLC) firmware for security vulnerabilities including hardcoded credentials, insecure update mechanisms, backdoor functions, memory corruption flaws, and undocumented debug interfaces. It addresses firmware extraction from common PLC platforms (Siemens S7, Allen-Bradley, Schneider Modicon), static analysis of firmware images, dynamic analys

repo: mukul975/Anthropic-Cybersecurity-Skills

Popularity

GitHub stars
35k
Ranking position
#6121
License
Apache-2.0
Updated
8/31/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills