├── README.md ├── VBoxCloak.ps1 └── LICENSE /README.md: -------------------------------------------------------------------------------- 1 | # VBoxCloak 2 | 3 | A PowerShell script that attempts to help malware analysts hide their VirtualBox Windows VM's from malware that may be trying to evade analysis. Guaranteed to bring down your pafish ratings by at least a few points ;) 4 | 5 | The script accomplishes this by doing the following: 6 | 7 | - Renames several registry keys that malware typically uses for VM detection. 8 | - Kills VirtualBox processes (VBoxService and VBoxTray, etc.). 9 | - Deletes VirtualBox driver files (this will not crash VirtualBox, since these drivers are loaded into memory anyway!). 10 | - Deletes or renames VirtualBox supporting files in System32 and SysWOW64 directories. 11 | 12 | For more info, see my blog post here: 13 | https://securityliterate.com/hiding-virtual-machines-from-malware-introducing-vmwarecloak-vboxcloak/ 14 | 15 | Note: This script will not cover ALL VM detection techniques! There are a lot of ways to detect a VM, and many of these cannot be fixed with a simple Powershell script. For example, techniques such as RDTSC and timing detection are not covered, neither is CPUID detection. 16 | 17 | Tested on Windows 7 and Windows 10 - Probably works on Windows XP and Windows 11 as well. 18 | 19 | Spot any bugs? Let me know! 20 | 21 | # Usage 22 | 23 | 1. Simply run VBoxCloak.ps1 as Administrator on your Windows VirtualBox VM. 24 | 2. Detonate your malware. Profit. 25 | 3. When done, reset your VM to clean state. 26 | 27 | Usage examples: 28 | 29 | Make registry changes, remove VBox files, and kill VBox processes: 30 | 31 | - "VBoxCloak.ps1 -all" 32 | 33 | Just make registry modificaitons: 34 | 35 | - "VBoxCloak.ps1 -reg" 36 | 37 | Just remove VBox files: 38 | 39 | - "VBoxCloak.ps1 -files" 40 | 41 | Just kill VBox processes: 42 | 43 | - "VBoxCloak.ps1 -procs" 44 | 45 | # Warnings & Disclaimers 46 | 47 | - This code is in Beta. I know I could have coded it better, but sometimes quick and dirty is best. 48 | - Use at your own risk! Use only in a VM, and NOT on your host. 49 | - Ensure to make a snapshot of your VM before running this. 50 | - Using the "files" and/or "procs" command line arguments may result in lower VM performance. This is because this script removes several files that are required for supporting functions such as graphics, keyboard input, etc. Just revert VM to clean state if this messes anything up. 51 | 52 | -------------------------------------------------------------------------------- /VBoxCloak.ps1: -------------------------------------------------------------------------------- 1 | ################################################# 2 | ## VBoxCloak.ps1: A script that attempts to hide the VirtualBox hypervisor from malware by modifying registry keys, killing associated processes, and removing uneeded driver/system files. 3 | ## Written and tested on Windows 7 and Windows 10. Should work for Windows 11 as well! 4 | ## Many thanks to pafish for some of the ideas - https://github.com/a0rtega/pafish 5 | ################################################## 6 | ## Author: d4rksystem (Kyle Cucci) 7 | ## Version: 0.7 (July 2025) 8 | ################################################## 9 | 10 | # Define command line parameters 11 | param ( 12 | [switch]$all = $false, 13 | [switch]$reg = $false, 14 | [switch]$procs = $false, 15 | [switch]$files = $false 16 | ) 17 | 18 | if ($all) { 19 | $reg = $true 20 | $procs = $true 21 | $files = $true 22 | } 23 | 24 | # Menu / Helper stuff 25 | Write-Output "VBoxCloak.ps1 by @d4rksystem (Kyle Cucci)" 26 | Write-Output "Usage: VBoxCloak.ps1 -