मुख्य सामग्री पर जाएँ
Skillpedia
सिक्योरिटी35k · #7607

analyzing-command-and-control-communication

यह क्या करती है

यह टूल समझने में मदद करता है कि कोई दुर्भावनापूर्ण प्रोग्राम (malware) अपने कंट्रोल सर्वर से कैसे बात करता है। यह नेटवर्क ट्रैफ़िक का विश्लेषण करके पैटर्न, कमांड और जानकारी भेजने के तरीके का पता लगाता है।

कब इस्तेमाल करें

  • ✓जब कोई संदिग्ध प्रोग्राम मिले और आप देखना चाहें कि वह इंटरनेट पर कैसे 'बात' करता है।
  • ✓उस खास malware को पहचानने के लिए बचाव के उपाय बनाते समय।
  • ✓malware के पूरे कंट्रोल नेटवर्क का नक्शा बनाने के लिए।

Skill का लिंक

https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/analyzing-command-and-control-communication/SKILL.md

इसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।

कैसे इस्तेमाल करें

सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।

पेस्ट करने के लिए तैयार मैसेज

इस skill से मेरी मदद करो: https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/analyzing-command-and-control-communication/SKILL.md इस लिंक की SKILL.md फ़ाइल पढ़ो और मेरे काम में उसके निर्देशों का पालन करो।
क्या आप चाहते हैं कि आपका AI ऐसी skills खुद ढूँढे?मुफ़्त Skillpedia MCP इंस्टॉल करें: बस एक लाइन, और हर काम से पहले यह 15,000+ skills में खोजता है।1 मिनट में इंस्टॉल करें →

AI से क्या माँगें: उदाहरण

“इस नेटवर्क ट्रैफ़िक का विश्लेषण करो और पता लगाओ कि malware कैसे संचार कर रहा है।”

हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।

यह कैसे काम करती है

टूल वह डेटा देखता है जो दुर्भावनापूर्ण प्रोग्राम नेटवर्क पर भेजता और प्राप्त करता है। यह बार-बार दोहराए जाने वाले पैटर्न ढूंढता है और कमांड भेजने व जानकारी लेने में इस्तेमाल होने वाली 'भाषा' समझने की कोशिश करता है।

तकनीकी सामग्री (मूल SKILL.md)

लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।

Analyzing Command-and-Control Communication

When to Use

  • Reverse engineering a malware sample has revealed network communication that needs protocol analysis
  • Building network-level detection signatures for a specific C2 framework (Cobalt Strike, Metasploit, Sliver)
  • Mapping C2 infrastructure including primary servers, fallback domains, and dead drops
  • Analyzing encrypted or encoded C2 traffic to understand the command set and data format
  • Attributing malware to a threat actor based on C2 infrastructure patterns and tooling

Do not use for general network anomaly detection; this is specifically for understanding known or suspected C2 protocols from malware analysis.

Prerequisites

  • PCAP capture of malware network traffic (from sandbox, network tap, or full packet capture)
  • Wireshark/tshark for packet-level analysis
  • Reverse engineering tools (Ghidra, dnSpy) for understanding C2 code in the malware binary
  • Python 3.8+ with scapy, dpkt, and requests for protocol analysis and replay
  • Threat intelligence databases for C2 infrastructure correlation (VirusTotal, Shodan, Censys)
  • JA3/JA3S fingerprint databases for TLS-based C2 identification

Workflow

Step 1: Identify the C2 Channel

Determine the protocol and transport used for C2 communication:

C2 Communication Channels:
━━━━━━━━━━━━━━━━━━━━━━━━━
HTTP/HTTPS:     Most common; uses standard web traffic to blend in
                Indicators: Regular POST/GET requests, specific URI patterns, custom headers

DNS:            Tunneling data through DNS queries and responses
                Indicators: High-volume TXT queries, long subdomain names, high entropy

Custom TCP/UDP: Proprietary binary protocol on non-standard port
                Indicators: Non-HTTP traffic on high ports, unknown protocol

ICMP:           Data encoded in ICMP echo/reply payloads
                Indicators: ICMP packets with large or non-standard payloads

