Detection
π‘οΈ Detection: How Malicious File Transfers Are Caught
While attackers aim to βlive off the land,β defenders aim to detect even the sneakiest moves β and that starts with knowing what to look for.
Even simple case changes (InVoKe-WeBReQueST
) can bypass basic blacklists, so defenders must get smarter with whitelisting, user agent inspection, and behavioral detection. π§¬
π§© Command-Line Monitoring
π Blacklisting:
β Fragile
β Easy to bypass with obfuscation
β Whitelisting:
β Robust and context-aware
β Detects unknown or abnormal behavior
π§ Best implemented with baselining
π User-Agent Strings: Silent Snitches
HTTP/HTTPS clients include a user-agent string that tells servers who they are. This can reveal:
π§ Tool usage (e.g., curl, PowerShell)
π§° Scripting frameworks (e.g., Python, WinHttp, Msxml2)
π Potential unauthorized activity
Organizations should:
Maintain a baseline of legitimate user agents
Create alerting rules for unknown or uncommon agents
Use SIEM or EDR to enrich HTTP logs with user-agent tagging
π Common Tool Detection Signatures
Hereβs how some popular tools appear to defenders π
π» PowerShell Web Cmdlets
Client
Server Log
π Easy to fingerprint via PowerShell version.
π WinHttpRequest COM Object
Client
Server Log
π Looks like IE 4.0 era β very suspicious today π©
π§± Msxml2.XMLHTTP COM Object
Client
Server Log
π Pretends to be old IE β not used by modern apps.
π§Ύ Certutil.exe
Client
Server Log
π Easy to detect, AMSI flags this now.
π¦ BITS Transfer
Client
Server Log
π Looks like a legit Windows Update or AV call β more stealthy π
β
Detection Tips for Blue Teams
Abnormal user-agent strings
Reveals use of tools like sqlmap
, curl
, PowerShell
, certutil
, etc.
New or rare command-line executions
Especially for tools like bitsadmin
, mshta
, wscript
File transfers to non-standard directories
Suspicious destinations like C:\Users\Public
Use of legacy COM objects
Ex: WinHttpRequest
, Msxml2
(usually attacker-generated)
Execution from temp folders or appdata
Common drop zones for payloads
π¬ Summary
β Create whitelists of expected binaries, arguments, and user-agents
π« Alert on blacklisted LOLBAS/GTFOBins and unusual HTTP headers
π§ Analyze behavioral patterns (downloads + process launch + persistence)
π Monitor continuously using SIEM, EDR, Sysmon, and NetFlow
Last updated