Skip to content

Conversation

@malfav
Copy link

@malfav malfav commented Nov 10, 2025

sandbox_detect.py – Virtualization and Sandbox Environment Detection (Volatility 3 Plugin)

sandbox_detect.py is a specialized Volatility 3 plugin designed for post-mortem forensic analysis of Windows memory dumps.
Its primary goal is to detect and score artifacts indicating that the analyzed system was operating within a Virtual Machine (VM), Sandbox, or Malware Analysis Environment.

This plugin is particularly valuable for investigators who need to determine whether a captured memory sample originated from a controlled analysis setup or a real-world victim system.


Key Capabilities

Multi-Layered Artifact Scanning

Performs deep inspection across multiple memory and system layers to ensure comprehensive detection:

  • Process Analysis: Identifies running processes related to virtualization or analysis environments, such as
    vmtoolsd.exe, vboxservice.exe, prl_cc.exe, wireshark.exe, and ollydbg.exe.
  • Driver and Module Checks: Detects kernel modules and drivers named after virtualization platforms, including
    vmmouse.sys, vboxguest.sys, and vmhgfs.sys.
  • Registry and System Keys: Examines critical registry entries and system identifiers for virtualization traces,
    such as hardware IDs, BIOS strings, and known VM installation paths.

Heuristic Scoring System

Implements a scoring engine that assigns severity levels to each identified artifact.
Instead of a binary result, the plugin produces a confidence-based verdict, such as:

  • HIGH CONFIDENCE – Virtual Machine Detected
  • MODERATE CONFIDENCE – Sandbox Environment
  • LOW CONFIDENCE – Physical Host

This scoring model provides analysts with clearer, evidence-weighted conclusions.


# live.py – Volatility 3 Live System Analysis Plugin

`live.py` is a custom plugin for **Volatility 3** designed to extend its capabilities for **real-time forensic data collection and threat hunting** directly on a **live Windows system**, eliminating the need for a full memory dump.

This tool provides an **interactive command-line shell** for dynamic investigation, leveraging system APIs through libraries like `psutil` and `pywin32` to quickly triage and analyze active endpoints.

---

## Key Capabilities

### **Live Analysis Mode**
Performs immediate, low-overhead forensic data collection from an active operating system, bypassing traditional memory dump requirements.

### **Interactive Shell**
Includes an integrated CLI environment offering a suite of commands for efficient, step-by-step investigation via the `LiveShellCommand` interface.

### **Advanced Threat Hunting**
Provides built-in commands for targeted analysis:
- **fileless** – Detects fileless malware and suspicious in-memory activity, focusing on processes such as `powershell.exe`.
- **detect_sandbox** – Identifies virtualized or sandboxed environments by inspecting artifacts, process behavior, and MAC address prefixes.

### **Comprehensive Forensic Data Collection**
Collects essential artifacts and system information for deep analysis:
- **Process and Module Data:** `pslist`, `psscan`, `dlllist`, `handles`, `sids`, `cmdline`
- **Network Activity:** `netscan` for active connections and sockets
- **Persistence & Services:** Analysis of `services`, `drivers`, `registry`, and autorun entries
- **Artifact Analysis:** Extraction of `shimcache`, `prefetch`, `userassist`, and `jumplists`
- **Timeline Generation:** Unified event correlation using `timeliner`

---
# sandbox_detect.py – Virtualization and Sandbox Environment Detection (Volatility 3 Plugin)

`sandbox_detect.py` is a specialized **Volatility 3 plugin** designed for **post-mortem forensic analysis** of **Windows memory dumps**.  
Its primary goal is to detect and score artifacts indicating that the analyzed system was operating within a **Virtual Machine (VM)**, **Sandbox**, or **Malware Analysis Environment**.

This plugin is particularly valuable for investigators who need to determine whether a captured memory sample originated from a **controlled analysis setup** or a **real-world victim system**.

---

## Key Capabilities

### **Multi-Layered Artifact Scanning**
Performs deep inspection across multiple memory and system layers to ensure comprehensive detection:

- **Process Analysis:** Identifies running processes related to virtualization or analysis environments, such as  
  `vmtoolsd.exe`, `vboxservice.exe`, `prl_cc.exe`, `wireshark.exe`, and `ollydbg.exe`.  
- **Driver and Module Checks:** Detects kernel modules and drivers named after virtualization platforms, including  
  `vmmouse.sys`, `vboxguest.sys`, and `vmhgfs.sys`.  
- **Registry and System Keys:** Examines critical registry entries and system identifiers for virtualization traces,  
  such as hardware IDs, BIOS strings, and known VM installation paths.

