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

🧠 What to Watch
πŸ•΅οΈ Why It Matters

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