T1573.002

Asymmetric Cryptography

Adversaries may employ asymmetric encryption algorithms such as RSA, ECDH, or Diffie-Hellman to conceal command and control (C2) traffic. Asymmetric cryptography uses a keypair: a public key for encryption and a private key for decryption, ensuring only the intended recipient can read the data. In practice, most C2 frameworks (Cobalt Strike, Sliver, Havoc, AsyncRAT, Metasploit) use TLS for all communications, leveraging asymmetric cryptography for key exchange before switching to symmetric encryption for the bulk session data. Real-world malware families using this technique include SombRAT (SSL-encrypted C2), LunarWeb (RSA-4096 encrypted commands), SodaMaster (hardcoded RSA key for C2 traffic), ComRAT (RSA+AES for Gmail C2 channel), and Cyclops Blink (OpenSSL RSA public key encrypting per-message keys under TLS). Detection must focus on behavioral indicators: LOLBin processes initiating TLS connections, self-signed or anomalous certificate attributes, TLS on non-standard ports, regular beaconing intervals from non-browser processes, and use of cryptographic tools (openssl, certutil, .NET RSA APIs) in unexpected contexts.

Microsoft Sentinel / Defender
kusto
// T1573.002 — Asymmetric Cryptography C2 Detection
// Approach 1: LOLBin / scripting engine processes making outbound TLS/encrypted connections
let SuspiciousInitiators = dynamic([
  "cmd.exe", "powershell.exe", "pwsh.exe", "wscript.exe", "cscript.exe",
  "mshta.exe", "regsvr32.exe", "rundll32.exe", "msbuild.exe", "csc.exe",
  "installutil.exe", "regasm.exe", "wmic.exe", "bitsadmin.exe", "certutil.exe"
]);
let KnownTLSPorts = dynamic([443, 8443, 4443, 8080, 8888, 8081, 9443, 2083, 2087, 2096]);
let SuspiciousNetworkC2 = DeviceNetworkEvents
| where Timestamp > ago(24h)
| where ActionType == "ConnectionSuccess"
| where RemoteIPType == "Public"
| where InitiatingProcessFileName in~ (SuspiciousInitiators)
| extend IsTLSPort = RemotePort in (KnownTLSPorts)
| extend IsHighNonStandardPort = RemotePort > 1024 and RemotePort !in (KnownTLSPorts)
| project Timestamp, DeviceName, AccountName,
          InitiatingProcessFileName, InitiatingProcessCommandLine,
          RemoteIP, RemotePort, RemoteUrl,
          IsTLSPort, IsHighNonStandardPort,
          DetectionSource = "NetworkC2";
// Approach 2: Cryptographic tool and API usage — key generation, certificate operations
let CryptoToolUsage = DeviceProcessEvents
| where Timestamp > ago(24h)
| where FileName =~ "openssl.exe"
    or ProcessCommandLine has_any (
        "openssl genrsa", "openssl genpkey", "openssl req", "openssl s_client", "openssl s_server",
        "RSACryptoServiceProvider", "RSACng", "RSAParameters", "ECDiffieHellman",
        "New-SelfSignedCertificate", "makecert",
        "Export-PfxCertificate", "Import-PfxCertificate"
    )
    or (FileName =~ "certutil.exe" and ProcessCommandLine has_any ("-exportpfx", "-importpfx", "-MergePFX"))
| project Timestamp, DeviceName, AccountName,
          FileName, ProcessCommandLine,
          InitiatingProcessFileName, InitiatingProcessCommandLine,
          DetectionSource = "CryptoTool";
// Union both detections
SuspiciousNetworkC2
| union (CryptoToolUsage | extend RemoteIP="", RemotePort=0, RemoteUrl="", IsTLSPort=false, IsHighNonStandardPort=false)
| sort by Timestamp desc
medium severity medium confidence

Data Sources

Network Traffic: Network Connection Creation Process: Process Creation Command: Command Execution Microsoft Defender for Endpoint

Required Tables

DeviceNetworkEvents DeviceProcessEvents

False Positives

  • Legitimate PowerShell automation scripts (SCCM, Intune, Ansible WinRM) making HTTPS connections for patch management, configuration management, or telemetry reporting
  • Developer toolchains (npm, pip, cargo, dotnet restore) invoked from cmd.exe or PowerShell to fetch packages over TLS from public registries
  • PKI administrators or certificate automation scripts using openssl.exe, certutil.exe, or New-SelfSignedCertificate for legitimate certificate lifecycle management
  • Security scanning agents (Qualys, Tenable, Rapid7) and EDR components that spawn scripting processes making TLS connections to their management infrastructure
  • IT remote management tools (ConfigMgr, Puppet, Chef) executing PowerShell or cmd.exe with outbound HTTPS connections to management servers

Unlock Pro Content

Get the full detection package for T1573.002 including response playbook, investigation guide, and atomic red team tests.

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections