SBN

Detecting fileless malware and living-off-the-land attacks


Fileless malware and living-off-the-land attacks are often discussed together because they share the same basic advantage for an attacker: they try to use what is already present on the system rather than dropping obvious malicious files. For defenders, that changes the detection problem. A traditional antivirus-style approach that relies on file hashes and quarantine events will miss a lot of the activity, because the real signal is usually in process behaviour, command lines, script execution, and unusual use of legitimate administration tools.

For UK SMEs, the practical challenge is not that these attacks are mysterious. It is that they blend into normal work. A support engineer may use PowerShell, a scheduled task may run at logon, and Windows Management Instrumentation, or WMI, may be used for remote administration. Those same tools are also attractive to attackers because they are available by default on many Windows estates and are often trusted by endpoint controls. The goal is therefore to build enough visibility to separate normal administration from suspicious use.

Key takeaways

  • Focus on process behaviour, command lines, and parent-child relationships rather than file hashes alone.
  • Correlate endpoint, identity, and network telemetry to spot suspicious activity that looks normal in isolation.
  • Prioritise PowerShell, WMI, scheduled tasks, and common Windows utilities when building detections.
  • Use MITRE ATT&CK to map coverage and identify the techniques most relevant to your environment.

What fileless malware and living-off-the-land attacks are

How these techniques differ from traditional malware

Traditional malware normally involves a malicious executable or script being written to disk and then launched. Fileless malware reduces that footprint by running from memory, using scripts, registry-based persistence, or injected code. Living-off-the-land attacks, often shortened to LOTL, use legitimate binaries and built-in tools such as PowerShell, cmd.exe, mshta.exe, reg.exe, rundll32.exe, schtasks.exe, wmic.exe, or certutil.exe to carry out malicious actions. In practice, the two overlap heavily. A threat actor may use a legitimate binary to launch a script that never touches disk, or use PowerShell to fetch and execute content in memory.

Why attackers favour legitimate tools and in-memory execution

Attackers favour these methods because they reduce obvious artefacts, can bypass weak allow-listing, and often inherit the trust of the host operating system. They also help with speed and flexibility. If a tool is already installed, there is no need to transfer a custom payload that might be blocked by email security, web filtering, or endpoint protection. For defenders, this means the presence of a Microsoft-signed binary is not enough to treat activity as benign. The context around the process matters more than the binary itself.

Why these attacks are hard to spot

Common visibility gaps in endpoints, identity, and logging

The most common gap is incomplete telemetry. Many environments log process creation poorly, do not capture command-line arguments, and have limited PowerShell logging. Without those data points, it is difficult to see whether PowerShell was used interactively by an administrator or launched by a script from a temporary directory. Another gap is identity visibility. If a compromised account is used to run remote commands, the endpoint may look normal unless you can correlate the activity with sign-in data, privilege changes, and lateral movement indicators. Network telemetry is also useful, because fileless activity often still needs to reach out for payloads, staging, or command-and-control.

In small teams, the problem is often not the absence of tools but the absence of joined-up data. Endpoint detection and response, or EDR, may show a suspicious process tree, while the identity platform shows an unusual sign-in from a new location, and the firewall shows a burst of outbound connections. Each signal alone may look low confidence. Together, they can be enough to justify action. This is why central visibility matters, as discussed in our article on achieving centralised visibility across endpoints, identity, and network.

How attackers blend into normal administrative activity

LOTL activity is effective because it resembles routine IT work. A remote admin session, a software deployment, or a maintenance script may all use the same binaries and protocols as an intrusion. The difference is usually in the sequence, timing, parent-child process chain, and destination. For example, a user launching PowerShell from Windows Terminal is not unusual. PowerShell spawning encoded commands from a document viewer, followed by network connections to an unfamiliar host, is much more interesting. Detection therefore needs to focus on behaviour, not just tool names.

Examples of fileless and living-off-the-land techniques

PowerShell, WMI, and scheduled tasks

PowerShell is one of the most important telemetry sources to baseline. It is powerful, widely used, and frequently abused. Suspicious patterns include encoded commands, hidden windows, download cradles, reflective loading, and unusual script block content. WMI is also common in remote execution and persistence. Attackers may use WMI event subscriptions or remote WMI calls to execute code across hosts without creating a conventional service. Scheduled tasks are another frequent persistence mechanism, especially when an attacker wants a payload to run at logon or on a timer under a trusted context.

For defenders, the key question is not whether these tools are present, but whether their use is expected on that host, by that account, at that time. A finance laptop should not be running a new scheduled task that launches PowerShell from a user profile path. A domain controller should not be making outbound web requests from a scripting host unless there is a documented reason.

Signed binaries and built-in Windows utilities

