[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7B64E79GPPXSYYZPFS213CF":3,"skill-same:01M7B64E79GPPXSYYZPFS213CF":84},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":15,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":48,"commitSha":49,"skillDirectory":50,"forksCount":13,"repositoryHtmlUrl":51,"repositoryHomepageUrl":6,"ownerHtmlUrl":52,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":53,"install":54,"resources":67},"01M7B64E79GPPXSYYZPFS213CF","detecting-modbus-command-injection-attacks",null,"Detect command injection against Modbus TCP\u002FRTU in ICS\u002FSCADA environments by monitoring unauthorized writes, anomalous function codes, malformed frames, and deviations from communication baselines using ICS-aware IDS and deep packet inspection. Use when deploying IDS for Modbus OT networks, investigating unauthorized PLC register\u002Fcoil changes, or responding to FrostyGoop-style Modbus attacks.","vikasvardhanv\u002Fjerry_skills","vikasvardhanv","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F99010657?v=4","01M7B2B0VN78W7529RQX5BR6DZ","01M7B2B0WDNTXJHRK3QNPNWRP6",0,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fcurated_premium_skills\u002FAnthropic-Cybersecurity-Skills\u002Fskills\u002Fdetecting-modbus-command-injection-attacks\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fcurated_premium_skills\u002FAnthropic-Cybersecurity-Skills\u002Fskills\u002Fdetecting-modbus-command-injection-attacks\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: detecting-modbus-command-injection-attacks\ndescription: Detect command injection against Modbus TCP\u002FRTU in ICS\u002FSCADA environments by monitoring unauthorized writes, anomalous function codes, malformed frames, and deviations from communication baselines using ICS-aware IDS and deep packet inspection. Use when deploying IDS for Modbus OT networks, investigating unauthorized PLC register\u002Fcoil changes, or responding to FrostyGoop-style Modbus attacks.\ndomain: cybersecurity\nsubdomain: ot-ics-security\ntags:\n- ot-security\n- ics\n- modbus\n- command-injection\n- protocol-analysis\n- ids\n- scada\n- threat-detection\nversion: '1.0'\nauthor: mahipal\nlicense: Apache-2.0\nnist_csf:\n- PR.IR-01\n- DE.CM-01\n- ID.AM-05\n- GV.OC-02\nmitre_attack:\n- T1078\n- T1190\n- T1059\n- T1055\n- T0816\n---\n\n# Detecting Modbus Command Injection Attacks\n\n## When to Use\n\n- When deploying intrusion detection for environments using Modbus TCP (port 502) or Modbus RTU\n- When investigating suspected unauthorized modifications to PLC registers or coils\n- When building detection analytics for OT SOC monitoring Modbus-heavy environments\n- When responding to FrostyGoop-style attacks that leverage Modbus TCP for operational impact\n- When performing baseline validation after a suspected compromise of a Modbus master\n\n**Do not use** for detecting attacks on non-Modbus protocols (see detecting-dnp3-protocol-anomalies for DNP3), for general IT network intrusion detection, or for Modbus device configuration (see performing-ot-vulnerability-scanning-safely).\n\n## Prerequisites\n\n- Network SPAN\u002FTAP on the segment carrying Modbus TCP traffic (typically port 502)\n- Baseline of normal Modbus communication patterns (masters, slaves, function codes, register ranges, polling intervals)\n- Suricata, Zeek, or commercial OT IDS deployed with Modbus protocol parsers enabled\n- Understanding of Modbus function codes used in the environment (read vs write operations)\n- Access to PLC programming documentation to validate expected register ranges\n\n## Workflow\n\n### Step 1: Build Modbus Communication Baseline\n\nCapture and analyze normal Modbus traffic to establish what constitutes legitimate communication patterns.\n\n```python\n#!\u002Fusr\u002Fbin\u002Fenv python3\n\"\"\"Modbus Command Injection Detector.\n\nMonitors Modbus TCP traffic for unauthorized write operations, anomalous\nfunction codes, and deviations from established communication baselines.\nDetects attacks like FrostyGoop that use Modbus TCP for operational impact.\n\"\"\"\n\nimport json\nimport struct\nimport sys\nimport time\nfrom collections import defaultdict\nfrom datetime import datetime\nfrom typing import Dict, List, Optional, Set, Tuple\n\ntry:\n    from scapy.all import sniff, IP, TCP\nexcept ImportError:\n    print(\"Install scapy: pip install scapy\")\n    sys.exit(1)\n\n\n# Modbus function code definitions\nMODBUS_READ_FUNCTIONS = {1, 2, 3, 4}\nMODBUS_WRITE_FUNCTIONS = {5, 6, 15, 16}\nMODBUS_DIAGNOSTIC_FUNCTIONS = {8, 17, 43}\n\nMODBUS_FUNC_NAMES = {\n    1: \"Read Coils\", 2: \"Read Discrete Inputs\",\n    3: \"Read Holding Registers\", 4: \"Read Input Registers\",\n    5: \"Write Single Coil\", 6: \"Write Single Register\",\n    8: \"Diagnostics\", 15: \"Write Multiple Coils\",\n    16: \"Write Multiple Registers\", 17: \"Report Slave ID\",\n    22: \"Mask Write Register\", 23: \"Read\u002FWrite Multiple Registers\",\n    43: \"Encapsulated Interface Transport\",\n}\n\n\nclass ModbusAlert:\n    \"\"\"Represents a detected Modbus anomaly.\"\"\"\n\n    def __init__(self, severity: str, alert_type: str, src_ip: str,\n                 dst_ip: str, unit_id: int, func_code: int,\n                 description: str, mitre_technique: str = \"\"):\n        self.timestamp = datetime.now().isoformat()\n        self.severity = severity\n        self.alert_type = alert_type\n        self.src_ip = src_ip\n        self.dst_ip = dst_ip\n        self.unit_id = unit_id\n        self.func_code = func_code\n        self.func_name = MODBUS_FUNC_NAMES.get(func_code, f\"Unknown FC {func_code}\")\n        self.description = description\n        self.mitre_technique = mitre_technique\n\n    def __str__(self):\n        return (\n            f\"[{self.severity}] {self.alert_type} | {self.src_ip} -> {self.dst_ip} \"\n            f\"| Unit {self.unit_id} | {self.func_name} | {self.description}\"\n        )\n\n\nclass ModbusInjectionDetector:\n    \"\"\"Detects Modbus command injection attacks.\"\"\"\n\n    def __init__(self, baseline_file: Optional[str] = None):\n        self.alerts: List[ModbusAlert] = []\n        self.packet_count = 0\n        self.modbus_count = 0\n\n        # Baseline data\n        self.authorized_masters: Set[str] = set()\n        self.authorized_pairs: Set[Tuple[str, str]] = set()\n        self.allowed_write_sources: Set[str] = set()\n        self.allowed_function_codes: Dict[str, Set[int]] = defaultdict(set)\n        self.allowed_register_ranges: Dict[str, List[Tuple[int, int]]] = defaultdict(list)\n        self.polling_intervals: Dict[str, float] = {}\n        self.last_seen: Dict[str, float] = {}\n\n        # Counters for rate detection\n        self.write_counts: Dict[str, List[float]] = defaultdict(list)\n\n        if baseline_file:\n            self.load_baseline(baseline_file)\n\n    def load_baseline(self, filepath: str):\n        \"\"\"Load established Modbus communication baseline.\"\"\"\n        with open(filepath, \"r\") as f:\n            baseline = json.load(f)\n\n        for session_key, data in baseline.get(\"modbus_baselines\", {}).items():\n            src, dst = session_key.split(\"->\")\n            self.authorized_pairs.add((src.strip(), dst.strip()))\n            self.authorized_masters.add(src.strip())\n\n            fc_set = set(data.get(\"allowed_function_codes\", []))\n            self.allowed_function_codes[session_key] = fc_set\n\n            if fc_set & MODBUS_WRITE_FUNCTIONS:\n                self.allowed_write_sources.add(src.strip())\n\n            for reg_range in data.get(\"register_ranges\", []):\n                self.allowed_register_ranges[session_key].append(\n                    (reg_range[\"start\"], reg_range[\"end\"])\n                )\n\n            if data.get(\"polling_interval_avg_sec\"):\n                self.polling_intervals[session_key] = data[\"polling_interval_avg_sec\"]\n\n        print(f\"[*] Baseline loaded: {len(self.authorized_pairs)} authorized pairs, \"\n              f\"{len(self.allowed_write_sources)} authorized write sources\")\n\n    def parse_modbus_mbap(self, payload: bytes) -> Optional[dict]:\n        \"\"\"Parse Modbus TCP MBAP header and PDU.\"\"\"\n        if len(payload) \u003C 8:\n            return None\n\n        transaction_id = struct.unpack(\">H\", payload[0:2])[0]\n        protocol_id = struct.unpack(\">H\", payload[2:4])[0]\n        length = struct.unpack(\">H\", payload[4:6])[0]\n        unit_id = payload[6]\n        func_code = payload[7]\n\n        if protocol_id != 0:  # Not Modbus\n            return None\n\n        result = {\n            \"transaction_id\": transaction_id,\n            \"protocol_id\": protocol_id,\n            \"length\": length,\n            \"unit_id\": unit_id,\n            \"func_code\": func_code,\n        }\n\n        # Parse register address and count for read\u002Fwrite operations\n        if len(payload) >= 12 and func_code in (1, 2, 3, 4, 5, 6, 15, 16):\n            result[\"start_address\"] = struct.unpack(\">H\", payload[8:10])[0]\n            result[\"quantity\"] = struct.unpack(\">H\", payload[10:12])[0]\n\n        return result\n\n    def analyze_packet(self, pkt):\n        \"\"\"Analyze a network packet for Modbus command injection.\"\"\"\n        self.packet_count += 1\n\n        if not pkt.haslayer(IP) or not pkt.haslayer(TCP):\n            return\n\n        tcp = pkt[TCP]\n        if tcp.dport != 502 and tcp.sport != 502:\n            return\n\n        payload = bytes(tcp.payload)\n        if not payload:\n            return\n\n        modbus = self.parse_modbus_mbap(payload)\n        if not modbus:\n            return\n\n        self.modbus_count += 1\n        src_ip = pkt[IP].src\n        dst_ip = pkt[IP].dst\n        session_key = f\"{src_ip}->{dst_ip}\"\n        now = time.time()\n\n        # Detection Rule 1: Unauthorized Modbus master\n        if self.authorized_masters and src_ip not in self.authorized_masters:\n            if tcp.dport == 502:\n                self.alerts.append(ModbusAlert(\n                    severity=\"CRITICAL\",\n                    alert_type=\"UNAUTHORIZED_MASTER\",\n                    src_ip=src_ip, dst_ip=dst_ip,\n                    unit_id=modbus[\"unit_id\"],\n                    func_code=modbus[\"func_code\"],\n                    description=f\"Unauthorized device {src_ip} sending Modbus commands to {dst_ip}\",\n                    mitre_technique=\"T0843 - Program Download\",\n                ))\n\n        # Detection Rule 2: Unauthorized write operation\n        if modbus[\"func_code\"] in MODBUS_WRITE_FUNCTIONS:\n            if self.allowed_write_sources and src_ip not in self.allowed_write_sources:\n                self.alerts.append(ModbusAlert(\n                    severity=\"CRITICAL\",\n                    alert_type=\"UNAUTHORIZED_WRITE\",\n                    src_ip=src_ip, dst_ip=dst_ip,\n                    unit_id=modbus[\"unit_id\"],\n                    func_code=modbus[\"func_code\"],\n                    description=f\"Write command from non-authorized source {src_ip}\",\n                    mitre_technique=\"T0855 - Unauthorized Command Message\",\n                ))\n\n            # Track write frequency for rate anomaly detection\n            self.write_counts[src_ip].append(now)\n            recent_writes = [t for t in self.write_counts[src_ip] if now - t \u003C 60]\n            self.write_counts[src_ip] = recent_writes\n            if len(recent_writes) > 20:\n                self.alerts.append(ModbusAlert(\n                    severity=\"HIGH\",\n                    alert_type=\"WRITE_FLOOD\",\n                    src_ip=src_ip, dst_ip=dst_ip,\n                    unit_id=modbus[\"unit_id\"],\n                    func_code=modbus[\"func_code\"],\n                    description=f\"Excessive write rate: {len(recent_writes)} writes in 60s from {src_ip}\",\n                    mitre_technique=\"T0836 - Modify Parameter\",\n                ))\n\n        # Detection Rule 3: Anomalous function code\n        if session_key in self.allowed_function_codes:\n            if modbus[\"func_code\"] not in self.allowed_function_codes[session_key]:\n                self.alerts.append(ModbusAlert(\n                    severity=\"HIGH\",\n                    alert_type=\"ANOMALOUS_FUNCTION_CODE\",\n                    src_ip=src_ip, dst_ip=dst_ip,\n                    unit_id=modbus[\"unit_id\"],\n                    func_code=modbus[\"func_code\"],\n                    description=(\n                        f\"Function code {modbus['func_code']} ({MODBUS_FUNC_NAMES.get(modbus['func_code'], 'Unknown')}) \"\n                        f\"not in baseline for {session_key}\"\n                    ),\n                    mitre_technique=\"T0855 - Unauthorized Command Message\",\n                ))\n\n        # Detection Rule 4: Broadcast write (unit ID 0)\n        if modbus[\"unit_id\"] == 0 and modbus[\"func_code\"] in MODBUS_WRITE_FUNCTIONS:\n            self.alerts.append(ModbusAlert(\n                severity=\"CRITICAL\",\n                alert_type=\"BROADCAST_WRITE\",\n                src_ip=src_ip, dst_ip=dst_ip,\n                unit_id=0,\n                func_code=modbus[\"func_code\"],\n                description=\"Broadcast write command (unit ID 0) affects ALL Modbus devices on segment\",\n                mitre_technique=\"T0855 - Unauthorized Command Message\",\n            ))\n\n        # Detection Rule 5: Out-of-range register access\n        if \"start_address\" in modbus and session_key in self.allowed_register_ranges:\n            addr = modbus[\"start_address\"]\n            qty = modbus.get(\"quantity\", 1)\n            in_range = any(\n                start \u003C= addr and addr + qty \u003C= end\n                for start, end in self.allowed_register_ranges[session_key]\n            )\n            if not in_range:\n                self.alerts.append(ModbusAlert(\n                    severity=\"HIGH\",\n                    alert_type=\"OUT_OF_RANGE_REGISTER\",\n                    src_ip=src_ip, dst_ip=dst_ip,\n                    unit_id=modbus[\"unit_id\"],\n                    func_code=modbus[\"func_code\"],\n                    description=f\"Register access {addr}-{addr+qty} outside baseline ranges\",\n                    mitre_technique=\"T0836 - Modify Parameter\",\n                ))\n\n        # Detection Rule 6: Diagnostic\u002Frestart commands\n        if modbus[\"func_code\"] in MODBUS_DIAGNOSTIC_FUNCTIONS:\n            self.alerts.append(ModbusAlert(\n                severity=\"HIGH\",\n                alert_type=\"DIAGNOSTIC_COMMAND\",\n                src_ip=src_ip, dst_ip=dst_ip,\n                unit_id=modbus[\"unit_id\"],\n                func_code=modbus[\"func_code\"],\n                description=f\"Diagnostic function code {modbus['func_code']} detected - potential DoS or reconnaissance\",\n                mitre_technique=\"T0814 - Denial of Service\",\n            ))\n\n    def print_report(self):\n        \"\"\"Print detection report.\"\"\"\n        print(f\"\\n{'='*70}\")\n        print(f\"MODBUS COMMAND INJECTION DETECTION REPORT\")\n        print(f\"{'='*70}\")\n        print(f\"Analysis Time: {datetime.now().isoformat()}\")\n        print(f\"Total Packets Analyzed: {self.packet_count}\")\n        print(f\"Modbus Packets: {self.modbus_count}\")\n        print(f\"Alerts Generated: {len(self.alerts)}\")\n\n        if self.alerts:\n            severity_counts = defaultdict(int)\n            for alert in self.alerts:\n                severity_counts[alert.severity] += 1\n\n            print(f\"\\nSeverity Distribution:\")\n            for sev in [\"CRITICAL\", \"HIGH\", \"MEDIUM\", \"LOW\"]:\n                if sev in severity_counts:\n                    print(f\"  {sev}: {severity_counts[sev]}\")\n\n            print(f\"\\nDetailed Alerts:\")\n            for alert in self.alerts:\n                print(f\"\\n  [{alert.severity}] {alert.alert_type}\")\n                print(f\"    Time: {alert.timestamp}\")\n                print(f\"    Source: {alert.src_ip} -> {alert.dst_ip}\")\n                print(f\"    Unit ID: {alert.unit_id}\")\n                print(f\"    Function: {alert.func_name} (FC {alert.func_code})\")\n                print(f\"    Detail: {alert.description}\")\n                if alert.mitre_technique:\n                    print(f\"    MITRE ATT&CK ICS: {alert.mitre_technique}\")\n\n    def start_live_monitoring(self, interface: str, duration: int = 0):\n        \"\"\"Start live Modbus traffic monitoring.\"\"\"\n        print(f\"[*] Starting Modbus monitoring on {interface}...\")\n        print(f\"[*] Press Ctrl+C to stop\")\n        try:\n            sniff(\n                iface=interface,\n                filter=\"tcp port 502\",\n                prn=self.analyze_packet,\n                timeout=duration if duration > 0 else None,\n            )\n        except KeyboardInterrupt:\n            pass\n        self.print_report()\n\n\nif __name__ == \"__main__\":\n    detector = ModbusInjectionDetector(\n        baseline_file=sys.argv[2] if len(sys.argv) > 2 else None\n    )\n\n    if len(sys.argv) >= 2:\n        if sys.argv[1].endswith(\".pcap\") or sys.argv[1].endswith(\".pcapng\"):\n            from scapy.all import rdpcap\n            print(f\"[*] Analyzing capture file: {sys.argv[1]}\")\n            packets = rdpcap(sys.argv[1])\n            for pkt in packets:\n                detector.analyze_packet(pkt)\n            detector.print_report()\n        else:\n            detector.start_live_monitoring(sys.argv[1])\n    else:\n        print(\"Usage:\")\n        print(\"  Live:    python modbus_detector.py \u003Cinterface> [baseline.json]\")\n        print(\"  Offline: python modbus_detector.py \u003Ccapture.pcap> [baseline.json]\")\n```\n\n### Step 2: Deploy Suricata Rules for Modbus Attack Detection\n\n```yaml\n# Suricata IDS Rules for Modbus Command Injection Detection\n# Reference: MITRE ATT&CK for ICS, FrostyGoop analysis\n\n# Unauthorized Modbus write from non-engineering workstation\nalert modbus !$MODBUS_AUTHORIZED_WRITERS any -> $OT_PLC_SUBNET 502 (\n  msg:\"MODBUS-INJECT Unauthorized write operation detected\";\n  modbus_func:write_single_coil;\n  flow:to_server,established;\n  classtype:attempted-admin;\n  sid:4000001; rev:1; priority:1;\n)\n\nalert modbus !$MODBUS_AUTHORIZED_WRITERS any -> $OT_PLC_SUBNET 502 (\n  msg:\"MODBUS-INJECT Unauthorized write multiple registers\";\n  modbus_func:write_multiple_registers;\n  flow:to_server,established;\n  classtype:attempted-admin;\n  sid:4000002; rev:1; priority:1;\n)\n\n# Modbus broadcast write affecting all slaves\nalert modbus any any -> $OT_PLC_SUBNET 502 (\n  msg:\"MODBUS-INJECT Broadcast write command (Unit ID 0)\";\n  modbus_unit_id:0;\n  flow:to_server,established;\n  classtype:attempted-admin;\n  sid:4000003; rev:1; priority:1;\n)\n\n# Excessive Modbus write rate (potential automated attack)\nalert modbus any any -> $OT_PLC_SUBNET 502 (\n  msg:\"MODBUS-INJECT Excessive write rate - possible automated attack\";\n  modbus_func:write_multiple_registers;\n  flow:to_server,established;\n  threshold:type threshold, track by_src, count 20, seconds 60;\n  classtype:attempted-admin;\n  sid:4000004; rev:1;\n)\n\n# Modbus diagnostics\u002Frestart command\nalert modbus any any -> $OT_PLC_SUBNET 502 (\n  msg:\"MODBUS-INJECT Diagnostics function code detected\";\n  modbus_func:diagnostics;\n  flow:to_server,established;\n  classtype:attempted-dos;\n  sid:4000005; rev:1;\n)\n\n# FrostyGoop-pattern: write to specific register ranges used for heating control\nalert modbus any any -> $OT_PLC_SUBNET 502 (\n  msg:\"MODBUS-INJECT Potential FrostyGoop - write to heating control registers\";\n  modbus_func:write_multiple_registers;\n  content:\"|00 10|\"; offset:8; depth:2;\n  flow:to_server,established;\n  classtype:attempted-admin;\n  sid:4000010; rev:1; priority:1;\n)\n```\n\n## Key Concepts\n\n| Term | Definition |\n|------|------------|\n| Modbus TCP | Industrial protocol operating on TCP port 502, lacking authentication or encryption, making it vulnerable to command injection |\n| Function Code | Single byte in Modbus PDU specifying the operation (read coils, write registers, diagnostics); monitoring for unauthorized function codes is key to detection |\n| MBAP Header | Modbus Application Protocol header in TCP variant containing transaction ID, protocol ID, length, and unit ID |\n| FrostyGoop | First known malware using Modbus TCP for real-world operational impact, disrupted Ukrainian district heating in 2024 |\n| Unit ID | Address of the target Modbus slave device; Unit ID 0 is a broadcast affecting all slaves |\n| Register Range | Specific memory addresses in the PLC; legitimate operations access known ranges; out-of-range access indicates reconnaissance or manipulation |\n\n## Common Scenarios\n\n### Scenario: FrostyGoop-Style Heating Control Attack\n\n**Context**: A building automation system uses Modbus TCP to control HVAC equipment. Monitoring detects unexpected write commands to heating control registers from an IP not associated with any authorized BMS controller.\n\n**Approach**:\n1. Verify the source IP against the authorized Modbus master list\n2. Check if any authorized maintenance or configuration change is in progress\n3. Capture full Modbus transaction including register addresses and values being written\n4. Compare written values against safe operating ranges for the heating equipment\n5. If unauthorized, immediately block the source IP at the industrial firewall\n6. Inspect the source device for compromise indicators (malware, unauthorized remote access)\n7. Verify current setpoints on all affected controllers against known-good values\n8. Restore safe setpoints if manipulation is confirmed\n\n**Pitfalls**: Modbus lacks authentication, so the source IP is the only identifier -- attackers can spoof IPs if ARP protections are not in place. Do not assume all writes are malicious; legitimate SCADA operations include writes. Always verify against the change management log before escalating.\n\n## Output Format\n\n```\nMODBUS INJECTION DETECTION REPORT\n====================================\nAnalysis Period: [start] to [end]\nMonitoring Point: [interface\u002FSPAN description]\n\nTRAFFIC SUMMARY:\n  Total Modbus Packets: [count]\n  Read Operations: [count]\n  Write Operations: [count]\n  Unauthorized Writes Detected: [count]\n\nALERTS:\n  [CRITICAL] Unauthorized write from [IP] to PLC [IP]\n    Function: Write Multiple Registers (FC 16)\n    Registers: [start]-[end]\n    MITRE: T0855 - Unauthorized Command Message\n\nBASELINE DEVIATIONS:\n  New Modbus masters: [list]\n  Unusual function codes: [list]\n  Out-of-range register access: [list]\n\nRECOMMENDED ACTIONS:\n  1. Verify source [IP] authorization status\n  2. Block unauthorized sources at industrial firewall\n  3. Validate PLC register values against known-good state\n```\n","# Detecting Modbus Command Injection Attacks\n\n## When to Use\n\n- When deploying intrusion detection for environments using Modbus TCP (port 502) or Modbus RTU\n- When investigating suspected unauthorized modifications to PLC registers or coils\n- When building detection analytics for OT SOC monitoring Modbus-heavy environments\n- When responding to FrostyGoop-style attacks that leverage Modbus TCP for operational impact\n- When performing baseline validation after a suspected compromise of a Modbus master\n\n**Do not use** for detecting attacks on non-Modbus protocols (see detecting-dnp3-protocol-anomalies for DNP3), for general IT network intrusion detection, or for Modbus device configuration (see performing-ot-vulnerability-scanning-safely).\n\n## Prerequisites\n\n- Network SPAN\u002FTAP on the segment carrying Modbus TCP traffic (typically port 502)\n- Baseline of normal Modbus communication patterns (masters, slaves, function codes, register ranges, polling intervals)\n- Suricata, Zeek, or commercial OT IDS deployed with Modbus protocol parsers enabled\n- Understanding of Modbus function codes used in the environment (read vs write operations)\n- Access to PLC programming documentation to validate expected register ranges\n\n## Workflow\n\n### Step 1: Build Modbus Communication Baseline\n\nCapture and analyze normal Modbus traffic to establish what constitutes legitimate communication patterns.\n\n```python\n#!\u002Fusr\u002Fbin\u002Fenv python3\n\"\"\"Modbus Command Injection Detector.\n\nMonitors Modbus TCP traffic for unauthorized write operations, anomalous\nfunction codes, and deviations from established communication baselines.\nDetects attacks like FrostyGoop that use Modbus TCP for operational impact.\n\"\"\"\n\nimport json\nimport struct\nimport sys\nimport time\nfrom collections import defaultdict\nfrom datetime import datetime\nfrom typing import Dict, List, Optional, Set, Tuple\n\ntry:\n    from scapy.all import sniff, IP, TCP\nexcept ImportError:\n    print(\"Install scapy: pip install scapy\")\n    sys.exit(1)\n\n\n# Modbus function code definitions\nMODBUS_READ_FUNCTIONS = {1, 2, 3, 4}\nMODBUS_WRITE_FUNCTIONS = {5, 6, 15, 16}\nMODBUS_DIAGNOSTIC_FUNCTIONS = {8, 17, 43}\n\nMODBUS_FUNC_NAMES = {\n    1: \"Read Coils\", 2: \"Read Discrete Inputs\",\n    3: \"Read Holding Registers\", 4: \"Read Input Registers\",\n    5: \"Write Single Coil\", 6: \"Write Single Register\",\n    8: \"Diagnostics\", 15: \"Write Multiple Coils\",\n    16: \"Write Multiple Registers\", 17: \"Report Slave ID\",\n    22: \"Mask Write Register\", 23: \"Read\u002FWrite Multiple Registers\",\n    43: \"Encapsulated Interface Transport\",\n}\n\n\nclass ModbusAlert:\n    \"\"\"Represents a detected Modbus anomaly.\"\"\"\n\n    def __init__(self, severity: str, alert_type: str, src_ip: str,\n                 dst_ip: str, unit_id: int, func_code: int,\n                 description: str, mitre_technique: str = \"\"):\n        self.timestamp = datetime.now().isoformat()\n        self.severity = severity\n        self.alert_type = alert_type\n        self.src_ip = src_ip\n        self.dst_ip = dst_ip\n        self.unit_id = unit_id\n        self.func_code = func_code\n        self.func_name = MODBUS_FUNC_NAMES.get(func_code, f\"Unknown FC {func_code}\")\n        self.description = description\n        self.mitre_technique = mitre_technique\n\n    def __str__(self):\n        return (\n            f\"[{self.severity}] {self.alert_type} | {self.src_ip} -> {self.dst_ip} \"\n            f\"| Unit {self.unit_id} | {self.func_name} | {self.description}\"\n        )\n\n\nclass ModbusInjectionDetector:\n    \"\"\"Detects Modbus command injection attacks.\"\"\"\n\n    def __init__(self, baseline_file: Optional[str] = None):\n        self.alerts: List[ModbusAlert] = []\n        self.packet_count = 0\n        self.modbus_count = 0\n\n        # Baseline data\n        self.authorized_masters: Set[str] = set()\n        self.authorized_pairs: Set[Tuple[str, str]] = set()\n        self.allowed_write_sources: Set[str] = set()\n        self.allowed_function_codes: Dict[str, Set[int]] = defaultdict(set)\n        self.allowed_register_ranges: Dict[str, List[Tuple[int, int]]] = defaultdict(list)\n        self.polling_intervals: Dict[str, float] = {}\n        self.last_seen: Dict[str, float] = {}\n\n        # Counters for rate detection\n        self.write_counts: Dict[str, List[float]] = defaultdict(list)\n\n        if baseline_file:\n            self.load_baseline(baseline_file)\n\n    def load_baseline(self, filepath: str):\n        \"\"\"Load established Modbus communication baseline.\"\"\"\n        with open(filepath, \"r\") as f:\n            baseline = json.load(f)\n\n        for session_key, data in baseline.get(\"modbus_baselines\", {}).items():\n            src, dst = session_key.split(\"->\")\n            self.authorized_pairs.add((src.strip(), dst.strip()))\n            self.authorized_masters.add(src.strip())\n\n            fc_set = set(data.get(\"allowed_function_codes\", []))\n            self.allowed_function_codes[session_key] = fc_set\n\n            if fc_set & MODBUS_WRITE_FUNCTIONS:\n                self.allowed_write_sources.add(src.strip())\n\n            for reg_range in data.get(\"register_ranges\", []):\n                self.allowed_register_ranges[session_key].append(\n                    (reg_range[\"start\"], reg_range[\"end\"])\n                )\n\n            if data.get(\"polling_interval_avg_sec\"):\n                self.polling_intervals[session_key] = data[\"polling_interval_avg_sec\"]\n\n        print(f\"[*] Baseline loaded: {len(self.authorized_pairs)} authorized pairs, \"\n              f\"{len(self.allowed_write_sources)} authorized write sources\")\n\n    def parse_modbus_mbap(self, payload: bytes) -> Optional[dict]:\n        \"\"\"Parse Modbus TCP MBAP header and PDU.\"\"\"\n        if len(payload) \u003C 8:\n            return None\n\n        transaction_id = struct.unpack(\">H\", payload[0:2])[0]\n        protocol_id = struct.unpack(\">H\", payload[2:4])[0]\n        length = struct.unpack(\">H\", payload[4:6])[0]\n        unit_id = payload[6]\n        func_code = payload[7]\n\n        if protocol_id != 0:  # Not Modbus\n            return None\n\n        result = {\n            \"transaction_id\": transaction_id,\n            \"protocol_id\": protocol_id,\n            \"length\": length,\n            \"unit_id\": unit_id,\n            \"func_code\": func_code,\n        }\n\n        # Parse register address and count for read\u002Fwrite operations\n        if len(payload) >= 12 and func_code in (1, 2, 3, 4, 5, 6, 15, 16):\n            result[\"start_address\"] = struct.unpack(\">H\", payload[8:10])[0]\n            result[\"quantity\"] = struct.unpack(\">H\", payload[10:12])[0]\n\n        return result\n\n    def analyze_packet(self, pkt):\n        \"\"\"Analyze a network packet for Modbus command injection.\"\"\"\n        self.packet_count += 1\n\n        if not pkt.haslayer(IP) or not pkt.haslayer(TCP):\n            return\n\n        tcp = pkt[TCP]\n        if tcp.dport != 502 and tcp.sport != 502:\n            return\n\n        payload = bytes(tcp.payload)\n        if not payload:\n            return\n\n        modbus = self.parse_modbus_mbap(payload)\n        if not modbus:\n            return\n\n        self.modbus_count += 1\n        src_ip = pkt[IP].src\n        dst_ip = pkt[IP].dst\n        session_key = f\"{src_ip}->{dst_ip}\"\n        now = time.time()\n\n        # Detection Rule 1: Unauthorized Modbus master\n        if self.authorized_masters and src_ip not in self.authorized_masters:\n            if tcp.dport == 502:\n                self.alerts.append(ModbusAlert(\n                    severity=\"CRITICAL\",\n                    alert_type=\"UNAUTHORIZED_MASTER\",\n                    src_ip=src_ip, dst_ip=dst_ip,\n                    unit_id=modbus[\"unit_id\"],\n                    func_code=modbus[\"func_code\"],\n                    description=f\"Unauthorized device {src_ip} sending Modbus commands to {dst_ip}\",\n                    mitre_technique=\"T0843 - Program Download\",\n                ))\n\n        # Detection Rule 2: Unauthorized write operation\n        if modbus[\"func_code\"] in MODBUS_WRITE_FUNCTIONS:\n            if self.allowed_write_sources and src_ip not in self.allowed_write_sources:\n                self.alerts.append(ModbusAlert(\n                    severity=\"CRITICAL\",\n                    alert_type=\"UNAUTHORIZED_WRITE\",\n                    src_ip=src_ip, dst_ip=dst_ip,\n                    unit_id=modbus[\"unit_id\"],\n                    func_code=modbus[\"func_code\"],\n                    description=f\"Write command from non-authorized source {src_ip}\",\n                    mitre_technique=\"T0855 - Unauthorized Command Message\",\n                ))\n\n            # Track write frequency for rate anomaly detection\n            self.write_counts[src_ip].append(now)\n            recent_writes = [t for t in self.write_counts[src_ip] if now - t \u003C 60]\n            self.write_counts[src_ip] = recent_writes\n            if len(recent_writes) > 20:\n                self.alerts.append(ModbusAlert(\n                    severity=\"HIGH\",\n                    alert_type=\"WRITE_FLOOD\",\n                    src_ip=src_ip, dst_ip=dst_ip,\n                    unit_id=modbus[\"unit_id\"],\n                    func_code=modbus[\"func_code\"],\n                    description=f\"Excessive write rate: {len(recent_writes)} writes in 60s from {src_ip}\",\n                    mitre_technique=\"T0836 - Modify Parameter\",\n                ))\n\n        # Detection Rule 3: Anomalous function code\n        if session_key in self.allowed_function_codes:\n            if modbus[\"func_code\"] not in self.allowed_function_codes[session_key]:\n                self.alerts.append(ModbusAlert(\n                    severity=\"HIGH\",\n                    alert_type=\"ANOMALOUS_FUNCTION_CODE\",\n                    src_ip=src_ip, dst_ip=dst_ip,\n                    unit_id=modbus[\"unit_id\"],\n                    func_code=modbus[\"func_code\"],\n                    description=(\n                        f\"Function code {modbus['func_code']} ({MODBUS_FUNC_NAMES.get(modbus['func_code'], 'Unknown')}) \"\n                        f\"not in baseline for {session_key}\"\n                    ),\n                    mitre_technique=\"T0855 - Unauthorized Command Message\",\n                ))\n\n        # Detection Rule 4: Broadcast write (unit ID 0)\n        if modbus[\"unit_id\"] == 0 and modbus[\"func_code\"] in MODBUS_WRITE_FUNCTIONS:\n            self.alerts.append(ModbusAlert(\n                severity=\"CRITICAL\",\n                alert_type=\"BROADCAST_WRITE\",\n                src_ip=src_ip, dst_ip=dst_ip,\n                unit_id=0,\n                func_code=modbus[\"func_code\"],\n                description=\"Broadcast write command (unit ID 0) affects ALL Modbus devices on segment\",\n                mitre_technique=\"T0855 - Unauthorized Command Message\",\n            ))\n\n        # Detection Rule 5: Out-of-range register access\n        if \"start_address\" in modbus and session_key in self.allowed_register_ranges:\n            addr = modbus[\"start_address\"]\n            qty = modbus.get(\"quantity\", 1)\n            in_range = any(\n                start \u003C= addr and addr + qty \u003C= end\n                for start, end in self.allowed_register_ranges[session_key]\n            )\n            if not in_range:\n                self.alerts.append(ModbusAlert(\n                    severity=\"HIGH\",\n                    alert_type=\"OUT_OF_RANGE_REGISTER\",\n                    src_ip=src_ip, dst_ip=dst_ip,\n                    unit_id=modbus[\"unit_id\"],\n                    func_code=modbus[\"func_code\"],\n                    description=f\"Register access {addr}-{addr+qty} outside baseline ranges\",\n                    mitre_technique=\"T0836 - Modify Parameter\",\n                ))\n\n        # Detection Rule 6: Diagnostic\u002Frestart commands\n        if modbus[\"func_code\"] in MODBUS_DIAGNOSTIC_FUNCTIONS:\n            self.alerts.append(ModbusAlert(\n                severity=\"HIGH\",\n                alert_type=\"DIAGNOSTIC_COMMAND\",\n                src_ip=src_ip, dst_ip=dst_ip,\n                unit_id=modbus[\"unit_id\"],\n                func_code=modbus[\"func_code\"],\n                description=f\"Diagnostic function code {modbus['func_code']} detected - potential DoS or reconnaissance\",\n                mitre_technique=\"T0814 - Denial of Service\",\n            ))\n\n    def print_report(self):\n        \"\"\"Print detection report.\"\"\"\n        print(f\"\\n{'='*70}\")\n        print(f\"MODBUS COMMAND INJECTION DETECTION REPORT\")\n        print(f\"{'='*70}\")\n        print(f\"Analysis Time: {datetime.now().isoformat()}\")\n        print(f\"Total Packets Analyzed: {self.packet_count}\")\n        print(f\"Modbus Packets: {self.modbus_count}\")\n        print(f\"Alerts Generated: {len(self.alerts)}\")\n\n        if self.alerts:\n            severity_counts = defaultdict(int)\n            for alert in self.alerts:\n                severity_counts[alert.severity] += 1\n\n            print(f\"\\nSeverity Distribution:\")\n            for sev in [\"CRITICAL\", \"HIGH\", \"MEDIUM\", \"LOW\"]:\n                if sev in severity_counts:\n                    print(f\"  {sev}: {severity_counts[sev]}\")\n\n            print(f\"\\nDetailed Alerts:\")\n            for alert in self.alerts:\n                print(f\"\\n  [{alert.severity}] {alert.alert_type}\")\n                print(f\"    Time: {alert.timestamp}\")\n                print(f\"    Source: {alert.src_ip} -> {alert.dst_ip}\")\n                print(f\"    Unit ID: {alert.unit_id}\")\n                print(f\"    Function: {alert.func_name} (FC {alert.func_code})\")\n                print(f\"    Detail: {alert.description}\")\n                if alert.mitre_technique:\n                    print(f\"    MITRE ATT&CK ICS: {alert.mitre_technique}\")\n\n    def start_live_monitoring(self, interface: str, duration: int = 0):\n        \"\"\"Start live Modbus traffic monitoring.\"\"\"\n        print(f\"[*] Starting Modbus monitoring on {interface}...\")\n        print(f\"[*] Press Ctrl+C to stop\")\n        try:\n            sniff(\n                iface=interface,\n                filter=\"tcp port 502\",\n                prn=self.analyze_packet,\n                timeout=duration if duration > 0 else None,\n            )\n        except KeyboardInterrupt:\n            pass\n        self.print_report()\n\n\nif __name__ == \"__main__\":\n    detector = ModbusInjectionDetector(\n        baseline_file=sys.argv[2] if len(sys.argv) > 2 else None\n    )\n\n    if len(sys.argv) >= 2:\n        if sys.argv[1].endswith(\".pcap\") or sys.argv[1].endswith(\".pcapng\"):\n            from scapy.all import rdpcap\n            print(f\"[*] Analyzing capture file: {sys.argv[1]}\")\n            packets = rdpcap(sys.argv[1])\n            for pkt in packets:\n                detector.analyze_packet(pkt)\n            detector.print_report()\n        else:\n            detector.start_live_monitoring(sys.argv[1])\n    else:\n        print(\"Usage:\")\n        print(\"  Live:    python modbus_detector.py \u003Cinterface> [baseline.json]\")\n        print(\"  Offline: python modbus_detector.py \u003Ccapture.pcap> [baseline.json]\")\n```\n\n### Step 2: Deploy Suricata Rules for Modbus Attack Detection\n\n```yaml\n# Suricata IDS Rules for Modbus Command Injection Detection\n# Reference: MITRE ATT&CK for ICS, FrostyGoop analysis\n\n# Unauthorized Modbus write from non-engineering workstation\nalert modbus !$MODBUS_AUTHORIZED_WRITERS any -> $OT_PLC_SUBNET 502 (\n  msg:\"MODBUS-INJECT Unauthorized write operation detected\";\n  modbus_func:write_single_coil;\n  flow:to_server,established;\n  classtype:attempted-admin;\n  sid:4000001; rev:1; priority:1;\n)\n\nalert modbus !$MODBUS_AUTHORIZED_WRITERS any -> $OT_PLC_SUBNET 502 (\n  msg:\"MODBUS-INJECT Unauthorized write multiple registers\";\n  modbus_func:write_multiple_registers;\n  flow:to_server,established;\n  classtype:attempted-admin;\n  sid:4000002; rev:1; priority:1;\n)\n\n# Modbus broadcast write affecting all slaves\nalert modbus any any -> $OT_PLC_SUBNET 502 (\n  msg:\"MODBUS-INJECT Broadcast write command (Unit ID 0)\";\n  modbus_unit_id:0;\n  flow:to_server,established;\n  classtype:attempted-admin;\n  sid:4000003; rev:1; priority:1;\n)\n\n# Excessive Modbus write rate (potential automated attack)\nalert modbus any any -> $OT_PLC_SUBNET 502 (\n  msg:\"MODBUS-INJECT Excessive write rate - possible automated attack\";\n  modbus_func:write_multiple_registers;\n  flow:to_server,established;\n  threshold:type threshold, track by_src, count 20, seconds 60;\n  classtype:attempted-admin;\n  sid:4000004; rev:1;\n)\n\n# Modbus diagnostics\u002Frestart command\nalert modbus any any -> $OT_PLC_SUBNET 502 (\n  msg:\"MODBUS-INJECT Diagnostics function code detected\";\n  modbus_func:diagnostics;\n  flow:to_server,established;\n  classtype:attempted-dos;\n  sid:4000005; rev:1;\n)\n\n# FrostyGoop-pattern: write to specific register ranges used for heating control\nalert modbus any any -> $OT_PLC_SUBNET 502 (\n  msg:\"MODBUS-INJECT Potential FrostyGoop - write to heating control registers\";\n  modbus_func:write_multiple_registers;\n  content:\"|00 10|\"; offset:8; depth:2;\n  flow:to_server,established;\n  classtype:attempted-admin;\n  sid:4000010; rev:1; priority:1;\n)\n```\n\n## Key Concepts\n\n| Term | Definition |\n|------|------------|\n| Modbus TCP | Industrial protocol operating on TCP port 502, lacking authentication or encryption, making it vulnerable to command injection |\n| Function Code | Single byte in Modbus PDU specifying the operation (read coils, write registers, diagnostics); monitoring for unauthorized function codes is key to detection |\n| MBAP Header | Modbus Application Protocol header in TCP variant containing transaction ID, protocol ID, length, and unit ID |\n| FrostyGoop | First known malware using Modbus TCP for real-world operational impact, disrupted Ukrainian district heating in 2024 |\n| Unit ID | Address of the target Modbus slave device; Unit ID 0 is a broadcast affecting all slaves |\n| Register Range | Specific memory addresses in the PLC; legitimate operations access known ranges; out-of-range access indicates reconnaissance or manipulation |\n\n## Common Scenarios\n\n### Scenario: FrostyGoop-Style Heating Control Attack\n\n**Context**: A building automation system uses Modbus TCP to control HVAC equipment. Monitoring detects unexpected write commands to heating control registers from an IP not associated with any authorized BMS controller.\n\n**Approach**:\n1. Verify the source IP against the authorized Modbus master list\n2. Check if any authorized maintenance or configuration change is in progress\n3. Capture full Modbus transaction including register addresses and values being written\n4. Compare written values against safe operating ranges for the heating equipment\n5. If unauthorized, immediately block the source IP at the industrial firewall\n6. Inspect the source device for compromise indicators (malware, unauthorized remote access)\n7. Verify current setpoints on all affected controllers against known-good values\n8. Restore safe setpoints if manipulation is confirmed\n\n**Pitfalls**: Modbus lacks authentication, so the source IP is the only identifier -- attackers can spoof IPs if ARP protections are not in place. Do not assume all writes are malicious; legitimate SCADA operations include writes. Always verify against the change management log before escalating.\n\n## Output Format\n\n```\nMODBUS INJECTION DETECTION REPORT\n====================================\nAnalysis Period: [start] to [end]\nMonitoring Point: [interface\u002FSPAN description]\n\nTRAFFIC SUMMARY:\n  Total Modbus Packets: [count]\n  Read Operations: [count]\n  Write Operations: [count]\n  Unauthorized Writes Detected: [count]\n\nALERTS:\n  [CRITICAL] Unauthorized write from [IP] to PLC [IP]\n    Function: Write Multiple Registers (FC 16)\n    Registers: [start]-[end]\n    MITRE: T0855 - Unauthorized Command Message\n\nBASELINE DEVIATIONS:\n  New Modbus masters: [list]\n  Unusual function codes: [list]\n  Out-of-range register access: [list]\n\nRECOMMENDED ACTIONS:\n  1. Verify source [IP] authorization status\n  2. Block unauthorized sources at industrial firewall\n  3. Validate PLC register values against known-good state\n```\n",{"name":5,"tags":24,"author":33,"domain":34,"license":14,"version":35,"nist_csf":36,"subdomain":41,"description":7,"mitre_attack":42},[25,26,27,28,29,30,31,32],"ot-security","ics","modbus","command-injection","protocol-analysis","ids","scada","threat-detection","mahipal","cybersecurity","1.0",[37,38,39,40],"PR.IR-01","DE.CM-01","ID.AM-05","GV.OC-02","ot-ics-security",[43,44,45,46,47],"T1078","T1190","T1059","T1055","T0816","main","1eb986d0b0ecc180291597e08eb5a58288843536","skills\u002Fcurated_premium_skills\u002FAnthropic-Cybersecurity-Skills\u002Fskills\u002Fdetecting-modbus-command-injection-attacks","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv","2026-08-25 13:16:33",{"source":8,"skillName":5,"commands":55,"prompt":65,"zipAvailable":66},[56,59,62],{"tool":57,"command":58},"npx","npx skills add vikasvardhanv\u002Fjerry_skills --skill detecting-modbus-command-injection-attacks",{"tool":60,"command":61},"bunx","bunx skills add vikasvardhanv\u002Fjerry_skills --skill detecting-modbus-command-injection-attacks",{"tool":63,"command":64},"pnpm","pnpm dlx skills add vikasvardhanv\u002Fjerry_skills --skill detecting-modbus-command-injection-attacks","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fcurated_premium_skills\u002FAnthropic-Cybersecurity-Skills\u002Fskills\u002Fdetecting-modbus-command-injection-attacks\u002FSKILL.md",true,[68,72,78],{"path":69,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":71,"sourceHtmlUrl":15},"LICENSE","许可证",11255,{"path":73,"resourceType":74,"resourceTypeDesc":75,"sizeBytes":76,"sourceHtmlUrl":77},"references\u002Fapi-reference.md","REFERENCE","参考文档",1636,"https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fcurated_premium_skills\u002FAnthropic-Cybersecurity-Skills\u002Fskills\u002Fdetecting-modbus-command-injection-attacks\u002Freferences\u002Fapi-reference.md",{"path":79,"resourceType":80,"resourceTypeDesc":81,"sizeBytes":82,"sourceHtmlUrl":83},"scripts\u002Fagent.py","SCRIPT","脚本",5239,"https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fcurated_premium_skills\u002FAnthropic-Cybersecurity-Skills\u002Fskills\u002Fdetecting-modbus-command-injection-attacks\u002Fscripts\u002Fagent.py",[85,93,100,107,114,121],{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":89,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":19},"01M7BESR1CJ3H5SP9XM8KYJZ9W","syllabus","Generates a curated supplementary reading list from any course syllabus using Consensus academic search. Grill-me intake (syllabus input format + course audience + year range) plus a grouping forcing-options checkpoint before any search runs — so the reading list matches the course's level and recency need. Parses the syllabus to extract topics and learning outcomes, searches Consensus for recent peer-reviewed papers per topic, and produces a professionally formatted .docx with clickable Consensus links, plain-language summaries calibrated to audience level, and Bloom-higher-order discussion questions tied to course learning goals. Use when the user uploads a syllabus, course outline, or curriculum document and wants supplementary readings (e.g., 'create a reading list from this syllabus', 'find recent papers for my course') — even casual mentions with a syllabus attached should trigger this skill.","MIT","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fresearch\u002Fsyllabus\u002Fskills\u002Fsyllabus\u002FSKILL.md",[],[],{"skillNo":94,"name":95,"nameZh":6,"description":96,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":89,"licenseFileUrl":6,"sourceHtmlUrl":97,"categories":98,"keywords":99,"publishedAt":19},"01M7BES1YA6R97W7QPMFFM1PED","pulse","Multi-source recency research skill that takes the pulse of any topic across Reddit, Hacker News, the open web, and optionally X\u002FTwitter within a configurable recent window (default 30 days). Forcing intake clarifies topic specificity, angle (trend\u002Fsentiment\u002Fproblems\u002Fopportunities\u002Fcomparison), time window, and platform scope before searching. Returns a synthesized briefing with citations, engagement metrics, and cross-platform pattern analysis. Use when the user requests multi-source recency intelligence on a topic (e.g., 'pulse on [topic]', 'what's happening with [topic]', 'what are people saying about [topic]', 'current conversation about [topic]', 'take the pulse of [topic]', 'trending: [topic]', 'find me info on [topic]'), and for competitor research, trend discovery, tool comparisons, and audience sentiment analysis.","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fresearch\u002Fpulse\u002Fskills\u002Fpulse\u002FSKILL.md",[],[],{"skillNo":101,"name":102,"nameZh":6,"description":103,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":89,"licenseFileUrl":6,"sourceHtmlUrl":104,"categories":105,"keywords":106,"publishedAt":19},"01M7BERNHYGY035AR00VRT03KE","patent","Patent prior-art and landscape intelligence skill — not generic patent help. Commits to one of five sub-use-cases via forcing intake (novelty search \u002F freedom-to-operate \u002F competitive landscape \u002F acquisition diligence \u002F litigation prior-art) before any search runs. Searches Google Patents, Espacenet, USPTO, and optionally Lens.org for citation-graph signals. Output is an editable Word document (.docx) with verdict, ranked closest art (claim-text extracted), CPC-class-aware landscape, family-resolved hits, geographic coverage, FTO flags where applicable, strategy recommendations, and full audit log. Use when the user asks for patent searching or analysis (e.g., 'prior art search for [invention]', 'freedom to operate analysis for [product]'). Produces search signal, not legal advice — always recommends consulting a patent attorney before filing or licensing decisions. Trademark, copyright, and trade-secret questions are out of scope.","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fresearch\u002Fpatent\u002Fskills\u002Fpatent\u002FSKILL.md",[],[],{"skillNo":108,"name":109,"nameZh":6,"description":110,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":89,"licenseFileUrl":6,"sourceHtmlUrl":111,"categories":112,"keywords":113,"publishedAt":19},"01M7BERCK1EAKTWW7R436WAR0J","notebooklm","Browser automation skill for controlling Google's NotebookLM. Use when the user wants anything done in NotebookLM (e.g., 'open NotebookLM', 'check my [name] notebook', 'ask my notebook about X', 'add [source] to NotebookLM', 'generate a Video Overview from my notebook', 'use NotebookLM Studio'). Handles reading and querying notebooks, adding sources (URLs, text, files, YouTube links, synthesized content), generating Studio outputs (Audio\u002FVideo Overviews, Mind Maps, Reports incl. Briefing Doc\u002FStudy Guide\u002FFAQ, Flashcards, Quiz, slide decks, infographics — discover the exact set from the live Studio panel; the UI evolves fast), and creating new notebooks. Requires browser automation environment — fails gracefully when unavailable.","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fresearch\u002Fnotebooklm\u002Fskills\u002Fnotebooklm\u002FSKILL.md",[],[],{"skillNo":115,"name":116,"nameZh":6,"description":117,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":89,"licenseFileUrl":6,"sourceHtmlUrl":118,"categories":119,"keywords":120,"publishedAt":19},"01M7BEQZAZAQRTXFJRY7RHV3TY","litreview","Academic literature orientation skill that searches papers via free keyless APIs (PubMed E-utilities + OpenAlex) by default — with the Consensus MCP as an optional enhancement lane when connected — builds a strategic search plan using PICO (default) or SPIDER \u002F Decomposition \u002F hybrid as fallbacks, and synthesizes findings into a formatted Word (.docx) research guide. Grill-me intake (research question specificity + framework hint + tentative depth) before the recon search; a second forcing checkpoint after Phase 2 confirms framework + sub-areas + depth before searches consume budget. Configurable depth (5\u002F10\u002F20 queries) controls coverage vs. speed. Output is a 'launching pad' — an orientation guide that lets a researcher dive in confidently, not a finished review. Use when the user starts literature-oriented research (e.g., 'litreview on [topic]', 'literature review on [topic]', 'I'm starting a literature review on X', 'I'm writing a paper on X', 'help me research X', 'I'm doing research on X', 'can you help me research X'). Do NOT use for single one-off paper searches wanting a quick list — that's a plain PubMed\u002FOpenAlex (or Consensus) query.","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fresearch\u002Flitreview\u002Fskills\u002Flitreview\u002FSKILL.md",[],[],{"skillNo":122,"name":123,"nameZh":6,"description":124,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":89,"licenseFileUrl":6,"sourceHtmlUrl":125,"categories":126,"keywords":127,"publishedAt":19},"01M7BEQKJ45K31QK5VRAQSVJCJ","grants","NIH grant research skill for clinical researchers. Grill-me intake (research idea + career stage + preliminary data + environment + submission posture + known institute targets) locks down the funding strategy before any search runs. Runs a 5-facet Consensus positioning analysis (with draft Significance\u002FInnovation language), maps the research to the right NIH institutes and study sections via RePORTER, finds NOSIs and funded overlap, and produces an editable Word document (.docx) with budget\u002Fscope-aware mechanism recommendations, submission timelines, and a mandatory program officer recommendation. Use when the user asks about research funding or makes any grant-related request (e.g., 'grants for [topic]', 'find grants for my research idea', 'what grants match my research', 'help me find NIH funding', 'grant opportunities for my research'). NIH-only scope — non-NIH funders (PCORI, DOD CDMRP, VA, foundations) are out of scope and flagged at intake.","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fresearch\u002Fgrants\u002Fskills\u002Fgrants\u002FSKILL.md",[],[]]