Exfiltration to Text Storage Sites
Adversaries may exfiltrate data to text storage sites such as pastebin.com, hastebin.com, paste.ee, ghostbin.co, or similar services instead of using their primary command and control channel. These sites are designed for sharing code and text snippets, often allowing anonymous or low-friction uploads with optional encryption and access controls. Threat actors leverage these services because traffic to them blends with normal developer activity, the sites are rarely blocked by firewalls, and paste content is ephemeral or access-controlled. Exfiltrated data may include credential dumps, configuration files, source code, reconnaissance output, or any collected sensitive data.
let PasteSites = dynamic([
"pastebin.com", "pastebin.pl", "pastebin.osuosl.org",
"hastebin.com", "toptal.com/developers/hastebin",
"ghostbin.co", "ghostbin.com",
"paste.ee", "paste2.org", "paste.ofcode.org",
"dpaste.org", "dpaste.com",
"sprunge.us", "ix.io",
"termbin.com",
"controlc.com",
"0bin.net",
"pastie.org",
"pasteio.com",
"rentry.co"
]);
let PasteAPIPaths = dynamic([
"/api/api_post.php",
"/documents",
"/api/v2/pastes",
"/api/pastes"
]);
// Signal 1: Network connections to known paste sites
let NetworkSignal =
DeviceNetworkEvents
| where Timestamp > ago(24h)
| where RemoteUrl has_any (PasteSites)
or RemoteIPType == "Public" and (RemoteUrl has "paste" or RemoteUrl has "hastebin")
| where RemotePort in (80, 443)
| project Timestamp, DeviceName, AccountName=InitiatingProcessAccountName,
ProcessName=InitiatingProcessFileName, CommandLine=InitiatingProcessCommandLine,
RemoteUrl, RemoteIP, RemotePort, BytesSent,
SignalType="NetworkConnection";
// Signal 2: Process command lines explicitly targeting paste sites
let ProcessSignal =
DeviceProcessEvents
| where Timestamp > ago(24h)
| where ProcessCommandLine has_any (PasteSites)
or ProcessCommandLine has_any ("pastebin", "hastebin", "ghostbin", "paste.ee", "termbin", "sprunge", "ix.io")
| where FileName in~ ("curl.exe", "curl", "wget.exe", "wget", "powershell.exe", "pwsh.exe",
"python.exe", "python3", "python", "python3.exe",
"nc.exe", "ncat.exe", "node.exe", "ruby.exe", "perl.exe")
| project Timestamp, DeviceName, AccountName, ProcessName=FileName,
CommandLine=ProcessCommandLine,
ParentProcess=InitiatingProcessFileName, ParentCommandLine=InitiatingProcessCommandLine,
SignalType="ProcessExecution";
// Union both signals
NetworkSignal
| union ProcessSignal
| extend IsCurl = ProcessName in~ ("curl.exe", "curl", "wget.exe", "wget")
| extend IsPowerShell = ProcessName in~ ("powershell.exe", "pwsh.exe")
| extend IsScript = ProcessName in~ ("python.exe", "python3", "python", "python3.exe", "ruby.exe", "perl.exe", "node.exe")
| extend HasPostData = CommandLine has_any ("-d ", "--data", "--data-binary", "--data-raw", "-F ",
"Invoke-RestMethod", "Invoke-WebRequest",
"UploadString", "UploadData",
"requests.post", ".post(", "urllib.request")
| extend HasAPIKey = CommandLine has_any ("api_dev_key", "api_user_key", "api_paste", "X-Auth-Token",
"Authorization:", "--header")
| extend LargeTransfer = BytesSent > 50000
| sort by Timestamp desc Data Sources
Required Tables
False Positives
- Developers legitimately sharing code snippets or debug output to pastebin/hastebin during normal work
- CI/CD pipelines or build scripts that publish logs or artifacts to paste sites for sharing build results
- Security researchers or incident responders sharing sanitized IOCs or analysis outputs via paste sites
- IT support staff using paste sites to share configuration examples or troubleshooting commands with users
- Automated testing tools that upload test results to hastebin or similar for review
References (9)
- https://attack.mitre.org/techniques/T1567/003/
- https://web.archive.org/web/20201107203304/https://www.echosec.net/blog/what-is-pastebin-and-why-do-hackers-love-it
- https://pastebin.com/doc/api
- https://hastebin.com/about.md
- https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1567.003/T1567.003.md
- https://thedfirreport.com/2021/01/18/all-that-for-a-coinminer/
- https://learn.microsoft.com/en-us/defender-endpoint/advanced-hunting-devicenetworkevents-table
- https://learn.microsoft.com/en-us/defender-endpoint/advanced-hunting-deviceprocessevents-table
- https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/CommonStatsFunctions
Unlock Pro Content
Get the full detection package for T1567.003 including response playbook, investigation guide, and atomic red team tests.