Join our Newsletter — 33% off our NHI Course

UtilityFunctions.ps1 (Windows LOLBAS Script)

UtilityFunctions.ps1 is a PowerShell script associated with Windows utilities and can be used as a living-off-the-land script for execution or staging. Attackers may modify or invoke it to blend with administrative activity. Defenders should monitor script content, execution context, and any changes to trusted administrative scripts.

What the script is and why LOLBAS matters

UtilityFunctions.ps1 is best understood as a trusted Windows PowerShell utility script that can be repurposed for living off the land execution. That makes it attractive because it can blend into normal administration, reduce the need for custom malware, and help attackers stage activity using tools already present on the system.

LOLBAS tradecraft is dangerous precisely because defenders often expect these scripts to exist. A script that looks operational can still be used to launch commands, pull payloads, or prepare a later stage while appearing consistent with routine admin work.

How attackers abuse trusted scripts

Attackers typically exploit the trust granted to signed or familiar system utilities by modifying the script, invoking it from an unusual parent process, or chaining it into a broader execution flow. The script itself is not the goal; the goal is to inherit legitimacy from the Windows utility ecosystem and reduce suspicion during execution.

That abuse pattern is common across living off the land activity: the observable signal is often not a new binary, but a suspicious command line, an unexpected execution path, or a trusted script running from an odd context. MITRE ATT&CK Enterprise Matrix is the right lens for mapping that execution chain to known adversary techniques such as proxy execution, command and scripting abuse, and defense evasion.

What defenders should monitor

Defenders need visibility into script content, invocation context, and changes to any administrative script that should be stable. Monitoring only the filename is not enough, because LOLBAS use depends on context: who launched it, from where, with what arguments, and whether the script body has been altered.

Good coverage usually combines script logging, command-line telemetry, and integrity checks on trusted admin locations. Living off the Land Guide gives a broader control view for LOLBins, LOLBAS, dual-use tools, application control, and hardening patterns that help surface this kind of abuse. At the control level, NIST SP 800-53 Rev 5 Security and Privacy Controls supports the need for auditability, configuration integrity, and access control around scripts and administrative tooling.

Prevention and response considerations

Prevention is strongest when organisations treat trusted scripts as governed assets, not informal convenience files. Application control, constrained scripting practices, and approval for administrative script changes reduce the chance that a legitimate utility becomes an execution bridge for an attacker.

Response should assume the script may be one piece of a larger chain. If it was modified or invoked in a suspicious way, defenders should review surrounding process activity, related command lines, and any follow-on execution that used the same trust boundary. NIST Cybersecurity Framework 2.0 is a useful organising model here because it separates protective hardening, detection, response, and recovery into a practical operating cycle.

Risk and Threat Considerations

Trusted utility scripts create a high-value abuse path because they inherit normality from the operating environment. If an attacker can alter a script, trigger it from an unexpected process, or stage code through it, they can often hide in plain sight and extend execution without introducing an obviously malicious binary.

Failure mechanism: The defensive failure is usually not the script itself, but weak integrity monitoring, poor command-line visibility, or overly broad trust in administrative paths that lets altered content execute unnoticed.

Impact: Successful abuse can lead to stealthy execution, staging of additional payloads, lateral movement preparation, and delayed detection because activity appears administrative rather than hostile.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

MITRE ATT&CK addresses the attack and risk surface, while CIS Controls v8 and NIST SP 800-53 Rev 5 set the governance and control requirements practitioners need to meet.

Framework Control / Reference Relevance
MITRE ATT&CK T1218 — Signed Binary Proxy Execution UtilityFunctions.ps1 abuse relies on trusted Windows utilities to execute code through benign-looking paths.
Recommendation — Map the script’s execution path to proxy-execution techniques and hunt for suspicious parent-child process chains.
CIS Controls v8 CIS-2 — Inventory and Control of Software Assets Trusted scripts are software assets that must be inventoried and governed to spot tampering and abuse.
Recommendation — Inventory administrative scripts and verify file integrity before allowing them to run in production.
NIST SP 800-53 Rev 5 AU-12 — Audit Record Generation Script abuse is best detected with command-line and execution audit records that preserve context.
CM-5 — Access Restrictions for Change Changing a trusted administrative script is a controlled change that should not be broadly writable.
SI-7 — Software, Firmware, and Information Integrity Integrity controls directly address tampering with a legitimate script used for execution or staging.
Recommendation — Generate and retain process and script audit records so suspicious invocations can be reconstructed. Restrict who can modify administrative scripts and require approval for changes to trusted tooling. Verify script integrity so altered administrative content is detected before execution.

Practitioner Guidance

What to watch for: Treat unexpected parents, unusual arguments, modifications to stable admin scripts, and execution from nonstandard locations as investigation triggers. The most useful judgement is contextual: a benign script name is not reassuring if the process tree, timing, or file integrity does not match normal administration.

Practitioner takeaway: For LOLBAS-style scripts, the right question is not whether the file is trusted, but whether its content, origin, and execution context are still trustworthy.