PSDissect: A CFG-Guided, Semantics-Preserving Interactive Deobfuscation Framework for PowerShell Scripts
Yifeng Fu, Jingfeng Xue, Weijie Han, Yong Wang, Zhenyan Liu, Wenbiao Du, Zeyang Liu
摘要
PowerShell is a widely used scripting language for system administration and task automation. Owing to its flexible execution model and support for fileless execution, attackers frequently abuse it for malicious activities and employ diverse obfuscation strategies to evade security detection. A key challenge is that existing deobfuscation approaches do not preserve runtime context dependencies. Multiple invocations of the same function or script block may therefore map individually correct values to the same source position, causing conflicts. In addition, existing approaches lack fine-grained execution control and mechanisms for exposing intermediate execution states for analyst inspection and intervention. Effective deobfuscation that fully accommodates PowerShell's dynamic execution characteristics remains challenging. In this paper, we present PSDissect. To the best of our knowledge, PSDissect is the first PowerShell deobfuscation framework that preserves execution context throughout dynamic deobfuscation by maintaining code-generation and invocation relationships together with runtime states such as variable bindings and aliases. PSDissect achieves this context preservation through a CFG-guided design. It first constructs a control-flow graph (CFG) that explicitly represents control-flow structures, dynamically generated code, and invocation behaviors. It then executes CFG nodes independently under a shared execution context, allowing execution behavior to be controlled at the granularity of individual CFG nodes. For each CFG node, PSDissect identifies potentially obfuscated script pieces, records and stringifies their execution results, replaces the corresponding obfuscated script pieces, and finally reconstructs a behavior-equivalent deobfuscated script. The same CFG representation also supports interactive replay and debugging, allowing analysts to inspect intermediate execution states, supply missing runtime context, and control individual reconstruction decisions. We evaluate PSDissect through two complementary experiments, both against state-of-the-art baselines. On a controlled dataset covering representative PowerShell obfuscation strategies, PSDissect achieves the best overall performance, with a 100% effective deobfuscation rate and 98% recovery accuracy; with interactive debugging, the recovery accuracy further improves to 100%. On two real-world malicious PowerShell datasets containing 381 and 4,263 samples, respectively, PSDissect consistently outperforms state-of-the-art baselines within a two-minute analysis budget in effective deobfuscation, sensitive data recovery, semantic consistency, and residual obfuscation-burden reduction. Beyond deobfuscation, PSDissect enables interpretable malicious script behavior analysis through CFG-driven structural exposure.
问 Lune
几分钟看清这篇 Paper 的位置,不用再花一下午。
Lune 能读引用它和与它最相关的顶会 Paper,讲清它说了什么、后来怎样、哪里站不住,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
相关 Paper
- PowerPeeler: A Precise and General Dynamic Deobfuscation Method for PowerShell ScriptsRuijie Li, Chenyang Zhang, Huajun Chai, Lingyun Ying 等CCS 2024 · 3 次引用
- Effective and Light-Weight Deobfuscation and Semantic-Aware Attack Detection for PowerShell ScriptsZhenyuan Li, Qi Alfred Chen, Chunlin Xiong, Yan Chen 等CCS 2019 · 38 次引用
- Control-Flow Deobfuscation using Trace-Informed Compositional Program SynthesisBenjamin Mariano, Ziteng Wang, Shankara Pailoor, Christian S. Collberg 等OOPSLA 2024 · 5 次引用
- Large Language Models for Opaque Predicate Resolution: A Universal Control Flow Deobfuscation FrameworkXiao Chen, Qiuyun Wang, Shuwei Wang, Weize Zhang 等FSE 2026
- From Obfuscated to Obvious: A Comprehensive JavaScript Deobfuscation Tool for Security AnalysisDongchao Zhou, Lingyun Ying, Huajun Chai, Dongbin WangNDSS 2026 · 3 次引用
