mandiant / commando-vm

Complete Mandiant Offensive VM (Commando VM), a fully customizable Windows-based pentesting virtual machine distribution. commandovm@mandiant.com
https://www.mandiant.com/resources/blog/commando-vm-windows-offensive-distribution
Apache License 2.0
6.86k stars 1.28k forks source link

Installation bug - ERROR: Cannot bind argument to parameter 'Path' because it is null. #313

Open jallphin opened 10 months ago

jallphin commented 10 months ago

Describe the bug and expected behavior Installation fails on first reboot AFTER debloat.vm runs. Specific error is:

C:\Windows\system32>Call PowerShell -NoProfile -ExecutionPolicy bypass -command "Import-Module 'C:\ProgramData\boxstarter\Boxstarter.Bootstrapper\boxstarter.bootstrapper.psd1';Invoke-Boxstarter -RebootOk -NoPassword:$False"
Boxstarter Version 3.0.3.0
(c) 2018 Chocolatey Software, Inc, 2012 - 2018 Matt Wrock. https://boxstarter.org

Boxstarter: Disabling Automatic Updates from Windows Update
++ Boxstarter starting Calling Chocolatey to install installer.vm. This may take several minutes to complete...
Chocolatey v2.2.2
Installing the following packages:
installer.vm
By installing, you accept licenses for the packages.
Progress: Downloading installer.vm 0.0.0.20231009... 100%

installer.vm v0.0.0.20231009 (forced)
installer.vm package files install completed. Performing other installation steps.
 *** LOADING BOXSTARTER ***
Boxstarter: *** HELLO WORLD ***
Cannot find path 'C:\ProgramData\_VM\packages.xml' because it does not exist.
2023/10/13 19:06:34 [installer.vm] vm.common.psm1 [+] ERROR : [ERR] Cannot bind argument to parameter 'Path' because it is null.
At C:\ProgramData\chocolatey\lib\installer.vm\tools\chocolateyinstall.ps1:9 char:36
+     $configXml = [xml](Get-Content $configPath)
+                                    ~~~~~~~~~~~
ERROR: Cannot bind argument to parameter 'Path' because it is null.
The install of installer.vm was NOT successful.
Error while running 'C:\ProgramData\chocolatey\lib\installer.vm\tools\chocolateyinstall.ps1'.
 See log for details.

Chocolatey installed 0/1 packages. 1 packages failed.
 See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).

Failures
 - installer.vm (exited -1) - Error while running 'C:\ProgramData\chocolatey\lib\installer.vm\tools\chocolateyinstall.ps1'.
 See log for details.
++ Boxstarter finished Calling Chocolatey to install installer.vm. This may take several minutes to complete... 00:00:15.0862313
True
Boxstarter: Restore Automatic Updates from Windows Update
Boxstarter: Enabling UAC
Type ENTER to exit:

To Reproduce Steps to reproduce the behavior:

  1. Install script using .\install.ps1 -cli <password> in an Administrator Powershell session.

Screenshots image

Version

Additional context To repeat, this happens right after the first reboot, AFTER debloat.vm runs. I believe this is due to this merge - https://github.com/mandiant/commando-vm/pull/306 which renamed packages.xml to config.xml which does exist in the C:\ProgramData\_VM\