[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6GXM9XMVJ5S2KBRZ97JQYA0":3,"skill-same:01M6GXM9XMVJ5S2KBRZ97JQYA0":86},{"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":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":38,"linkOnly":39,"markdownContent":40,"markdownBody":41,"frontMatter":42,"refName":48,"commitSha":49,"skillDirectory":50,"forksCount":51,"repositoryHtmlUrl":52,"repositoryHomepageUrl":6,"ownerHtmlUrl":53,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":54,"install":55,"resources":68},"01M6GXM9XMVJ5S2KBRZ97JQYA0","detecting-modbus-command-injection-attacks",null,"Detect command injection attacks against Modbus TCP\u002FRTU protocol in ICS environments by monitoring for unauthorized write operations, anomalous function codes, malformed frames, and deviations from established communication baselines using ICS-aware IDS and protocol deep packet inspection.","micsapp\u002Fmicstec-skills","micsapp","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F82411001?v=4","01M6GWCFQ6D3PV8EHNY62NN5VW","01M6GWCFVE1PA5HG0DKC7AMFJ3",4,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fmicsapp\u002Fmicstec-skills\u002Fblob\u002Fmaster\u002F_universal\u002Fcybersecurity-skills\u002Fskills\u002Fdetecting-modbus-command-injection-attacks\u002FSKILL.md",[],[18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"attacks","detecting","command injection","command","injection","modbus","detecting modbus command injection attacks","command-injection","codes","deep","analysis","cybersecurity","scada","ics","ot-security","ids","threat-detection","protocol-analysis","monitoring","tcp","2026-11-10 10:12:30",false,"---\nname: detecting-modbus-command-injection-attacks\ndescription: >\n  Detect command injection attacks against Modbus TCP\u002FRTU protocol in ICS\n  environments by monitoring for unauthorized write operations, anomalous function\n  codes, malformed frames, and deviations from established communication baselines\n  using ICS-aware IDS and protocol deep packet inspection.\ndomain: cybersecurity\nsubdomain: ot-ics-security\ntags: [ot-security, ics, modbus, command-injection, protocol-analysis, ids, scada, threat-detection]\nversion: \"1.0\"\nauthor: mahipal\nlicense: Apache-2.0\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":43,"author":44,"domain":29,"license":14,"version":45,"subdomain":46,"description":47},[32,31,23,25,35,33,30,34],"mahipal","1.0","ot-ics-security","Detect command injection attacks against Modbus TCP\u002FRTU protocol in ICS environments by monitoring for unauthorized write operations, anomalous function codes, malformed frames, and deviations from established communication baselines using ICS-aware IDS and protocol deep packet inspection.\n","master","3f5d983eb4ef375b749adcd6b07ec03bd82ae8a8","_universal\u002Fcybersecurity-skills\u002Fskills\u002Fdetecting-modbus-command-injection-attacks",0,"https:\u002F\u002Fgithub.com\u002Fmicsapp\u002Fmicstec-skills","https:\u002F\u002Fgithub.com\u002Fmicsapp","2026-03-20 11:24:18",{"source":8,"skillName":5,"commands":56,"prompt":66,"zipAvailable":67},[57,60,63],{"tool":58,"command":59},"npx","npx skills add micsapp\u002Fmicstec-skills --skill detecting-modbus-command-injection-attacks",{"tool":61,"command":62},"bunx","bunx skills add micsapp\u002Fmicstec-skills --skill detecting-modbus-command-injection-attacks",{"tool":64,"command":65},"pnpm","pnpm dlx skills add micsapp\u002Fmicstec-skills --skill detecting-modbus-command-injection-attacks","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmicsapp\u002Fmicstec-skills\u002Fblob\u002Fmaster\u002F_universal\u002Fcybersecurity-skills\u002Fskills\u002Fdetecting-modbus-command-injection-attacks\u002FSKILL.md",true,[69,74,80],{"path":70,"resourceType":70,"resourceTypeDesc":71,"sizeBytes":72,"sourceHtmlUrl":73},"LICENSE","许可证",11255,"https:\u002F\u002Fgithub.com\u002Fmicsapp\u002Fmicstec-skills\u002Fblob\u002Fmaster\u002F_universal\u002Fcybersecurity-skills\u002Fskills\u002Fdetecting-modbus-command-injection-attacks\u002FLICENSE",{"path":75,"resourceType":76,"resourceTypeDesc":77,"sizeBytes":78,"sourceHtmlUrl":79},"references\u002Fapi-reference.md","REFERENCE","参考文档",1636,"https:\u002F\u002Fgithub.com\u002Fmicsapp\u002Fmicstec-skills\u002Fblob\u002Fmaster\u002F_universal\u002Fcybersecurity-skills\u002Fskills\u002Fdetecting-modbus-command-injection-attacks\u002Freferences\u002Fapi-reference.md",{"path":81,"resourceType":82,"resourceTypeDesc":83,"sizeBytes":84,"sourceHtmlUrl":85},"scripts\u002Fagent.py","SCRIPT","脚本",5239,"https:\u002F\u002Fgithub.com\u002Fmicsapp\u002Fmicstec-skills\u002Fblob\u002Fmaster\u002F_universal\u002Fcybersecurity-skills\u002Fskills\u002Fdetecting-modbus-command-injection-attacks\u002Fscripts\u002Fagent.py",[87,115,137,157,175,199],{"skillNo":88,"name":89,"nameZh":6,"description":90,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":91,"licenseFileUrl":6,"sourceHtmlUrl":92,"categories":93,"keywords":94,"publishedAt":38},"01M6HBTJ02FXBFG9NYEHHYAP52","azure-apim-architecture","Analyzes and explains Azure API Management architecture decisions for enterprise API marketplace implementations using VNet Internal mode, Front Door, hybrid authentication, and multi-environment strategies. Use when discussing APIM component selection, network topology, cost optimization, or comparing alternatives like workspaces vs instances, VNet Internal vs External mode, or Front Door vs Application Gateway.","MIT","https:\u002F\u002Fgithub.com\u002Fmicsapp\u002Fmicstec-skills\u002Fblob\u002Fmaster\u002Fcopilot-cli\u002Fcopilot-agent-skills\u002F.github\u002Fskills\u002Fazure-apim-architecture\u002FSKILL.md",[],[95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114],"architecture","azure","azure apim architecture","component","authentication","gateway","topology","Optimization","network","api","team","environment","multi-environment","workspaces","instances","selection","strategies","azure api management","mode","for",{"skillNo":116,"name":117,"nameZh":6,"description":118,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":91,"licenseFileUrl":6,"sourceHtmlUrl":119,"categories":120,"keywords":121,"publishedAt":38},"01M6HBT7J4H082JEEA670B3EQ9","apiops-deployment","Guides deployment of Azure API Management infrastructure using Infrastructure as Code (Bicep\u002FTerraform), CI\u002FCD pipelines (GitHub Actions\u002FAzure DevOps), and APIOps workflows. Use when deploying APIM, creating pipelines, or implementing dev→test→prod promotion strategies.","https:\u002F\u002Fgithub.com\u002Fmicsapp\u002Fmicstec-skills\u002Fblob\u002Fmaster\u002Fcopilot-cli\u002Fcopilot-agent-skills\u002F.github\u002Fskills\u002Fapiops-deployment\u002FSKILL.md",[],[122,123,124,125,96,126,127,128,129,130,131,132,104,105,111,133,134,112,135,136],"deployment","apiops deployment","workflows","azure devops","infrastructure","code","infrastructure as code","actions","ci","github actions","github-actions","as","guides","CI\u002FCD","implementing",{"skillNo":138,"name":139,"nameZh":6,"description":140,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":91,"licenseFileUrl":6,"sourceHtmlUrl":141,"categories":142,"keywords":143,"publishedAt":38},"01M6HBT2HEA23THNE9E00GYQBE","apim-policy-authoring","Creates production-ready Azure API Management policy XML for authentication (OAuth 2.0, JWT validation, subscription keys), rate limiting, CORS configuration, error handling, and API transformations. Use when implementing API security, access control, or request\u002Fresponse processing logic.","https:\u002F\u002Fgithub.com\u002Fmicsapp\u002Fmicstec-skills\u002Fblob\u002Fmaster\u002Fcopilot-cli\u002Fcopilot-agent-skills\u002F.github\u002Fskills\u002Fapim-policy-authoring\u002FSKILL.md",[],[144,145,146,147,96,99,104,105,148,149,150,151,152,153,154,112,155,156,136,114],"policy","authoring","apim policy authoring","security","access","use","ready","api security","Access Control","error","processing","cors configuration","production-ready",{"skillNo":158,"name":159,"nameZh":6,"description":160,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":91,"licenseFileUrl":6,"sourceHtmlUrl":161,"categories":162,"keywords":163,"publishedAt":38},"01M6HBSY65SB29J9WE9KYD0K6T","api-security-review","Reviews Azure API Management configurations for security vulnerabilities, OWASP API Security Top 10 compliance, VNet Internal mode validation, Private Link verification, and Azure Security Benchmark alignment. Use when performing security audits, pre-deployment validation, or compliance reviews.","https:\u002F\u002Fgithub.com\u002Fmicsapp\u002Fmicstec-skills\u002Fblob\u002Fmaster\u002Fcopilot-cli\u002Fcopilot-agent-skills\u002F.github\u002Fskills\u002Fapi-security-review\u002FSKILL.md",[],[164,147,165,104,151,166,96,122,167,168,169,170,105,171,112,172,173,174,113,114],"review","security review","api security review","benchmark","verification","owasp","owasp-api","alignment","azure security","reviews","top",{"skillNo":176,"name":177,"nameZh":6,"description":178,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":91,"licenseFileUrl":6,"sourceHtmlUrl":179,"categories":180,"keywords":181,"publishedAt":38},"01M6HBSRW4PDFE6K4F8JYPZQ05","jira-cli","Interact with Jira from the command line to create, list, view, edit, and transition issues, manage sprints and epics, and perform common Jira workflows. Use when the user asks about Jira tasks, tickets, issues, sprints, or needs to manage project work items.","https:\u002F\u002Fgithub.com\u002Fmicsapp\u002Fmicstec-skills\u002Fblob\u002Fmaster\u002Fcopilot-cli\u002Fawesome-copilot-agents\u002Fskills\u002Fjira-cli\u002FSKILL.md",[],[182,183,184,124,185,186,187,188,104,189,190,21,191,192,193,194,195,196,197,198],"cli","jira","jira cli","init","tasks","create","issues","common","work","edit","list","view","project","project work","token","line","sprints",{"skillNo":200,"name":201,"nameZh":6,"description":202,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":91,"licenseFileUrl":6,"sourceHtmlUrl":203,"categories":204,"keywords":205,"publishedAt":38},"01M6HBSNS3JHMW603G47TWE31H","calculator","Performs arbitrary-precision arithmetic calculations including addition, subtraction, multiplication, division, and exponents. Use when the user asks to calculate, compute, or evaluate math expressions, or when precise decimal arithmetic is needed to avoid floating-point errors.","https:\u002F\u002Fgithub.com\u002Fmicsapp\u002Fmicstec-skills\u002Fblob\u002Fmaster\u002Fcopilot-cli\u002Fawesome-copilot-agents\u002Fskills\u002Fcalculator\u002FSKILL.md",[],[201,206,207,208,209,210,211,149,212,213],"npm","js","calculate","node","math","user","compute","errors"]