WebSocket:      Persistent bidirectional connection for real-time C2
                Indicators: WebSocket upgrade followed by binary frames

Cloud Services: Using legitimate APIs (Telegram, Discord, Slack, GitHub)
                Indicators: API calls to cloud services from unexpected processes

Email:          SMTP/IMAP for C2 commands and data exfiltration
                Indicators: Automated email operations from non-email processes

Step 2: Analyze Beacon Pattern

Characterize the periodic communication pattern:

from scapy.all import rdpcap, IP, TCP
from collections import defaultdict
import statistics
import json

packets = rdpcap("c2_traffic.pcap")

# Group TCP SYN packets by destination
connections = defaultdict(list)
for pkt in packets:
    if IP in pkt and TCP in pkt and (pkt[TCP].flags & 0x02):
        key = f"{pkt[IP].dst}:{pkt[TCP].dport}"
        connections[key].append(float(pkt.time))

# Analyze each destination for beaconing
for dst, times in sorted(connections.items()):
    if len(times) < 3:
        continue

    intervals = [times[i+1] - times[i] for i in range(len(times)-1)]
    avg_interval = statistics.mean(intervals)
    stdev = statistics.stdev(intervals) if len(intervals) > 1 else 0
    jitter_pct = (stdev / avg_interval * 100) if avg_interval > 0 else 0
    duration = times[-1] - times[0]

    beacon_data = {
        "destination": dst,
        "connections": len(times),
        "duration_seconds": round(duration, 1),
        "avg_interval_seconds": round(avg_interval, 1),
        "stdev_seconds": round(stdev, 1),
        "jitter_percent": round(jitter_pct, 1),
        "is_beacon": 5 < avg_interval < 7200 and jitter_pct < 25,
    }

    if beacon_data["is_beacon"]:
        print(f"[!] BEACON DETECTED: {dst}")
        print(f"    Interval: {avg_interval:.0f}s +/- {stdev:.0f}s ({jitter_pct:.0f}% jitter)")
        print(f"    Sessions: {len(times)} over {duration:.0f}s")

Step 3: Decode C2 Protocol Structure

Reverse engineer the message format from captured traffic:

# HTTP-based C2 protocol analysis
import dpkt
import base64

with open("c2_traffic.pcap", "rb") as f:
    pcap = dpkt.pcap.Reader(f)

for ts, buf in pcap:
    eth = dpkt.ethernet.Ethernet(buf)
    if not isinstance(eth.data, dpkt.ip.IP):
        continue
    ip = eth.data
    if not isinstance(ip.data, dpkt.tcp.TCP):
        continue
    tcp = ip.data

    if tcp.dport == 80 or tcp.dport == 443:
        if len(tcp.data) > 0:
            try:

…
अक्सर पूछे जाने वाले सवाल

'C2' क्या है?

C2 का मतलब है 'Command and Control'। यह वह तरीका है जिससे कोई दुर्भावनापूर्ण प्रोग्राम उस हमलावर से बात करता है जो उसे कंट्रोल कर रहा है।

क्या इसे इस्तेमाल करने के लिए प्रोग्रामर होना ज़रूरी है?

आपको किसी अनुभवी प्रोग्रामर की ज़रूरत नहीं है। यह टूल इसलिए बनाया गया है ताकि आप कोड लिखे बिना भी संचार को समझ सकें।

'beacon pattern' क्या है?

यह इस बात का पैटर्न है कि malware कब और कितनी बार अपने कंट्रोल सर्वर से संपर्क करता है। यह एक नियमित संकेत की तरह होता है जो वह लगातार भेजता रहता है।

जानकारी

लेखक का मूल विवरण

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. '

repo: mukul975/Anthropic-Cybersecurity-Skills

लोकप्रियता

GitHub स्टार
35k
रैंकिंग में स्थान
#7607
लाइसेंस
Apache-2.0
अपडेट की गई
31/8/2026

क्या यह skill काम की है?

0

लॉग इन करें वोट करने के लिए।

कमेंट

  • …

इस repository की और skills

मिलती-जुलती skills