Invoke-PSImage is a PowerShell tool that hides script content inside image files and extracts it at runtime. Attackers use it to conceal payloads from casual inspection and some file-based controls, so defenders should inspect unusual PowerShell activity, image-file abuse, and encoded or reconstructed script execution.
How Invoke-PSImage Works
Invoke-PSImage is a PowerShell technique that embeds script content inside image files and reconstructs it at runtime. That design shifts malicious logic away from obvious script files and into a container that often looks harmless during casual review.
The method matters because defenders usually expect PowerShell abuse to arrive as a script, command line, or encoded payload. By hiding content inside an image, an operator can delay scrutiny until the file is loaded and the script is decoded or extracted in memory.
Why This Technique Is Effective
Invoke-PSImage is effective because it blends into workflows that trust images more than executable content. It can frustrate simple file-type checks, content review, and some static scanning approaches that are not looking for script material hidden in non-script containers.
That does not make the payload invisible, only less obvious. Security teams still have opportunities to detect it through the surrounding PowerShell behaviour, associated download or staging activity, and any unusual file handling that leads to script reconstruction.
A useful way to think about the technique is as concealment, not magic. The payload still has to be executed somehow, and that execution path usually leaves traces in telemetry, parent-child process relationships, command-line content, or PowerShell logging.
What Defenders Should Look For
Detection starts with PowerShell visibility. Unusual use of PowerShell against image files, unexpected script reconstruction, suspicious encoded command content, and activity that does not match the normal admin baseline are all important signals. A strong baseline for PowerShell monitoring is described in PowerShell Security Guide.
Image-file abuse is also a clue. Look for image formats that are opened, copied, or parsed in contexts where script extraction makes no business sense, especially when paired with outbound retrieval, temporary file creation, or memory-resident execution.
Defenders should also correlate this technique with broader adversary patterns. The MITRE ATT&CK Enterprise Matrix helps map PowerShell abuse, execution staging, and post-compromise actions to known tactics and techniques.
Security Controls and Response
Controls should make hidden script execution harder and easier to observe. PowerShell logging, AMSI visibility, constrained language mode, script block logging, and execution restrictions all reduce the chance that concealed content runs without trace. For a broader control baseline, see NIST SP 800-53 Rev 5 Security and Privacy Controls.
When this technique is suspected or confirmed, treat it like a script execution investigation, not just a file inspection problem. Review the PowerShell history, related event logs, parent processes, downloaded files, and any endpoints where the image was introduced or opened.
Hardened environments can also use policy and posture controls to reduce exposure to concealed payloads. Guidance in NIST Cybersecurity Framework 2.0 supports the broader detection, response, and recovery practices needed to contain this kind of abuse.
Risk and Threat Considerations
Invoke-PSImage increases the chance that malicious PowerShell will bypass casual inspection and some file-based controls. The main risk is not the image itself, but the hidden script content that can execute after the file is opened or processed.
Failure mechanism: The attacker hides script material in a benign-looking image, then relies on PowerShell to reconstruct and run it after static review has passed.
Impact: This can delay detection, weaken triage, and let payloads reach execution, persistence, or follow-on compromise stages before defenders recognise the activity.
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 NIST SP 800-53 Rev 5 and NIST CSF 2.0 set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| MITRE ATT&CK | T1059.001 — PowerShell | Invoke-PSImage is a PowerShell abuse pattern that maps to PowerShell execution as an adversary technique. |
| Recommendation — Map suspicious script activity to PowerShell abuse and hunt for related execution chains and staging behavior. | ||
| NIST SP 800-53 Rev 5 | AU-2 — Event Logging | Hidden script execution depends on logging and traceability to expose reconstruction and execution steps. |
| SI-4 — System Monitoring | Detection depends on monitoring unusual PowerShell and image-file behavior across endpoints. | |
| CM-7 — Least Functionality | Restricting unnecessary scripting capability reduces opportunities for concealed payload execution. | |
| Recommendation — Configure PowerShell and endpoint logging to preserve evidence of hidden script reconstruction and execution. Monitor endpoint behavior for suspicious PowerShell, file abuse, and encoded command activity. Limit PowerShell capability and exposed scripting paths to reduce hidden payload execution opportunities. | ||
| NIST CSF 2.0 | DE.CM-01 — Monitor for Unauthorized Personnel, Connections, Devices, and Software | The technique is detectable through monitoring of anomalous software and process activity. |
| Recommendation — Monitor for abnormal PowerShell and image-processing behavior that may indicate concealed payload execution. | ||
Practitioner Guidance
What to watch for: Treat image-associated PowerShell as suspicious when the file relationship is unusual, the command line is encoded or reconstructed, or the activity appears outside normal administration patterns. That combination is often more meaningful than any single file event.
Governance implication: Make sure PowerShell telemetry, endpoint controls, and analyst playbooks are designed to join file handling with script execution evidence. If those signals live in separate silos, hidden payload techniques become much harder to spot quickly.
Related resources from NHI Mgmt Group
- How should security teams govern AI agents that can invoke multiple tools in one session?
- What breaks when coding assistants can invoke MCP servers and other tools?
- What breaks when shared channels are allowed to invoke privileged agent identities?
- Why do AI agents create new risk when they can read email, query systems, and invoke tools on behalf of employees?
Deepen Your Knowledge
Free weekly newsletter
Subscribe to the NHI & AI Identity Journal
The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.
Bonus 33% off our NHI Course when you subscribe.
Reviewed and updated by the NHIMG editorial team on October 17, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org