Legitimate binaries can be abused in many ways. rundll32.exe can load DLLs, mshta.exe can execute HTML applications, regsvr32.exe can register and run COM scriptlets, and certutil.exe can be used to decode or transfer content. None of these tools are inherently malicious. The detection challenge is to identify suspicious combinations such as a user document spawning a scripting host, a signed binary executing from a non-standard path, or a utility being used with unusual arguments and followed by outbound network activity. If you already track living-off-the-land binaries with process telemetry, our article on detecting living-off-the-land binaries with Sysmon process events is a useful companion.

Detection strategy and telemetry to prioritise

Process creation, command-line, and parent-child process data

If you only improve one area, improve process creation logging. You want process name, full command line, parent process, user context, integrity level, and ideally the hash and signer. Parent-child process relationships are especially valuable because they show whether a tool was launched from a normal shell, a document viewer, a browser, or a service context. A PowerShell process launched by winword.exe, outlook.exe, or wscript.exe is a very different event from one launched by an administrator from an approved management host.

On Windows, Sysmon is a strong option for this layer of visibility. Event ID 1 gives process creation, Event ID 3 gives network connections, Event ID 7 can help with image loads, and Event ID 22 can provide DNS queries if configured. Windows Security Event ID 4688 can also capture process creation if enabled with command-line auditing. The important point is consistency. Partial logging creates blind spots and makes correlation harder.

PowerShell logging, script block logging, and module logging

PowerShell logging is one of the highest-value controls for this topic. Script block logging records the content of executed scripts, which is useful when attackers use obfuscation or one-liners. Module logging can show which cmdlets were invoked, which helps distinguish routine administration from suspicious automation. Transcription can add another layer, although it is not always suitable everywhere because of storage and privacy considerations. In a mature setup, these logs should be forwarded into a SIEM where they can be correlated with endpoint and identity events.

For practical tuning, start with the hosts that matter most: domain controllers, admin workstations, jump hosts, and servers that handle sensitive data. Then extend coverage to the wider estate. If you are already using Microsoft Sentinel, KQL is a good fit for hunting patterns across these sources, and our guide to KQL threat hunting with Microsoft Sentinel shows how to structure that work.

Sysmon, Windows event logs, and EDR telemetry

Sysmon and Windows event logs give you the raw behavioural data. EDR adds context, reputation, and often memory inspection. That combination matters because fileless activity may never create a file to scan, but it still has to execute, touch memory, and often communicate over the network. EDR detections around suspicious script interpreters, credential dumping behaviour, or unusual child processes can be strong indicators, especially when paired with process ancestry and network connections. If your EDR supports memory scanning or AMSI integration, those features can help surface malicious script content earlier in the chain.

Detection logic that works in practice

High-signal indicators and behavioural patterns

Good detections are usually behavioural and contextual. Examples include Office applications spawning scripting engines, encoded PowerShell commands, script interpreters launched from writable user paths, LOLBins executing from temporary directories, and repeated use of administrative tools outside normal change windows. Another useful pattern is the combination of a new process, a new outbound connection, and a new persistence artefact within a short time window. That kind of sequence is more meaningful than any single event.

It is also worth watching for process trees that do not fit the host role. A server that suddenly launches browser processes, archive tools, or scripting hosts may be worth a closer look. Likewise, a user workstation that starts making remote management calls to multiple systems can indicate lateral movement or remote execution. The point is to define what normal looks like for each host class, then alert on meaningful deviations.

Correlating suspicious process chains with network and identity events

Correlation is where detection quality improves. A suspicious PowerShell launch is useful, but a suspicious PowerShell launch followed by a connection to an unknown IP, a failed sign-in from another geography, and a privilege assignment is much stronger. Identity telemetry can also reveal token abuse, unusual logon types, or account use outside expected hours. Network telemetry can show command-and-control patterns, DNS anomalies, or connections to newly registered infrastructure. For network-side context, our article on detecting command-and-control traffic at the network layer is relevant because fileless activity still needs a communications path.

Using MITRE ATT&CK to structure coverage

MITRE ATT&CK is useful here because it gives you a common language for techniques such as PowerShell, WMI, scheduled task, command and scripting interpreter, and system binary proxy execution. Mapping detections to ATT&CK helps you see where you have strong coverage and where you rely on assumptions. It also helps when you are prioritising improvements in a small team. You do not need perfect coverage everywhere. You need the highest-value detections for the techniques most likely to be used against your environment.

How to investigate suspected activity

Triage steps for analysts and IT teams

Start by confirming the process chain and the user context. Check whether the host is expected to run the tool, whether the command line is normal, and whether the timing aligns with a change or support activity. Review recent sign-ins, remote sessions, and privilege changes for the account involved. Then look for related endpoints showing the same pattern. If the same script hash, command line, or destination appears elsewhere, the issue may be broader than a single host.

It is also useful to compare the event against your baseline. If PowerShell is normally used on a handful of admin hosts, a new occurrence on a finance laptop is more suspicious. If a scheduled task appears on a server outside your deployment process, treat it as a persistence candidate until proven otherwise.

What evidence to preserve for later review

