Response playbooks, investigation guides, and Atomic Red Team tests are Pro-only. Upgrade to unlock the full detection package for THREAT-Exfiltration-GPGAsymmetricArchiveExfil.

Upgrade to Pro
THREAT-Exfiltration-GPGAsymmetricArchiveExfil Elastic Security · Elastic

Detect Asymmetric Public-Key Encrypted Archive Exfiltration (GPG/OpenSSL/age) in Elastic Security

Rather than relying on a shared secret or a symmetric session key that could be recovered from memory forensics or a network capture, some adversaries and malicious insiders encrypt staged data with an attacker-controlled public key before it ever leaves the host. Tooling observed for this includes GPG/GPG2 invoked with `--recipient`/`-r` against a hardcoded or embedded public key (as opposed to `--symmetric`/`-c`, which uses a shared passphrase), `openssl smime -encrypt` against a recipient certificate, and the modern `age` utility invoked with `-r`/`--recipient` rather than `-p`/`--passphrase`. Because only the holder of the corresponding private key can ever decrypt the resulting `.gpg`/`.pgp`/`.p7m`/`.age` file, this defeats DLP content inspection and gives defenders no way to recover the plaintext even with full access to the transfer, unlike a password-protected archive whose passphrase might be brute-forced or recovered from the intruder's session. The encrypted archive is then moved off-host over a generic channel — a `curl`/`Invoke-WebRequest` upload to a file-sharing, paste, or webhook endpoint, or a drop into cloud storage — that is deliberately decoupled from any tasking/C2 channel already in use, so the exfiltration blends in with ordinary outbound HTTPS traffic. This pattern shows up both in insider IP theft (an employee quietly PGP-encrypting a document set to their personal key before uploading it) and in ransomware-affiliate double-extortion tooling that stages and asymmetrically encrypts a batch of high-value files immediately before the encryptor payload runs.

MITRE ATT&CK

Tactic
Exfiltration

Elastic Detection Query

Elastic Security (Elastic)
eql
sequence by host.name with maxspan=15m
  [process where event.type == "start" and
    process.name : ("gpg.exe", "gpg2.exe", "openssl.exe", "age.exe") and
    process.command_line : ("*--recipient*", "*-r *", "*smime*") and
    not process.command_line : ("*--symmetric*", "*--passphrase*", "*-c *")
  ]
  [file where event.type == "creation" and
    file.extension : ("gpg", "pgp", "asc", "p7m", "age")
  ]
  [network where event.type == "connection" and
    destination.port in (443, 80, 21) and
    network.direction == "outbound"
  ]
high severity medium confidence

Elastic EQL sequence detecting asymmetric public-key encryption of staged data followed by an off-host transfer: gpg/gpg2/openssl/age invoked with a recipient/public-key flag rather than a symmetric passphrase flag, followed within 15 minutes by creation of an encrypted output file and then an outbound network connection on an HTTP(S)/FTP port from the same host. Maps to MITRE T1048.002.

Data Sources

Elastic Endpoint SecurityElastic Agent (Endpoint Integration)Winlogbeat with Sysmon

Required Tables

logs-endpoint.events.process-*logs-endpoint.events.file-*logs-endpoint.events.network-*

False Positives & Tuning

  • Release engineering or CI/CD processes that gpg-encrypt build artifacts to a known partner public key on a recurring schedule — correlate with the process.executable path and known service account before alerting
  • Backup agents that gpg/openssl-encrypt export files before an outbound transfer to an approved offsite target — allowlist the known agent's process.executable path and destination.ip

Other platforms for THREAT-Exfiltration-GPGAsymmetricArchiveExfil


Testing Methodology

Validate this detection against 3 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are available with Pro.

  1. Test 1Simulate GPG Public-Key Encryption of Staged Files

    Expected signal: Sysmon Event ID 1 for gpg.exe launched with --recipient and --encrypt in the command line; Sysmon Event ID 11 for the resulting .gpg output files.

  2. Test 2Simulate Bulk Asymmetric Staging

    Expected signal: Sysmon Event ID 11 showing six .gpg files created by the same process within a 15-minute window.

  3. Test 3Simulate Post-Encryption Upload of an Asymmetrically-Encrypted Archive

    Expected signal: Sysmon Event ID 11 for the .gpg file creation followed within minutes by Sysmon Event ID 3 showing an outbound HTTPS connection to the test endpoint from powershell.exe.

Unlock playbooks & atomic tests with Pro

Get the full detection package for THREAT-Exfiltration-GPGAsymmetricArchiveExfil — response playbook and atomic red team tests, plus investigation guidance and hunting queries.

df00tech Pro — £29/user/month

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections

Detection Variants (1)

Different telemetry and tradecraft for the same technique — pick the one that matches the data you collect.