---

### **Heuristic Scoring System**
Implements a scoring engine that assigns severity levels to each identified artifact.  
Instead of a binary result, the plugin produces a **confidence-based verdict**, such as:

- **HIGH CONFIDENCE – Virtual Machine Detected**  
- **MODERATE CONFIDENCE – Sandbox Environment**  
- **LOW CONFIDENCE – Physical Host**

This scoring model provides analysts with clearer, evidence-weighted conclusions.

---
# sandbox_detect.py – Virtualization and Sandbox Environment Detection (Volatility 3 Plugin)

`sandbox_detect.py` is a specialized **Volatility 3 plugin** designed for **post-mortem forensic analysis** of **Windows memory dumps**.  
Its primary goal is to detect and score artifacts indicating that the analyzed system was operating within a **Virtual Machine (VM)**, **Sandbox**, or **Malware Analysis Environment**.

This plugin is particularly valuable for investigators who need to determine whether a captured memory sample originated from a **controlled analysis setup** or a **real-world victim system**.

---

## Key Capabilities

### **Multi-Layered Artifact Scanning**
Performs deep inspection across multiple memory and system layers to ensure comprehensive detection:

- **Process Analysis:** Identifies running processes related to virtualization or analysis environments, such as  
  `vmtoolsd.exe`, `vboxservice.exe`, `prl_cc.exe`, `wireshark.exe`, and `ollydbg.exe`.  
- **Driver and Module Checks:** Detects kernel modules and drivers named after virtualization platforms, including  
  `vmmouse.sys`, `vboxguest.sys`, and `vmhgfs.sys`.  
- **Registry and System Keys:** Examines critical registry entries and system identifiers for virtualization traces,  
  such as hardware IDs, BIOS strings, and known VM installation paths.

---

### **Heuristic Scoring System**
Implements a scoring engine that assigns severity levels to each identified artifact.  
Instead of a binary result, the plugin produces a **confidence-based verdict**, such as:

- **HIGH CONFIDENCE – Virtual Machine Detected**  
- **MODERATE CONFIDENCE – Sandbox Environment**  
- **LOW CONFIDENCE – Physical Host**

This scoring model provides analysts with clearer, evidence-weighted conclusions.

---
# sandbox_detect.py – Virtualization and Sandbox Environment Detection (Volatility 3 Plugin)

`sandbox_detect.py` is a specialized **Volatility 3 plugin** designed for **post-mortem forensic analysis** of **Windows memory dumps**.  
Its primary goal is to detect and score artifacts indicating that the analyzed system was operating within a **Virtual Machine (VM)**, **Sandbox**, or **Malware Analysis Environment**.

This plugin is particularly valuable for investigators who need to determine whether a captured memory sample originated from a **controlled analysis setup** or a **real-world victim system**.

---

## Key Capabilities

### **Multi-Layered Artifact Scanning**
Performs deep inspection across multiple memory and system layers to ensure comprehensive detection:

- **Process Analysis:** Identifies running processes related to virtualization or analysis environments, such as  
  `vmtoolsd.exe`, `vboxservice.exe`, `prl_cc.exe`, `wireshark.exe`, and `ollydbg.exe`.  
- **Driver and Module Checks:** Detects kernel modules and drivers named after virtualization platforms, including  
  `vmmouse.sys`, `vboxguest.sys`, and `vmhgfs.sys`.  
- **Registry and System Keys:** Examines critical registry entries and system identifiers for virtualization traces,  
  such as hardware IDs, BIOS strings, and known VM installation paths.

---

### **Heuristic Scoring System**
Implements a scoring engine that assigns severity levels to each identified artifact.  
Instead of a binary result, the plugin produces a **confidence-based verdict**, such as:

- **HIGH CONFIDENCE – Virtual Machine Detected**  
- **MODERATE CONFIDENCE – Sandbox Environment**  
- **LOW CONFIDENCE – Physical Host**

This scoring model provides analysts with clearer, evidence-weighted conclusions.

---
Copy link
Member

@ikelos ikelos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So in general, this is pretty good and I like the functionality, well done. 5:) The main issue with this at the moment is that it's designed exclusively to be used as part of the CLI and for human output, requiring interpretation or parsing of some fields for anything that programmatically wishes to use the data produced.

To tidy this up, there should be as many fields as there are separate pieces of information to communicate. This means splitting up the info field, and putting the summary data into fields of their own that aren't used in the rest of the lines. Please use a BaseAbsentValue derivative for any fields that aren't used (such as NotAvailableValue or NotApplicableValue). This may mean the plugin returns a lot of columns, and may be more difficult to read through the CLI, but it will vastly improve the mobility of the data this plugin produces.

