In the second part of a two-part series, we will review each of the features in the order outlined above, provide background information about each one, explain their limitations and integrations, and offer installation details with tips on how to utilize them. Supporting graphics will also be included to make it easier to understand.
Reverse Engineering Utilising Windows Sandbox What is Windows Sandbox?
Microsoft introduced a feature called Windows Sandbox in the May 2019 update. It is designed to provide a lightweight desktop environment to run applications in an isolated system. All software and applications installed inside this environment remain sandboxed and run separately from the host machine. All files stored inside Windows Sandbox are temporary; once closed, all files and the state are deleted. However, with the Windows 11 22H2 update, the data will persist through a restart of the environment initiated inside the virtualised system. This new addition is intended to allow the installation of applications that require the OS to reboot.Figure 1. Screenshot showing Windows Sandbox
How to Install It
Windows Sandbox is included in the core versions of Windows 10/11 Pro and Enterprise; it can be setup through the “Turn Windows features on or off” window.Figure 2. Screenshot showing the Windows Features where Sandbox can be enabled or disabled
How Pen testers can use the sandbox
Now that we know what it is, how can this be used for penetration testing? We can use this feature in three ways for penetration testing; first, we can use it for testing thick clients or desktop applications, installing the software to this environment instead of our host machine. Second, if we perform a configuration review, we can use this environment to sign into the organisation accounts and keep them separate from our own. Finally, we can use this environment to test new tools and exploit scripts that require Windows to run without risking or endangering our host machine and network.Figure 3. Screenshot showing a sample configuration file.
This configuration file can be used to control different settings inside the environment, such as:- Enabling or disabling the virtualised GPU
- Enabling or disabling network/internet access for the system
- Specifying which folders on the host machine, if any, it can have access to and whether that access includes read or write permissions.
- Specifying how much memory the system is allowed to utilise.
- Specifying a command to be run whenever the environment is started.
Figure 4. Screenshot showing the environment after using the configuration file.
This environment would have access to a selection of reverse engineering tools hosted in one of the folders we provided read access to. The virtual GPU and network access have been disabled for the environment as well, and we’ve allowed it to access our downloads folder.Reverse Engineering Using Windows Sandbox
With an environment setup like this from the configuration file specified, we can easily install some common reverse engineering tools such as Immunity Debugger or IDA.Figure 5. Screenshot showing the environment after installing Immunity Debugger and IDA
These reverse engineering tools will still work and function as they would on any other Windows environment but are isolated from your host machine in the same way as if you were running a Windows virtual machine inside VMWare or VirtualBox. Below are examples of four reverse engineering tools that can be run and utilized inside the sandbox environment, using Vulnserver as a target .exe file for each.Immunity DebuggerFigure 6. Screenshot showing Immunity Debugger running inside the Sandbox
IDAFigure 7. Screenshot showing IDA running inside the Sandbox
dnSpyFigure 8. Screenshot showing dnSpy running inside the Sandbox
Radare2Figure 9. Screenshot showing Radare2 running inside the Sandbox