Did you know that 62% of all detected intrusions last year involved zero malware? Adversaries aren’t breaking in with custom tools anymore. They are walking through the front door and using the trusted software and utilities already installed on your systems. This is the reality of Living Off the Land attacks, and it’s why your signature-based antivirus and generic monitoring tools are failing. Attackers who master these techniques can persist inside a network for over 100 days before anyone notices. They look just like a system administrator doing their job, which makes spotting them a monumental challenge.
This isn’t about finding a malicious file. It’s about finding malicious intent. The key is to shift your focus from signatures to behaviors. You need to know what to look for, where to look, and how to build the queries that can separate a legitimate administrative task from a hands-on-keyboard adversary. This playbook is designed for practitioners on the front lines. We will cut through the theory and give you actionable strategies to start hunting for Living Off the Land attacks today.
The Attacker’s Toolkit: Your Own System Utilities
Attackers love using native tools because it makes their activity blend in with the noise of a normal corporate network. They don’t need to risk detection by downloading custom malware when a powerful scripting engine is already built into the operating system. Understanding the most commonly abused tools is the first step in building a defense.
For Windows Environments:
This is the primary playground for LotL techniques. The toolset is rich and powerful.
- PowerShell: The undisputed champion. It’s a full-featured automation and configuration management framework that gives an attacker immense power. They use it for everything from initial reconnaissance and lateral movement to fileless persistence and command and control (C2) communications. Simple commands like
Invoke-ExpressionandDownloadStringcan be used to execute payloads directly in memory, leaving no trace on the disk. - Windows Management Instrumentation (WMI): Think of WMI as a way to query and control almost any part of the Windows OS. Attackers abuse it to execute commands on remote systems, create persistent scheduled tasks, and gather system information without tripping traditional alerts. A WMI-based attack is stealthy and difficult to track in default log configurations.
- Bitsadmin: A command-line tool designed to create and manage file download and upload jobs. While it’s a legitimate utility, attackers use it to download their secondary tools from a C2 server. It’s often overlooked by security teams who are focused on PowerShell or other scripting engines.
For Linux and macOS Environments:
While Windows gets the most attention, LotL is platform-agnostic.
- Linux: Common tools like
bash,ssh,cron, andcurlare frequently abused. An attacker can use a simple bash script for lateral movement, set up a reverse shell withssh, schedule malicious tasks withcron, or download payloads withcurlorwget. These actions are so common that finding the malicious one requires careful behavioral analysis. - macOS: Adversaries often use
AppleScriptfor execution,LaunchAgentsorLaunchDaemonsfor persistence, and built-in Unix utilities inherited by macOS. The principles are the same: use what’s already there to avoid detection.
Building Your High-Fidelity Sensor Grid: Beyond Default Logs
The reason most organizations can’t see Living Off the Land attacks is a lack of visibility. Default logging configurations are not enough. You need detailed telemetry that captures command-line arguments, process parent-child relationships, and network connections. This is where a tool like Sysmon (System Monitor) becomes essential.
Sysmon is a free Microsoft tool that you install as a system service and driver. Once installed, it provides deep monitoring of system activity and writes detailed information to the Windows event log. To effectively hunt for LotL, you need to capture specific events.
Here are some critical Sysmon Event IDs to focus on:
- Event ID 1 (Process Creation): This is your bread and butter. It logs every process that starts on a system, including its full command line, hash, and parent process. This allows you to see a Word document spawning PowerShell, which is a massive red flag.
- Event ID 3 (Network Connection): Tracks all TCP/UDP connections made by every process. This helps you spot a legitimate tool like
powershell.exeorbitsadmin.execommunicating with a suspicious external IP address. - Event ID 12, 13, 14 (Registry Events): Attackers often use the registry for persistence. These events track object creation, deletion, and value modification, allowing you to spot suspicious autorun keys being created.
- Event ID 22 (DNS Query): Shows you what domains a process is trying to resolve. This can quickly reveal C2 communications from a trusted process.
In addition to Sysmon, make sure you have enabled PowerShell Script Block Logging (Event ID 4104). This logs the actual content of scripts as they are executed, even if they are obfuscated or run entirely in memory. It’s the only way to de-obfuscate and analyze what an attacker’s fileless payload is actually doing.
The Hunt Is On: Practical Queries to Unmask a Ghost
Once you have the right data flowing into your SIEM (like Splunk or an Elastic Stack), you can begin proactive threat hunting. A hunt starts with a hypothesis based on known attacker techniques (TTPs). Let’s walk through a few practical examples.
Hypothesis 1: An attacker is using PowerShell to download a payload from the internet.
-
Splunk Query:
index=sysmon EventCode=1 (process_name="powershell.exe" OR original_file_name="powershell.exe") (CommandLine="*DownloadString*" OR CommandLine="*DownloadFile*" OR CommandLine="*Invoke-Expression*" OR CommandLine="*IEX*") -
Elastic Query (KQL):
process.name:("powershell.exe" or "pwsh.exe") and process.command_line:(*DownloadString* or *DownloadFile* or *Invoke-Expression* or *iex*)
This query looks for the creation of a PowerShell process that includes common commands used for downloading and executing remote code. It’s a high-fidelity starting point for an investigation.
Hypothesis 2: An attacker is using WMI for remote code execution.
-
Splunk Query:
index=sysmon EventCode=1 ParentImage="*wmiprvse.exe" | stats count by Image, CommandLine -
Elastic Query (KQL):
process.parent.executable: "C:\Windows\System32\wbem\WmiPrvSE.exe" and not process.name:("wmiprvse.exe" or "unsecapp.exe")
Legitimate WMI activity has a specific process hierarchy. When an attacker uses WMI to run a command, it often spawns from the WmiPrvSE.exe service. This query hunts for unusual child processes of WMI, which could indicate lateral movement.
Hypothesis 3: An attacker is using Bitsadmin to download malicious tools.
-
Splunk Query:
index=sysmon EventCode=1 process_name="bitsadmin.exe" CommandLine="*transfer*" -
Elastic Query (KQL):
process.name:"bitsadmin.exe" and process.command_line:*transfer*
This simple query looks for the use of bitsadmin to create a download job. In many environments, this tool is rarely used for legitimate purposes, making any hits worth investigating.
Automating the First Response: Building Smart SOAR Playbooks
Chasing every suspicious PowerShell command will lead to alert fatigue. This is where Security Orchestration, Automation, and Response (SOAR) can be a force multiplier. By building playbooks, you can automate the initial, repetitive steps of an investigation, freeing up your analysts to focus on the truly critical threats.
A simple SOAR playbook for a suspected LotL attack might look like this:
- Trigger: An alert from one of your high-fidelity SIEM queries fires.
- Enrichment: The SOAR platform automatically takes the IP address from the network connection event and checks it against threat intelligence feeds like VirusTotal and AbuseIPDB. It also pulls the user’s role from Active Directory and establishes a baseline of their normal PowerShell usage.
- Triage & Containment: If the IP is known-bad or the user’s activity is a significant deviation from their baseline, the playbook can automatically execute a containment action. This could be isolating the host from the network using an EDR integration or temporarily disabling the user’s account.
- Notification: The playbook creates a high-priority ticket in your ticketing system with all the enriched data, context, and actions taken, then alerts the on-call SOC analyst.
This automated process turns a raw alert into an actionable case in minutes, dramatically reducing your response time and allowing your team to handle a much higher volume of events.
The game has changed. Adversaries are no longer defined by the malware they carry but by the behaviors they exhibit. Detecting Living Off the Land attacks requires a fundamental shift in mindset from finding evil files to finding evil activities. It demands better telemetry, proactive threat hunting, and smart automation. By implementing the strategies in this playbook, you can turn your network’s own tools from a liability into a high-fidelity sensor grid and start catching attackers who think they are invisible.
Struggling to find adversaries hiding in your network? Download our cheat sheet of essential threat hunting queries for detecting Living Off the Land attacks.
