[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7B4N75SSQ94DY4F6NBNJAQZ":3,"skill-same:01M7B4N75SSQ94DY4F6NBNJAQZ":82},{"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":46,"commitSha":47,"skillDirectory":48,"forksCount":13,"repositoryHtmlUrl":49,"repositoryHomepageUrl":6,"ownerHtmlUrl":50,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":51,"install":52,"resources":65},"01M7B4N75SSQ94DY4F6NBNJAQZ","analyzing-command-and-control-communication",null,"Analyzes malware C2 communication over HTTP, HTTPS, DNS, and custom protocols to reverse-engineer beacon patterns, command structures, data encoding, and infrastructure (primary servers, fallback domains, dead drops). Use after reverse engineering reveals network traffic needing protocol analysis or when building detection signatures for a framework like Cobalt Strike, Metasploit, or Sliver.","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\u002Fanalyzing-command-and-control-communication\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fcurated_premium_skills\u002FAnthropic-Cybersecurity-Skills\u002Fskills\u002Fanalyzing-command-and-control-communication\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: analyzing-command-and-control-communication\ndescription: 'Analyzes malware C2 communication over HTTP, HTTPS, DNS, and custom\n  protocols to reverse-engineer beacon patterns, command structures, data encoding,\n  and infrastructure (primary servers, fallback domains, dead drops). Use after\n  reverse engineering reveals network traffic needing protocol analysis or when\n  building detection signatures for a framework like Cobalt Strike, Metasploit,\n  or Sliver.\n\n  '\ndomain: cybersecurity\nsubdomain: malware-analysis\ntags:\n- malware\n- C2\n- command-and-control\n- beacon\n- protocol-analysis\nversion: 1.0.0\nauthor: mahipal\nlicense: Apache-2.0\nnist_csf:\n- DE.AE-02\n- RS.AN-03\n- ID.RA-01\n- DE.CM-01\nmitre_attack:\n- T1071.001\n- T1573\n- T1571\n- T1008\n- T1095\n---\n\n# Analyzing Command-and-Control Communication\n\n## When to Use\n\n- Reverse engineering a malware sample has revealed network communication that needs protocol analysis\n- Building network-level detection signatures for a specific C2 framework (Cobalt Strike, Metasploit, Sliver)\n- Mapping C2 infrastructure including primary servers, fallback domains, and dead drops\n- Analyzing encrypted or encoded C2 traffic to understand the command set and data format\n- Attributing malware to a threat actor based on C2 infrastructure patterns and tooling\n\n**Do not use** for general network anomaly detection; this is specifically for understanding known or suspected C2 protocols from malware analysis.\n\n## Prerequisites\n\n- PCAP capture of malware network traffic (from sandbox, network tap, or full packet capture)\n- Wireshark\u002Ftshark for packet-level analysis\n- Reverse engineering tools (Ghidra, dnSpy) for understanding C2 code in the malware binary\n- Python 3.8+ with `scapy`, `dpkt`, and `requests` for protocol analysis and replay\n- Threat intelligence databases for C2 infrastructure correlation (VirusTotal, Shodan, Censys)\n- JA3\u002FJA3S fingerprint databases for TLS-based C2 identification\n\n## Workflow\n\n### Step 1: Identify the C2 Channel\n\nDetermine the protocol and transport used for C2 communication:\n\n```\nC2 Communication Channels:\n━━━━━━━━━━━━━━━━━━━━━━━━━\nHTTP\u002FHTTPS:     Most common; uses standard web traffic to blend in\n                Indicators: Regular POST\u002FGET requests, specific URI patterns, custom headers\n\nDNS:            Tunneling data through DNS queries and responses\n                Indicators: High-volume TXT queries, long subdomain names, high entropy\n\nCustom TCP\u002FUDP: Proprietary binary protocol on non-standard port\n                Indicators: Non-HTTP traffic on high ports, unknown protocol\n\nICMP:           Data encoded in ICMP echo\u002Freply payloads\n                Indicators: ICMP packets with large or non-standard payloads\n\nWebSocket:      Persistent bidirectional connection for real-time C2\n                Indicators: WebSocket upgrade followed by binary frames\n\nCloud Services: Using legitimate APIs (Telegram, Discord, Slack, GitHub)\n                Indicators: API calls to cloud services from unexpected processes\n\nEmail:          SMTP\u002FIMAP for C2 commands and data exfiltration\n                Indicators: Automated email operations from non-email processes\n```\n\n### Step 2: Analyze Beacon Pattern\n\nCharacterize the periodic communication pattern:\n\n```python\nfrom scapy.all import rdpcap, IP, TCP\nfrom collections import defaultdict\nimport statistics\nimport json\n\npackets = rdpcap(\"c2_traffic.pcap\")\n\n# Group TCP SYN packets by destination\nconnections = defaultdict(list)\nfor pkt in packets:\n    if IP in pkt and TCP in pkt and (pkt[TCP].flags & 0x02):\n        key = f\"{pkt[IP].dst}:{pkt[TCP].dport}\"\n        connections[key].append(float(pkt.time))\n\n# Analyze each destination for beaconing\nfor dst, times in sorted(connections.items()):\n    if len(times) \u003C 3:\n        continue\n\n    intervals = [times[i+1] - times[i] for i in range(len(times)-1)]\n    avg_interval = statistics.mean(intervals)\n    stdev = statistics.stdev(intervals) if len(intervals) > 1 else 0\n    jitter_pct = (stdev \u002F avg_interval * 100) if avg_interval > 0 else 0\n    duration = times[-1] - times[0]\n\n    beacon_data = {\n        \"destination\": dst,\n        \"connections\": len(times),\n        \"duration_seconds\": round(duration, 1),\n        \"avg_interval_seconds\": round(avg_interval, 1),\n        \"stdev_seconds\": round(stdev, 1),\n        \"jitter_percent\": round(jitter_pct, 1),\n        \"is_beacon\": 5 \u003C avg_interval \u003C 7200 and jitter_pct \u003C 25,\n    }\n\n    if beacon_data[\"is_beacon\"]:\n        print(f\"[!] BEACON DETECTED: {dst}\")\n        print(f\"    Interval: {avg_interval:.0f}s +\u002F- {stdev:.0f}s ({jitter_pct:.0f}% jitter)\")\n        print(f\"    Sessions: {len(times)} over {duration:.0f}s\")\n```\n\n### Step 3: Decode C2 Protocol Structure\n\nReverse engineer the message format from captured traffic:\n\n```python\n# HTTP-based C2 protocol analysis\nimport dpkt\nimport base64\n\nwith open(\"c2_traffic.pcap\", \"rb\") as f:\n    pcap = dpkt.pcap.Reader(f)\n\nfor ts, buf in pcap:\n    eth = dpkt.ethernet.Ethernet(buf)\n    if not isinstance(eth.data, dpkt.ip.IP):\n        continue\n    ip = eth.data\n    if not isinstance(ip.data, dpkt.tcp.TCP):\n        continue\n    tcp = ip.data\n\n    if tcp.dport == 80 or tcp.dport == 443:\n        if len(tcp.data) > 0:\n            try:\n                http = dpkt.http.Request(tcp.data)\n                print(f\"\\n--- C2 REQUEST ---\")\n                print(f\"Method: {http.method}\")\n                print(f\"URI: {http.uri}\")\n                print(f\"Headers: {dict(http.headers)}\")\n                if http.body:\n                    print(f\"Body ({len(http.body)} bytes):\")\n                    # Try Base64 decode\n                    try:\n                        decoded = base64.b64decode(http.body)\n                        print(f\"  Decoded: {decoded[:200]}\")\n                    except:\n                        print(f\"  Raw: {http.body[:200]}\")\n            except:\n                pass\n```\n\n### Step 4: Identify C2 Framework\n\nMatch observed patterns to known C2 frameworks:\n\n```\nKnown C2 Framework Signatures:\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━\nCobalt Strike:\n  - Default URIs: \u002Fpixel, \u002Fsubmit.php, \u002F___utm.gif, \u002Fca, \u002Fdpixel\n  - Malleable C2 profiles customize all traffic characteristics\n  - JA3: varies by profile, catalog at ja3er.com\n  - Watermark in beacon config (unique per license)\n  - Config extraction: use CobaltStrikeParser or 1768.py\n\nMetasploit\u002FMeterpreter:\n  - Default staging URI patterns: random 4-char checksum\n  - Reverse HTTP(S) handler patterns\n  - Meterpreter TLV (Type-Length-Value) protocol structure\n\nSliver:\n  - mTLS, HTTP, DNS, WireGuard transport options\n  - Protobuf-encoded messages\n  - Unique implant ID in communication\n\nCovenant:\n  - .NET-based C2 framework\n  - HTTP with customizable profiles\n  - Task-based command execution\n\nPoshC2:\n  - PowerShell\u002FC# based\n  - HTTP with encrypted payloads\n  - Cookie-based session management\n```\n\n```bash\n# Extract Cobalt Strike beacon configuration from PCAP or sample\npython3 \u003C\u003C 'PYEOF'\n# Using CobaltStrikeParser (pip install cobalt-strike-parser)\nfrom cobalt_strike_parser import BeaconConfig\n\ntry:\n    config = BeaconConfig.from_file(\"suspect.exe\")\n    print(\"Cobalt Strike Beacon Configuration:\")\n    for key, value in config.items():\n        print(f\"  {key}: {value}\")\nexcept Exception as e:\n    print(f\"Not a Cobalt Strike beacon or parse error: {e}\")\nPYEOF\n```\n\n### Step 5: Map C2 Infrastructure\n\nDocument the full C2 infrastructure and failover mechanisms:\n\n```python\n# Infrastructure mapping\nimport requests\nimport json\n\nc2_indicators = {\n    \"primary_c2\": \"185.220.101.42\",\n    \"domains\": [\"update.malicious.com\", \"backup.evil.net\"],\n    \"ports\": [443, 8443],\n    \"failover_dns\": [\"ns1.malicious-dns.com\"],\n}\n\n# Enrich with Shodan\ndef shodan_lookup(ip, api_key):\n    resp = requests.get(f\"https:\u002F\u002Fapi.shodan.io\u002Fshodan\u002Fhost\u002F{ip}?key={api_key}\")\n    if resp.status_code == 200:\n        data = resp.json()\n        return {\n            \"ip\": ip,\n            \"ports\": data.get(\"ports\", []),\n            \"os\": data.get(\"os\"),\n            \"org\": data.get(\"org\"),\n            \"asn\": data.get(\"asn\"),\n            \"country\": data.get(\"country_code\"),\n            \"hostnames\": data.get(\"hostnames\", []),\n            \"last_update\": data.get(\"last_update\"),\n        }\n    return None\n\n# Enrich with passive DNS\ndef pdns_lookup(domain):\n    # Using VirusTotal passive DNS\n    resp = requests.get(\n        f\"https:\u002F\u002Fwww.virustotal.com\u002Fapi\u002Fv3\u002Fdomains\u002F{domain}\u002Fresolutions\",\n        headers={\"x-apikey\": VT_API_KEY}\n    )\n    if resp.status_code == 200:\n        data = resp.json()\n        resolutions = []\n        for r in data.get(\"data\", []):\n            resolutions.append({\n                \"ip\": r[\"attributes\"][\"ip_address\"],\n                \"date\": r[\"attributes\"][\"date\"],\n            })\n        return resolutions\n    return []\n```\n\n### Step 6: Create Network Detection Signatures\n\nBuild detection rules based on analyzed C2 characteristics:\n\n```bash\n# Suricata rules for the analyzed C2\ncat \u003C\u003C 'EOF' > c2_detection.rules\n# HTTP beacon pattern\nalert http $HOME_NET any -> $EXTERNAL_NET any (\n    msg:\"MALWARE MalwareX C2 HTTP Beacon\";\n    flow:established,to_server;\n    http.method; content:\"POST\";\n    http.uri; content:\"\u002Fgate.php\"; startswith;\n    http.header; content:\"User-Agent: Mozilla\u002F5.0 (compatible; MSIE 10.0)\";\n    threshold:type threshold, track by_src, count 5, seconds 600;\n    sid:9000010; rev:1;\n)\n\n# JA3 fingerprint match\nalert tls $HOME_NET any -> $EXTERNAL_NET any (\n    msg:\"MALWARE MalwareX TLS JA3 Fingerprint\";\n    ja3.hash; content:\"a0e9f5d64349fb13191bc781f81f42e1\";\n    sid:9000011; rev:1;\n)\n\n# DNS beacon detection (high-entropy subdomain)\nalert dns $HOME_NET any -> any any (\n    msg:\"MALWARE Suspected DNS C2 Tunneling\";\n    dns.query; pcre:\"\u002F^[a-z0-9]{20,}\\.\u002F\";\n    threshold:type threshold, track by_src, count 10, seconds 60;\n    sid:9000012; rev:1;\n)\n\n# Certificate-based detection\nalert tls $HOME_NET any -> $EXTERNAL_NET any (\n    msg:\"MALWARE MalwareX Self-Signed C2 Certificate\";\n    tls.cert_subject; content:\"CN=update.malicious.com\";\n    sid:9000013; rev:1;\n)\nEOF\n```\n\n## Key Concepts\n\n| Term | Definition |\n|------|------------|\n| **Beaconing** | Periodic check-in communication from malware to C2 server at regular intervals, often with jitter to avoid pattern detection |\n| **Jitter** | Randomization applied to beacon interval (e.g., 60s +\u002F- 15%) to make the timing pattern less predictable and harder to detect |\n| **Malleable C2** | Cobalt Strike feature allowing operators to customize all aspects of C2 traffic (URIs, headers, encoding) to mimic legitimate services |\n| **Dead Drop** | Intermediate location (paste site, cloud storage, social media) where C2 commands are posted for the malware to retrieve |\n| **Domain Fronting** | Using a trusted CDN domain in the TLS SNI while routing to a different backend, making C2 traffic appear to go to a legitimate service |\n| **Fast Flux** | Rapidly changing DNS records for C2 domains to distribute across many IPs and resist takedown efforts |\n| **C2 Framework** | Software toolkit providing C2 server, implant generator, and operator interface (Cobalt Strike, Metasploit, Sliver, Covenant) |\n\n## Tools & Systems\n\n- **Wireshark**: Packet analyzer for detailed C2 protocol analysis at the packet level\n- **RITA (Real Intelligence Threat Analytics)**: Open-source tool analyzing Zeek logs for beacon detection and DNS tunneling\n- **CobaltStrikeParser**: Tool extracting Cobalt Strike beacon configuration from samples and memory dumps\n- **JA3\u002FJA3S**: TLS fingerprinting method for identifying C2 frameworks by their TLS implementation characteristics\n- **Shodan\u002FCensys**: Internet scanning platforms for mapping C2 infrastructure and identifying related servers\n\n## Common Scenarios\n\n### Scenario: Reverse Engineering a Custom C2 Protocol\n\n**Context**: A malware sample communicates with its C2 server using an unknown binary protocol over TCP port 8443. The protocol needs to be decoded to understand the command set and build detection signatures.\n\n**Approach**:\n1. Filter PCAP for TCP port 8443 conversations and extract the TCP streams\n2. Analyze the first few exchanges to identify the handshake\u002Fauthentication mechanism\n3. Map the message structure (length prefix, type field, payload encoding)\n4. Cross-reference with Ghidra disassembly of the send\u002Freceive functions in the malware\n5. Identify the command dispatcher and document each command code's function\n6. Build a protocol decoder in Python for ongoing traffic analysis\n7. Create Suricata rules matching the protocol handshake or static header bytes\n\n**Pitfalls**:\n- Assuming the protocol is static; some C2 frameworks negotiate encryption during the handshake\n- Not capturing enough traffic to see all command types (some commands are rare)\n- Missing fallback C2 channels (DNS, ICMP) that activate when the primary channel fails\n- Confusing encrypted payload data with the protocol framing structure\n\n## Output Format\n\n```\nC2 COMMUNICATION ANALYSIS REPORT\n===================================\nSample:           malware.exe (SHA-256: e3b0c44...)\nC2 Framework:     Cobalt Strike 4.9\n\nBEACON CONFIGURATION\nC2 Server:        hxxps:\u002F\u002F185.220.101[.]42\u002Fupdates\nBeacon Type:      HTTPS (reverse)\nSleep:            60 seconds\nJitter:           15%\nUser-Agent:       Mozilla\u002F5.0 (Windows NT 10.0; Win64; x64)\nURI (GET):        \u002Fdpixel\nURI (POST):       \u002Fsubmit.php\nWatermark:        1234567890\n\nPROTOCOL ANALYSIS\nTransport:        HTTPS (TLS 1.2)\nJA3 Hash:         a0e9f5d64349fb13191bc781f81f42e1\nCertificate:      CN=Microsoft Update (self-signed)\nEncoding:         Base64 with XOR key 0x69\nCommand Format:   [4B length][4B command_id][payload]\n\nCOMMAND SET\n0x01 - Sleep          Change beacon interval\n0x02 - Shell          Execute cmd.exe command\n0x03 - Download       Transfer file from C2\n0x04 - Upload         Exfiltrate file to C2\n0x05 - Inject         Process injection\n0x06 - Keylog         Start keylogger\n0x07 - Screenshot     Capture screen\n\nINFRASTRUCTURE\nPrimary:          185.220.101[.]42 (AS12345, Hosting Co, NL)\nFailover:         91.215.85[.]17 (AS67890, VPS Provider, RU)\nDNS:              update.malicious[.]com -> 185.220.101[.]42\nRegistrar:        NameCheap\nRegistration:     2025-09-01\n\nDETECTION SIGNATURES\nSID 9000010:      HTTP beacon pattern\nSID 9000011:      JA3 TLS fingerprint\nSID 9000013:      C2 certificate match\n```\n","# Analyzing Command-and-Control Communication\n\n## When to Use\n\n- Reverse engineering a malware sample has revealed network communication that needs protocol analysis\n- Building network-level detection signatures for a specific C2 framework (Cobalt Strike, Metasploit, Sliver)\n- Mapping C2 infrastructure including primary servers, fallback domains, and dead drops\n- Analyzing encrypted or encoded C2 traffic to understand the command set and data format\n- Attributing malware to a threat actor based on C2 infrastructure patterns and tooling\n\n**Do not use** for general network anomaly detection; this is specifically for understanding known or suspected C2 protocols from malware analysis.\n\n## Prerequisites\n\n- PCAP capture of malware network traffic (from sandbox, network tap, or full packet capture)\n- Wireshark\u002Ftshark for packet-level analysis\n- Reverse engineering tools (Ghidra, dnSpy) for understanding C2 code in the malware binary\n- Python 3.8+ with `scapy`, `dpkt`, and `requests` for protocol analysis and replay\n- Threat intelligence databases for C2 infrastructure correlation (VirusTotal, Shodan, Censys)\n- JA3\u002FJA3S fingerprint databases for TLS-based C2 identification\n\n## Workflow\n\n### Step 1: Identify the C2 Channel\n\nDetermine the protocol and transport used for C2 communication:\n\n```\nC2 Communication Channels:\n━━━━━━━━━━━━━━━━━━━━━━━━━\nHTTP\u002FHTTPS:     Most common; uses standard web traffic to blend in\n                Indicators: Regular POST\u002FGET requests, specific URI patterns, custom headers\n\nDNS:            Tunneling data through DNS queries and responses\n                Indicators: High-volume TXT queries, long subdomain names, high entropy\n\nCustom TCP\u002FUDP: Proprietary binary protocol on non-standard port\n                Indicators: Non-HTTP traffic on high ports, unknown protocol\n\nICMP:           Data encoded in ICMP echo\u002Freply payloads\n                Indicators: ICMP packets with large or non-standard payloads\n\nWebSocket:      Persistent bidirectional connection for real-time C2\n                Indicators: WebSocket upgrade followed by binary frames\n\nCloud Services: Using legitimate APIs (Telegram, Discord, Slack, GitHub)\n                Indicators: API calls to cloud services from unexpected processes\n\nEmail:          SMTP\u002FIMAP for C2 commands and data exfiltration\n                Indicators: Automated email operations from non-email processes\n```\n\n### Step 2: Analyze Beacon Pattern\n\nCharacterize the periodic communication pattern:\n\n```python\nfrom scapy.all import rdpcap, IP, TCP\nfrom collections import defaultdict\nimport statistics\nimport json\n\npackets = rdpcap(\"c2_traffic.pcap\")\n\n# Group TCP SYN packets by destination\nconnections = defaultdict(list)\nfor pkt in packets:\n    if IP in pkt and TCP in pkt and (pkt[TCP].flags & 0x02):\n        key = f\"{pkt[IP].dst}:{pkt[TCP].dport}\"\n        connections[key].append(float(pkt.time))\n\n# Analyze each destination for beaconing\nfor dst, times in sorted(connections.items()):\n    if len(times) \u003C 3:\n        continue\n\n    intervals = [times[i+1] - times[i] for i in range(len(times)-1)]\n    avg_interval = statistics.mean(intervals)\n    stdev = statistics.stdev(intervals) if len(intervals) > 1 else 0\n    jitter_pct = (stdev \u002F avg_interval * 100) if avg_interval > 0 else 0\n    duration = times[-1] - times[0]\n\n    beacon_data = {\n        \"destination\": dst,\n        \"connections\": len(times),\n        \"duration_seconds\": round(duration, 1),\n        \"avg_interval_seconds\": round(avg_interval, 1),\n        \"stdev_seconds\": round(stdev, 1),\n        \"jitter_percent\": round(jitter_pct, 1),\n        \"is_beacon\": 5 \u003C avg_interval \u003C 7200 and jitter_pct \u003C 25,\n    }\n\n    if beacon_data[\"is_beacon\"]:\n        print(f\"[!] BEACON DETECTED: {dst}\")\n        print(f\"    Interval: {avg_interval:.0f}s +\u002F- {stdev:.0f}s ({jitter_pct:.0f}% jitter)\")\n        print(f\"    Sessions: {len(times)} over {duration:.0f}s\")\n```\n\n### Step 3: Decode C2 Protocol Structure\n\nReverse engineer the message format from captured traffic:\n\n```python\n# HTTP-based C2 protocol analysis\nimport dpkt\nimport base64\n\nwith open(\"c2_traffic.pcap\", \"rb\") as f:\n    pcap = dpkt.pcap.Reader(f)\n\nfor ts, buf in pcap:\n    eth = dpkt.ethernet.Ethernet(buf)\n    if not isinstance(eth.data, dpkt.ip.IP):\n        continue\n    ip = eth.data\n    if not isinstance(ip.data, dpkt.tcp.TCP):\n        continue\n    tcp = ip.data\n\n    if tcp.dport == 80 or tcp.dport == 443:\n        if len(tcp.data) > 0:\n            try:\n                http = dpkt.http.Request(tcp.data)\n                print(f\"\\n--- C2 REQUEST ---\")\n                print(f\"Method: {http.method}\")\n                print(f\"URI: {http.uri}\")\n                print(f\"Headers: {dict(http.headers)}\")\n                if http.body:\n                    print(f\"Body ({len(http.body)} bytes):\")\n                    # Try Base64 decode\n                    try:\n                        decoded = base64.b64decode(http.body)\n                        print(f\"  Decoded: {decoded[:200]}\")\n                    except:\n                        print(f\"  Raw: {http.body[:200]}\")\n            except:\n                pass\n```\n\n### Step 4: Identify C2 Framework\n\nMatch observed patterns to known C2 frameworks:\n\n```\nKnown C2 Framework Signatures:\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━\nCobalt Strike:\n  - Default URIs: \u002Fpixel, \u002Fsubmit.php, \u002F___utm.gif, \u002Fca, \u002Fdpixel\n  - Malleable C2 profiles customize all traffic characteristics\n  - JA3: varies by profile, catalog at ja3er.com\n  - Watermark in beacon config (unique per license)\n  - Config extraction: use CobaltStrikeParser or 1768.py\n\nMetasploit\u002FMeterpreter:\n  - Default staging URI patterns: random 4-char checksum\n  - Reverse HTTP(S) handler patterns\n  - Meterpreter TLV (Type-Length-Value) protocol structure\n\nSliver:\n  - mTLS, HTTP, DNS, WireGuard transport options\n  - Protobuf-encoded messages\n  - Unique implant ID in communication\n\nCovenant:\n  - .NET-based C2 framework\n  - HTTP with customizable profiles\n  - Task-based command execution\n\nPoshC2:\n  - PowerShell\u002FC# based\n  - HTTP with encrypted payloads\n  - Cookie-based session management\n```\n\n```bash\n# Extract Cobalt Strike beacon configuration from PCAP or sample\npython3 \u003C\u003C 'PYEOF'\n# Using CobaltStrikeParser (pip install cobalt-strike-parser)\nfrom cobalt_strike_parser import BeaconConfig\n\ntry:\n    config = BeaconConfig.from_file(\"suspect.exe\")\n    print(\"Cobalt Strike Beacon Configuration:\")\n    for key, value in config.items():\n        print(f\"  {key}: {value}\")\nexcept Exception as e:\n    print(f\"Not a Cobalt Strike beacon or parse error: {e}\")\nPYEOF\n```\n\n### Step 5: Map C2 Infrastructure\n\nDocument the full C2 infrastructure and failover mechanisms:\n\n```python\n# Infrastructure mapping\nimport requests\nimport json\n\nc2_indicators = {\n    \"primary_c2\": \"185.220.101.42\",\n    \"domains\": [\"update.malicious.com\", \"backup.evil.net\"],\n    \"ports\": [443, 8443],\n    \"failover_dns\": [\"ns1.malicious-dns.com\"],\n}\n\n# Enrich with Shodan\ndef shodan_lookup(ip, api_key):\n    resp = requests.get(f\"https:\u002F\u002Fapi.shodan.io\u002Fshodan\u002Fhost\u002F{ip}?key={api_key}\")\n    if resp.status_code == 200:\n        data = resp.json()\n        return {\n            \"ip\": ip,\n            \"ports\": data.get(\"ports\", []),\n            \"os\": data.get(\"os\"),\n            \"org\": data.get(\"org\"),\n            \"asn\": data.get(\"asn\"),\n            \"country\": data.get(\"country_code\"),\n            \"hostnames\": data.get(\"hostnames\", []),\n            \"last_update\": data.get(\"last_update\"),\n        }\n    return None\n\n# Enrich with passive DNS\ndef pdns_lookup(domain):\n    # Using VirusTotal passive DNS\n    resp = requests.get(\n        f\"https:\u002F\u002Fwww.virustotal.com\u002Fapi\u002Fv3\u002Fdomains\u002F{domain}\u002Fresolutions\",\n        headers={\"x-apikey\": VT_API_KEY}\n    )\n    if resp.status_code == 200:\n        data = resp.json()\n        resolutions = []\n        for r in data.get(\"data\", []):\n            resolutions.append({\n                \"ip\": r[\"attributes\"][\"ip_address\"],\n                \"date\": r[\"attributes\"][\"date\"],\n            })\n        return resolutions\n    return []\n```\n\n### Step 6: Create Network Detection Signatures\n\nBuild detection rules based on analyzed C2 characteristics:\n\n```bash\n# Suricata rules for the analyzed C2\ncat \u003C\u003C 'EOF' > c2_detection.rules\n# HTTP beacon pattern\nalert http $HOME_NET any -> $EXTERNAL_NET any (\n    msg:\"MALWARE MalwareX C2 HTTP Beacon\";\n    flow:established,to_server;\n    http.method; content:\"POST\";\n    http.uri; content:\"\u002Fgate.php\"; startswith;\n    http.header; content:\"User-Agent: Mozilla\u002F5.0 (compatible; MSIE 10.0)\";\n    threshold:type threshold, track by_src, count 5, seconds 600;\n    sid:9000010; rev:1;\n)\n\n# JA3 fingerprint match\nalert tls $HOME_NET any -> $EXTERNAL_NET any (\n    msg:\"MALWARE MalwareX TLS JA3 Fingerprint\";\n    ja3.hash; content:\"a0e9f5d64349fb13191bc781f81f42e1\";\n    sid:9000011; rev:1;\n)\n\n# DNS beacon detection (high-entropy subdomain)\nalert dns $HOME_NET any -> any any (\n    msg:\"MALWARE Suspected DNS C2 Tunneling\";\n    dns.query; pcre:\"\u002F^[a-z0-9]{20,}\\.\u002F\";\n    threshold:type threshold, track by_src, count 10, seconds 60;\n    sid:9000012; rev:1;\n)\n\n# Certificate-based detection\nalert tls $HOME_NET any -> $EXTERNAL_NET any (\n    msg:\"MALWARE MalwareX Self-Signed C2 Certificate\";\n    tls.cert_subject; content:\"CN=update.malicious.com\";\n    sid:9000013; rev:1;\n)\nEOF\n```\n\n## Key Concepts\n\n| Term | Definition |\n|------|------------|\n| **Beaconing** | Periodic check-in communication from malware to C2 server at regular intervals, often with jitter to avoid pattern detection |\n| **Jitter** | Randomization applied to beacon interval (e.g., 60s +\u002F- 15%) to make the timing pattern less predictable and harder to detect |\n| **Malleable C2** | Cobalt Strike feature allowing operators to customize all aspects of C2 traffic (URIs, headers, encoding) to mimic legitimate services |\n| **Dead Drop** | Intermediate location (paste site, cloud storage, social media) where C2 commands are posted for the malware to retrieve |\n| **Domain Fronting** | Using a trusted CDN domain in the TLS SNI while routing to a different backend, making C2 traffic appear to go to a legitimate service |\n| **Fast Flux** | Rapidly changing DNS records for C2 domains to distribute across many IPs and resist takedown efforts |\n| **C2 Framework** | Software toolkit providing C2 server, implant generator, and operator interface (Cobalt Strike, Metasploit, Sliver, Covenant) |\n\n## Tools & Systems\n\n- **Wireshark**: Packet analyzer for detailed C2 protocol analysis at the packet level\n- **RITA (Real Intelligence Threat Analytics)**: Open-source tool analyzing Zeek logs for beacon detection and DNS tunneling\n- **CobaltStrikeParser**: Tool extracting Cobalt Strike beacon configuration from samples and memory dumps\n- **JA3\u002FJA3S**: TLS fingerprinting method for identifying C2 frameworks by their TLS implementation characteristics\n- **Shodan\u002FCensys**: Internet scanning platforms for mapping C2 infrastructure and identifying related servers\n\n## Common Scenarios\n\n### Scenario: Reverse Engineering a Custom C2 Protocol\n\n**Context**: A malware sample communicates with its C2 server using an unknown binary protocol over TCP port 8443. The protocol needs to be decoded to understand the command set and build detection signatures.\n\n**Approach**:\n1. Filter PCAP for TCP port 8443 conversations and extract the TCP streams\n2. Analyze the first few exchanges to identify the handshake\u002Fauthentication mechanism\n3. Map the message structure (length prefix, type field, payload encoding)\n4. Cross-reference with Ghidra disassembly of the send\u002Freceive functions in the malware\n5. Identify the command dispatcher and document each command code's function\n6. Build a protocol decoder in Python for ongoing traffic analysis\n7. Create Suricata rules matching the protocol handshake or static header bytes\n\n**Pitfalls**:\n- Assuming the protocol is static; some C2 frameworks negotiate encryption during the handshake\n- Not capturing enough traffic to see all command types (some commands are rare)\n- Missing fallback C2 channels (DNS, ICMP) that activate when the primary channel fails\n- Confusing encrypted payload data with the protocol framing structure\n\n## Output Format\n\n```\nC2 COMMUNICATION ANALYSIS REPORT\n===================================\nSample:           malware.exe (SHA-256: e3b0c44...)\nC2 Framework:     Cobalt Strike 4.9\n\nBEACON CONFIGURATION\nC2 Server:        hxxps:\u002F\u002F185.220.101[.]42\u002Fupdates\nBeacon Type:      HTTPS (reverse)\nSleep:            60 seconds\nJitter:           15%\nUser-Agent:       Mozilla\u002F5.0 (Windows NT 10.0; Win64; x64)\nURI (GET):        \u002Fdpixel\nURI (POST):       \u002Fsubmit.php\nWatermark:        1234567890\n\nPROTOCOL ANALYSIS\nTransport:        HTTPS (TLS 1.2)\nJA3 Hash:         a0e9f5d64349fb13191bc781f81f42e1\nCertificate:      CN=Microsoft Update (self-signed)\nEncoding:         Base64 with XOR key 0x69\nCommand Format:   [4B length][4B command_id][payload]\n\nCOMMAND SET\n0x01 - Sleep          Change beacon interval\n0x02 - Shell          Execute cmd.exe command\n0x03 - Download       Transfer file from C2\n0x04 - Upload         Exfiltrate file to C2\n0x05 - Inject         Process injection\n0x06 - Keylog         Start keylogger\n0x07 - Screenshot     Capture screen\n\nINFRASTRUCTURE\nPrimary:          185.220.101[.]42 (AS12345, Hosting Co, NL)\nFailover:         91.215.85[.]17 (AS67890, VPS Provider, RU)\nDNS:              update.malicious[.]com -> 185.220.101[.]42\nRegistrar:        NameCheap\nRegistration:     2025-09-01\n\nDETECTION SIGNATURES\nSID 9000010:      HTTP beacon pattern\nSID 9000011:      JA3 TLS fingerprint\nSID 9000013:      C2 certificate match\n```\n",{"name":5,"tags":24,"author":30,"domain":31,"license":14,"version":32,"nist_csf":33,"subdomain":38,"description":39,"mitre_attack":40},[25,26,27,28,29],"malware","C2","command-and-control","beacon","protocol-analysis","mahipal","cybersecurity","1.0.0",[34,35,36,37],"DE.AE-02","RS.AN-03","ID.RA-01","DE.CM-01","malware-analysis","Analyzes malware C2 communication over HTTP, HTTPS, DNS, and custom protocols to reverse-engineer beacon patterns, command structures, data encoding, and infrastructure (primary servers, fallback domains, dead drops). Use after reverse engineering reveals network traffic needing protocol analysis or when building detection signatures for a framework like Cobalt Strike, Metasploit, or Sliver.\n",[41,42,43,44,45],"T1071.001","T1573","T1571","T1008","T1095","main","1eb986d0b0ecc180291597e08eb5a58288843536","skills\u002Fcurated_premium_skills\u002FAnthropic-Cybersecurity-Skills\u002Fskills\u002Fanalyzing-command-and-control-communication","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv","2026-08-25 13:16:33",{"source":8,"skillName":5,"commands":53,"prompt":63,"zipAvailable":64},[54,57,60],{"tool":55,"command":56},"npx","npx skills add vikasvardhanv\u002Fjerry_skills --skill analyzing-command-and-control-communication",{"tool":58,"command":59},"bunx","bunx skills add vikasvardhanv\u002Fjerry_skills --skill analyzing-command-and-control-communication",{"tool":61,"command":62},"pnpm","pnpm dlx skills add vikasvardhanv\u002Fjerry_skills --skill analyzing-command-and-control-communication","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fcurated_premium_skills\u002FAnthropic-Cybersecurity-Skills\u002Fskills\u002Fanalyzing-command-and-control-communication\u002FSKILL.md",true,[66,70,76],{"path":67,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":69,"sourceHtmlUrl":15},"LICENSE","许可证",11255,{"path":71,"resourceType":72,"resourceTypeDesc":73,"sizeBytes":74,"sourceHtmlUrl":75},"references\u002Fapi-reference.md","REFERENCE","参考文档",2756,"https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fcurated_premium_skills\u002FAnthropic-Cybersecurity-Skills\u002Fskills\u002Fanalyzing-command-and-control-communication\u002Freferences\u002Fapi-reference.md",{"path":77,"resourceType":78,"resourceTypeDesc":79,"sizeBytes":80,"sourceHtmlUrl":81},"scripts\u002Fagent.py","SCRIPT","脚本",7849,"https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fcurated_premium_skills\u002FAnthropic-Cybersecurity-Skills\u002Fskills\u002Fanalyzing-command-and-control-communication\u002Fscripts\u002Fagent.py",[83,91,98,105,112,119],{"skillNo":84,"name":85,"nameZh":6,"description":86,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":87,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"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":92,"name":93,"nameZh":6,"description":94,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":87,"licenseFileUrl":6,"sourceHtmlUrl":95,"categories":96,"keywords":97,"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":99,"name":100,"nameZh":6,"description":101,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":87,"licenseFileUrl":6,"sourceHtmlUrl":102,"categories":103,"keywords":104,"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":106,"name":107,"nameZh":6,"description":108,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":87,"licenseFileUrl":6,"sourceHtmlUrl":109,"categories":110,"keywords":111,"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":113,"name":114,"nameZh":6,"description":115,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":87,"licenseFileUrl":6,"sourceHtmlUrl":116,"categories":117,"keywords":118,"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":120,"name":121,"nameZh":6,"description":122,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":87,"licenseFileUrl":6,"sourceHtmlUrl":123,"categories":124,"keywords":125,"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",[],[]]