PISA Pakistan — Community CERT

← ⚙️ SOC Analyst Foundations

36. Cryptomining and Cryptojacking Detection: Hunting Unauthorized Crypto Activity on Pakistani Networks

⏱ 9 min

Crypto‑Mining in Pakistani Networks: Why SOCs Must Care

Cryptocurrency mining consumes huge CPU/GPU resources, drives up electricity costs, and can be a vector for malware persistence. Recent WhatsApp forwards promising “free mining software” have led to employee machines being compromised. SOC analysts need to proactively hunt for mining traffic.

Network‑Based Indicators (NBI) for Mining Traffic

  • Known mining pool domains: stratum+tcp://pool.mining.com, stratum+tcp://asia.nanopool.org.
  • High‑volume outbound TCP connections to ports 3333, 4444, 5555 (common pool ports).
  • DNS queries for known mining‑related domains (blockchain.info, coinhive.com, cryptonight.rig).
  • Unusually high DNS TXT queries for Monero’s public keys.

Endpoint Indicators & EDR Telemetry

  • Process creation events (Sysmon Event ID 1) with image names like xmrig.exe, minerd, cgminer.
  • File‑less scripting using powershell -enc to download mining payloads.
  • High CPU usage (>80% on multiple cores) correlated with a mining‑related process.

Sigma Rules & YARA for Mining Scripts

  1. Sigma rule for DNS queries to coinhive.com:
    title: CoinHive DNS Query
    logsource: product dns
    detection:
      dns_query: '*coinhive*'
    condition: dns_query
    
  2. YARA rule to scan for xmrig configuration files:
    rule xmrig_config {
      strings: $ = "wallet_address" ascii
      condition: $ and filesize < 2KB
    }
    

Real‑World Pakistani Scenario

A university network in Lahore reported a 30% spike in electricity consumption. The SOC ran a Zeek DNS log query for mining pool domains and discovered multiple devices querying stratum+tcp://pool.supportxmr.com. EDR logs identified xmrig.exe launched by a student via a pirated software installer. The incident was reported to NCCIA 1799, and the affected machines were isolated.

Do / Don't

  • Do block known mining pool domains at the DNS level (use Pi‑hole or corporate resolver).
  • Don't rely solely on CPU thresholds—use process‑name and network‑signature correlation.
  • Do share mining IOCs with the PTA for nation‑wide threat intel.
  • Don't ignore pirated software—enforce a policy against unapproved software installations.

Takeaway: Deploy the provided Sigma rule for CoinHive DNS queries and run a YARA scan on your file servers today to detect existing mining binaries.

← PrevNext →