Preserve process logs, PowerShell logs, EDR timelines, relevant memory artefacts if your tooling supports them, and identity and network records around the same time window. Avoid making changes too early if you are still trying to understand the scope. If you need to isolate a host, do so in a way that preserves evidence where possible. For SMEs, the practical aim is to keep enough information to understand the attack path and support any later internal review or external investigation.

When to escalate to incident response

Escalate if you see signs of persistence, credential theft, lateral movement, or multiple affected hosts. Also escalate if the activity involves privileged accounts, domain controllers, or systems holding sensitive data. A single suspicious PowerShell event may be a false positive. A suspicious PowerShell event plus a new scheduled task, a remote admin session, and unusual outbound traffic is a different matter. At that point, the question is no longer whether to investigate, but how quickly you can contain the scope.

How to remove the threat and recover safely

Containment considerations before remediation

Before cleaning up, consider whether the attacker still has access. If you remove a scheduled task but leave the account active and the password unchanged, the same technique may reappear. If you delete a script without checking for other hosts, you may miss the wider campaign. Containment usually means isolating affected endpoints, disabling or resetting compromised accounts, and blocking known malicious destinations or hashes where appropriate. The order matters, especially if you are trying to preserve evidence.

Cleaning up persistence and validating systems are stable

Look for scheduled tasks, services, registry run keys, WMI subscriptions, startup folder entries, and any unusual autoruns. Validate that the host returns to a stable state after remediation and that no new suspicious processes appear. Rebuild from a trusted image if you cannot be confident in the integrity of the system. For higher-risk systems, a clean rebuild is often safer than trying to remove every artefact manually.

Checking for credential exposure and lateral movement

Because these attacks often target credentials, review whether the affected account had access to other systems, cloud services, or administrative tools. Check for unusual logons, token use, mailbox access, or directory changes. If you suspect credential exposure, rotate affected secrets and review where those credentials are used. Our article on detecting credential theft and misuse patterns is a helpful reference when you are thinking about the wider identity impact.

How to defend against future fileless activity

Hardening PowerShell and administrative tooling

Reduce the attack surface of scripting where you can. Enable PowerShell logging, restrict PowerShell version 2 where it is still present, and use constrained language mode where appropriate. Consider application control for admin tools and script execution, especially on high-value systems. On endpoints that do not need it, remove or restrict legacy interpreters and management tools that are rarely used but often abused. The aim is not to ban administration. It is to make high-risk tooling harder to misuse silently.

Application control, least privilege, and attack surface reduction

Least privilege remains one of the most effective controls. If users do not have local admin rights, attackers have less room to install persistence or disable controls. Application control can prevent unknown binaries and scripts from running, while attack surface reduction rules can block common abuse patterns such as Office spawning child processes or executable content from email and web downloads. These controls need testing, but they are often worthwhile on laptops, admin workstations, and servers with stable workloads. If you are building a broader hardening programme, our guide to endpoint hardening using CIS Benchmarks is a good companion.

Improving logging coverage and alert tuning

Logging without tuning can create noise, so define a small number of high-value detections first. Focus on suspicious parent-child chains, encoded commands, unusual script execution, new persistence mechanisms, and network connections from scripting hosts. Then review false positives regularly and adjust baselines by host role. A detection that fires on every admin task is not useful. A detection that catches rare but meaningful behaviour is. Over time, you can expand coverage using ATT&CK mapping and purple-team validation, but the first step is to make sure the data is there and the alerts are actionable.

Practical checklist for UK SMEs

Start with these minimum controls:

  • Enable process creation logging with command-line capture on key Windows hosts.
  • Turn on PowerShell script block logging and forward it to your SIEM or EDR platform.
  • Deploy Sysmon with a sensible configuration on admin workstations, servers, and domain controllers.
  • Alert on Office, browser, or script host processes spawning PowerShell, cmd.exe, wscript.exe, or mshta.exe.
  • Review scheduled tasks, WMI subscriptions, and autoruns on a regular basis.
  • Correlate endpoint alerts with identity and network telemetry before closing an alert.
  • Restrict local admin rights and apply application control where operationally feasible.
  • Test your detections against ATT&CK techniques and tune out routine administration.

If you have limited time, prioritise the hosts that would matter most in an incident: privileged user devices, domain controllers, jump hosts, and systems that store sensitive data. That approach gives you the best return on effort and helps you avoid spreading controls too thinly.

For organisations that want a structured way to improve detection and response without overcomplicating the stack, a short review of logging, endpoint telemetry, and identity correlation is often enough to identify the biggest gaps. If you would like support with that assessment or with improving your detection engineering approach, Speak to a consultant.

Frequently asked questions

Can fileless malware be detected?

Yes. It is usually detected through behaviour, such as suspicious process chains, PowerShell script content, unusual network connections, and persistence artefacts, rather than through file scanning alone.

How do you defend against fileless malware and living-off-the-land attacks?

Use layered controls: enable strong logging, restrict scripting and administrative tooling, apply least privilege, deploy application control where practical, and correlate endpoint, identity, and network data in your SIEM or EDR platform.