Windows Sandbox
Software installed inside the Windows Sandbox environment remains “sandboxed” and runs separately from the host machine.
Windows Sandbox is a lightweight desktop environment to test and run suspicious applications safely. Windows Sandbox runs applications in isolation. Software installed inside the Windows Sandbox environment remains “sandboxed” and runs separately from the host machine. Software and applications installed on the host aren’t directly available in the Sandbox.
A sandbox is a temporary and non-persistent instance of Windows OS, and after it is closed by the user, the OS, by default, deletes all software and programs, and there is no trace left. When the user starts another instance of the Sandbox, the OS opens up a pristine copy of the Sandbox.
The user will get a brand-new sandbox instance when they open the application.
Note, however, that as of Windows 11 Build 22509, one can set the Sandbox to be persistent between restarts. If the use case demands it, this may be an excellent option to leverage, for instance, when installing applications that require the OS to reboot.
Windows Sandbox has the following properties: [1]
- Part of Windows: Everything required for this feature is included in Windows 10 Pro and Enterprise. There’s no need to download a VHD.
- Pristine: Every time Windows Sandbox runs, it’s as clean as a brand-new installation of Windows.
- Disposable: Nothing persists on the device. OS discards everything when the user closes the Sandbox application.
- Secure: Uses hardware-based virtualization for kernel isolation. It relies on the Microsoft hypervisor to run a separate kernel that isolates Windows Sandbox from the host.
- Efficient: Uses the integrated kernel scheduler, innovative memory management, and virtual GPU.
The often-asked question is, can malware analysis be done on one of these sandboxes?
It depends.
While the environment may not be suitable for all types of malware, malware analysis is possible so long as the Sandbox is hardened and configured correctly.
And to that end, Windows sandbox supports configuration files, and the user can then set initial parameters such as:
- Networking: Enable or disable network access within the Sandbox.
- Mapped folders: Share folders from the host with read or write permissions.
- Clipboard redirection: Shares the host clipboard with the Sandbox.
Please refer to the following link for a list of all parameters. [2]
We can also run the Sandbox in a nested virtualization environment for additional protection. And in this case, the user must run the following command ‘Set-VMProcessor -VMName \<VMName> -ExposeVirtualizationExtensions $true’ to indicate this setup.
So, for instance, the user can run the Windows sandbox inside a Hyper-V virtual machine ending up in a nested virtualization setup. [3]
As it is, the analyst can use Windows Sandbox for the following types of analyses:
- Unpacking packed binaries with x64dbg and Process Hacker
- Understanding packed binaries and unpacking them.
- Decompiling and Disassembling
- Deobfuscating PowerShell, JScript, and VBScript
- To check static properties.
Note: Windows sandbox is available only for Pro and Enterprise.
Here are the steps to enable Windows sandbox:
Get Rajanikanth Sugumar’s stories in your inbox
Join Medium for free to get updates from this writer.
Click on the start menu and start typing ‘features,’ and when ‘Turn Windows Features on or off’ appears, click on it.
Next, select ‘Windows Sandbox’ and click OK. After restarting the computer, search ‘Windows Sandbox’ and click on it.
What you see is the ‘Windows Sandbox’ with the default options.
However, as mentioned earlier, you can customize parameters such as networking and shared folders, among other possibilities. For instance, enabling networking can expose untrusted applications to the internal network.
Disabling the network can be accomplished by adding the following parameter in the config file.
<Networking>Disable</Networking>
Please see the Microsoft link for a list of options. [2]
Here is my custom parameters list.
<!-- MyConfigFile.wsb -->
<Configuration>
<VGpu>Enable</VGpu>
<MemoryInMB>6000</MemoryInMB> <!-- You can change it and check-->
<Networking>Default</Networking> <!-- Default is on, Disable is off-->
<MappedFolders>
<MappedFolder>
<HostFolder></HostFolder>
<SandboxFolder></SandboxFolder>
<ReadOnly></ReadOnly>
</MappedFolder>
</MappedFolders>
<LogonCommand>
</LogonCommand>
<AudioInput>Disable</AudioInput>
<VideoInput>Default</VideoInput>
<ProtectedClient>Default</ProtectedClient>
<PrinterRedirection>Default</PrinterRedirection>
<ClipboardRedirection>Disable</ClipboardRedirection>
</Configuration>After inputting this information, please save this file with the .wsb extension, and then it can be double-clicked to open or right-clicked and select ‘Open with’ Windows sandbox.
We can check the memory, network, clipboard redirection, etc., to confirm that the changes have taken effect as per the config file.
wmic computersystem get totalphysicalmemoryConclusion
Windows Sandbox may not be suitable for complex malware analysis. However, for a rudimentary investigation, this tool can come in handy; also, many malicious codes that can detect other VMs, such as Virtual Box or VMware, would have a hard time catching windows Sandbox.
The most significant advantage of this sandbox solution is that one can get an extremely well-hardened sandbox solution with close to zero effort.
Bonus — Secure Web Browsing
Edge Application Guard can be installed for secure browsing and checking out URLs without fear of drive-by downloads. Designed for Windows 10/11 and Microsoft Edge, Application Guard uses a hardware isolation approach. This approach lets untrusted site navigation launch inside a container. And thereby ensuring no unsafe applications are downloaded. In addition, there is no connection between the host and the isolated container.
The use case for this option would be when we need to browse a URL to see if it is malicious or take screenshots for analysis and reporting purposes.
Here is how to enable Application Guard:
References
- https://learn.microsoft.com/en-us/windows/security/threat-protection/windows-sandbox/windows-sandbox-overview
- https://learn.microsoft.com/en-us/windows/security/threat-protection/windows-sandbox/windows-sandbox-configure-using-wsb-file#networking
- https://learn.microsoft.com/en-us/virtualization/hyper-v-on-windows/user-guide/nested-virtualization
- https://medium.com/@maarten.goet/how-windows-1903-makes-malware-analysis-easier-introducing-windows-sandbox-3ec791c8367










