Loading...

Run file, extract zip, share folder directly in Windows Sandbox from right-click - New version

Reply A+ A-

In this post I will show you the new version of my tool Run in Sandbox that allows allows you to run directly a file in a Sandbox from a right-click on it.
You can now extract directly a ZIP file and share a folder in the sandbox.

PreRequisites
- At least Windows 10 1903
- Windows Sandbox feature enabled

What is the purpose ?
1. You want to test a specific PS1 or EXE file in an isolated environment
OR
1. You have downloaded a ZIP but you're not sure of it and you want to open it a secure environment
2. A right-click on this file will display a new context menu, Run in Sandbox
3. Once you click on it, a WSB file will be generated on your desktop with a startup command to run the specific PS1 file
4. Then the Sandbox will be automatically launched with this configuration

Note that this tool is now a part of the Microsoft Windows Sandbox GitHub project, available here.

How to get it ?
Th project is available on GitHub, link below.

What's new ?
- A new script Remove_structure.ps1 allows you to remove all context menus and copied folder.
- Allows you to extract a ZIP directly in a Sandbox
- Allows you to share a folder directly in a Sandbox
- Allows you to choose the path where to save the WSB files
- Add Sandbox icon in the context menu

How to implement it ?
1. Download the file from GitHub
2. Extract the archive
3. Run the file Add_Structure.ps1 to add context menus
4. Context menus will be added for ps1, vbs, exe, zip, msi files and folder
5. A folder Run_in_Sandbox will be copied in C:\ProgramData

How to remove it ?
I also added a script that delete all context menus.
For that just run the Remove_Structure.ps1 file

Sandbox configuration
A config file allows you to apply basic configurations to the Windows Sandbox.
This one called Sandbox_Config.xml
It is located in C:\ProgramData\Run_in_Sandbox
It allows you to set below options:
- Sandbox VGpu option
- Sandbox Networking option
- Sandbox ReadOnlyAccess option for shared folder
- WSB files location

See below an overview:
If the WSB_Location is set to Default, WSB files will be saved in your desktop.
You can type your own location.

Run PS1 in Sandbox
There are two ways
- Run a simple PS1
- Run a PS1 with specific parameters (a GUI will be displayed to type parameters)



Simple PS1
1. Choose the PS1 you want to run in Sandbox
2. Do a right-click on the PS1 file
3. Select Run the PS1 in Sandbox
4. A Sandbox config file will be generated on your desktop using the file name
5. The Sandbox will be automatically launched with the specific configuration

PS1 with parameters
1. Choose the PS1 you want to run in Sandbox
2. Do a right-click on the PS1 file
3. Select Run the PS1 in Sandbox with parameters
4. A GUI will be displayed
5. Type parameters to add to the commandline
6. A Sandbox config file will be generated on your desktop
7. The Sandbox will be automatically launched with the specific configuration

Run EXE in Sandbox
1. Choose the EXE you want to run in Sandbox
2. Do a right-click on the EXE file
3. Select Run the EXE in Sandbox
4. A GUI will be displayed
5. Type switches to add to the commandline
6. A Sandbox config file will be generated on your desktop
7. The Sandbox will be automatically launched with the specific configuration

Run MSI in Sandbox
1. Choose the msi you want to run in Sandbox
2. Do a right-click on the msi file
3. Select Run the msi in Sandbox
4. A GUI will be displayed
5. Type switches to add to the commandline
6. A Sandbox config file will be generated on your desktop
7. The Sandbox will be automatically launched with the specific configuration


Run VBS in Sandbox
There are two ways
- Run a simple VBS
- Run a VBS with specific parameters (a GUI will be displayed to type parameters)


Simple VBS
1. Choose the VBS you want to run in Sandbox
2. Do a right-click on the VBS file
3. Select Run the VBS in Sandbox
4. A Sandbox config file will be generated on your desktop
5. The Sandbox will be automatically launched with the specific configuration

VBS with parameters
1. Choose the VBS you want to run in Sandbox
2. Do a right-click on the VBS file
3. Select Run the VBS in Sandbox with parameters
4. A GUI will be displayed
5. Type parameters to add to the commandline
6. A Sandbox config file will be generated on your desktop
7. The Sandbox will be automatically launched with the specific configuration

Extract ZIP in Sandbox
1. Do a right-click on the ZIP file
2. Click on Extract the ZIP in a Sandbox
3. The Sandbox will be launched and the ZIP file will be eextracted on the desktop


Share folder in Sandbox
1. Do a right-click on or in the folder
2. Click on Share this folder in a Sandbox
3. The Sandbox will be launched and the folder will be shared

Windows_Sandbox 840222028484519697

Enregistrer un commentaire

Accueil item

Award

Learn KQL in one month

Sponsors

You want to support me ?

Mes articles en français

Books in French


Stats