TL;DR
Researchers have introduced SCRIPTIOC-BENCH, the first benchmark specifically designed to evaluate how Large Language Models (LLMs) statically extract Indicators of Compromise (IOCs) from malicious scripts. The study reveals that while frontier models excel at finding "obvious" indicators, they struggle significantly with those requiring complex program reasoning, though these weaknesses can be partially mitigated in smaller models through tool-augmentation and task-specific adaptation.
What Problem Does This Paper Address?
Script-based malware (JavaScript, PowerShell, VBScript) is a staple of modern cyberattacks. These scripts often hide valuable Indicators of Compromise (IOCs)—like C2 server URLs, IP addresses, and file paths—that are essential for threat hunting.
However, extracting these indicators statically (without running the dangerous code) is incredibly difficult. Attackers use obfuscation, splitting strings across variables, and custom decoding logic to evade simple pattern-matching tools. While LLMs have shown promise in code understanding, we haven't had a systematic way to measure their ability to recover these "hidden" IOCs across different languages and levels of obfuscation. Existing datasets often conflate static evidence with dynamic runtime data, making it hard to evaluate pure static analysis capabilities.
Methods
The authors developed a comprehensive evaluation framework and a new benchmark:
- Benchmark Construction: They manually verified 634 malicious script samples and annotated every IOC with a Recovery Level:
- Direct: The value appears verbatim in the source.
- Fixed-transform: The value is hidden behind common, parameter-free encodings (e.g., Base64).
- Program-dependent: Recovery requires following custom, script-specific logic (e.g., iterative string assembly).
- Evaluation Suite: They tested 10 models ranging from 8B open-weight models (like Qwen and Gemma) to frontier proprietary models (Gemini-Pro, GPT-Terra).
- False-Positive Taxonomy: To understand why models fail, they created a 10-category taxonomy for errors, distinguishing between "Prompt Echo" (repeating examples from the instructions) and "Near-copy" (getting the indicator almost right but missing a character).
- Mitigation Strategies: They performed a case study on an 8B model using two techniques:
- Tool-Augmentation: Giving the model access to deterministic string utilities (Base64 decoders, XOR tools).
- Task-Specific Adaptation: Fine-tuning the model using Supervised Fine-Tuning (SFT) and Group Relative Policy Optimization (GRPO) with a verifiable reward function.
Datasets
- SCRIPTIOC-BENCH (New): 634 manually verified samples covering JS, PowerShell, and VBScript. It includes recent samples (2025-2026) from Filescan.io and historical JS samples (2015-2017) from the Hynek Petrak collection.
- Training Set: For the adaptation study, they used an additional 1,100 JS malware samples and a set of benign scripts.
Key Insights and Ideas
- The "Program-Dependent" Wall: Even the most powerful frontier models see their recall drop by more than half when an IOC requires reasoning over custom program logic rather than just simple decoding.
- Hallucination vs. Grounding: Smaller models tend to fail by "echoing" the prompt—repeating the example URLs provided in the instructions. In contrast, larger models stay "grounded" in the sample; their errors are usually "near-misses" of actual indicators in the code.
- Complexity Penalty: Long scripts and highly redundant code (low compression ratio) act as noise that significantly degrades LLM reliability. As script length increases, models are more likely to produce incomplete or unparsable JSON outputs.
- Tools and Training are Complementary: Tools help models stay grounded and handle direct extraction better, while task-specific adaptation helps them recognize recurring obfuscation patterns.
Key Results
- Frontier Performance: The strongest models (GPT-Terra and Gemini-Pro) reached an F1 score of ~65.4. While they recovered over 91% of Direct IOCs, they only managed 31–46% of Program-dependent IOCs.
- LLMs vs. Regex: Conventional regex-based extractors (like URLExtract) achieved much lower F1 scores (~22.4), proving that LLMs are significantly better at handling obfuscation, even if they aren't perfect.
- Mitigation Success: For the 8B model, combining tool-use and adaptation raised precision from 31% to 48% and shifted the error profile away from prompt-echoing toward more plausible, sample-grounded errors.
Limitations and Future Work
- Scope: The benchmark currently focuses on four IOC types (URLs, domains, IPs, files). Future versions could include registry keys or more complex behavioral indicators.
- Data Contamination: While recent samples were collected after most models' knowledge cutoffs, the authors acknowledge that historical samples might have been seen during pre-training, though performance trends remained consistent across both subsets.
- Human-in-the-loop: The results suggest LLMs are not yet reliable enough for fully autonomous extraction and should instead be used to assist human analysts by flagging potential indicators for review.
- Future Directions: The authors plan to expand the benchmark to more languages and explore "tool-aware" adaptation, where models learn specifically when and how to invoke external decoders.
Summary updated