That would mean returning something like:

Overall verdict | Total score | Detections | Confidence | Detection Type | Indicator | Description | Severity | PID | Process count | ...
SANDBOX  | 89 | 10 | High | - | - | - | - | - | - |....
- | - | - | - | System | Low Process Count | Minimal process environment | High | - | 19 | ...

This won't give a nice document, if you want that, then I'd write a shell script that runs the output and interprets the JSON output data or similar. We offer the TreeGrid as a means to return a tree/table of data relevant to the plugin. It is the most modular mechanism we can provide while still allowing interpretation of the results by other programs and systems.

process_params = peb.ProcessParameters
if process_params:
image_path = process_params.ImagePathName.get_string()
proc_path = image_path if image_path else "N/A"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than using the string "N/A" (which can't be differentiated from the string "N/A" please use something derived from BaseAbsentValue such as NotAvailableValue.

'indicator': proc_name,
'description': self.SANDBOX_PROCESSES[proc_name],
'severity': 'High',
'info': f'PID: {proc_pid} | Path: {proc_path}'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't include two fields as a string. This makes the data difficult to use programmatically. It would be better to return the two fields separately (particularly since if they're not available they should be derived from BaseAbsentValue).

break

except Exception:
continuenue
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a typo?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It may also be worth logging the error that occurs here, particularly if you're blanket catching all exceptions. Ideally you'd only catch expected exceptions, but if you want to catch them all, there should be at least a way for developers to know something's gone wrong (such as a vollog.debug message).

continue

# Check for very low process count
if process_count < 20:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like an arbitrary value. It might be worth parameterizing it, and collecting it at the top of the class, to allow other plugins to change it without having to rewrite the code completely.

'indicator': f'Missing critical processes: {", ".join(missing_processes)}',
'description': 'Essential Windows processes not running',
'severity': 'High',
'info': f'Found processes: {", ".join(process_names[:10])}...'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, combining values into a single string is very useful for humans but would require any automatic system using the plugin to parse the string you've constructed. Typically we'd expect this to output one entry per process_name (repeating all the rest of the data). It's up to you, and I won't push it, but please think of other uses of the plugin besides only the CLI and humans reading it. This is supposed to be a library that parses data that can be programmatically read by a consumer for use by all kinds of programs.

total_score = 0

# Run all checks
vollog.info("Checking for sandbox processes...")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably be a progress_callback call, rather than a log message? It takes a float value showing the percentage progress, and a message indicating what's being progressed.

""
))

yield (0, ("", "", "", "", ""))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't do this, you're abusing the data return to try to format the results for humans. As I've mention twice elsewhere, these plugins may be used by any tool that uses the library, and having to handle unusual results like this will make things more difficult for them.

# Yield detailed detections if verbose or if detections found
if verbose or all_detections:
for detection in all_detections:
yield (0, (
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can yield these with a 1, to indent them in a tree view, instead of 0 here, if you wish to differentiate them.

# Yield summary
yield (0, (
"SUMMARY",
verdict,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This value isn't an indicator, please find a different way of present summary information (such as a completely different field in output, only used in this row).

yield (0, (
"SUMMARY",
verdict,
f"Score: {total_score} | Detections: {len(all_detections)}",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is two pieces of information and therefore should be two separate fields. Please don't textually combine two different pieces of data.

@malfav
Copy link
Author

malfav commented Nov 18, 2025 via email

@ikelos
Copy link
Member

ikelos commented Nov 18, 2025

Well, you've created a lot of plugins, and I generally go through them in order so that plugins don't get forgotten and so that people can't jump the queue to the front of the queue. If you have specific plugins you'd like me to review, I can pick those ones out for you. Once they've been reviewed, it's up to you to make the changes to a point that they're acceptable for inclusion and then they'll get merged. If that happens before the code freeze for the next release, then they'll be included in the next release.

So far the code you've been writing has been good, but you've abused the output mechanism to include data to make it more human readable at the expense of programs trying to use volatility as a library. So you'll need to fix up any suggestions (or defend why you feel they're better as they are, and then we look for solutions that keep everybody happy). You can also take on board any comments I make and pre-emptively update your other submissions with those comments in mind, so that when I get time to review them, potentially issues have already been resolved. I hope this explains the process suitably for you? I wouldn't recommend becoming fixated on a specific release. As long as you can resolve any issues identified, they'll likely get merged. Exactly which version they'll make their debut in depends on how quickly that happens, and when the releases and code freezes happen too...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants