From 5c9f628a32df43e0a38894e811fa650d6c553c7e Mon Sep 17 00:00:00 2001 From: d35ha Date: Thu, 13 Jun 2024 08:55:51 +0000 Subject: [PATCH 1/2] Delay deleting the tool directory at VM-Uninstall-With-Uninstaller --- packages/common.vm/common.vm.nuspec | 2 +- packages/common.vm/tools/vm.common/vm.common.psm1 | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/common.vm/common.vm.nuspec b/packages/common.vm/common.vm.nuspec index 2e381f5cc..d5ad0d313 100755 --- a/packages/common.vm/common.vm.nuspec +++ b/packages/common.vm/common.vm.nuspec @@ -2,7 +2,7 @@ common.vm - 0.0.0.20240607 + 0.0.0.20240612 Common libraries for VM-packages Mandiant diff --git a/packages/common.vm/tools/vm.common/vm.common.psm1 b/packages/common.vm/tools/vm.common/vm.common.psm1 index 680d8fcfc..ba31d8198 100755 --- a/packages/common.vm/tools/vm.common/vm.common.psm1 +++ b/packages/common.vm/tools/vm.common/vm.common.psm1 @@ -791,10 +791,6 @@ function VM-Uninstall-With-Uninstaller { # Remove tool shortcut VM-Remove-Tool-Shortcut $toolName $category - # Remove tool files - $toolDir = Join-Path ${Env:RAW_TOOLS_DIR} $toolName - Remove-Item $toolDir -Recurse -Force -ea 0 | Out-Null - # Attempt to find and execute the uninstaller, may need to use wildcards # See: https://docs.chocolatey.org/en-us/create/functions/get-uninstallregistrykey [array]$key = Get-UninstallRegistryKey -SoftwareName $toolName @@ -821,6 +817,10 @@ function VM-Uninstall-With-Uninstaller { $key | ForEach-Object {VM-Write-Log "WARN" " - $($_.DisplayName)"} VM-Write-Log "WARN" "Now allowing Chocolatey's auto uninstaller a chance to run." } + + # Remove tool files + $toolDir = Join-Path ${Env:RAW_TOOLS_DIR} $toolName + Remove-Item $toolDir -Recurse -Force -ea 0 | Out-Null } function VM-Write-Log-Exception { From c7065fc365648faa002d95768acdb6d2f5e95fef Mon Sep 17 00:00:00 2001 From: d35ha Date: Fri, 14 Jun 2024 09:51:52 +0000 Subject: [PATCH 2/2] Pass the missing category argument to VM-Uninstall-With-Uninstaller --- packages/7zip-15-05.vm/7zip-15-05.vm.nuspec | 2 +- packages/7zip-15-05.vm/tools/chocolateyuninstall.ps1 | 2 +- packages/explorersuite.vm/explorersuite.vm.nuspec | 2 +- packages/explorersuite.vm/tools/chocolateyuninstall.ps1 | 2 +- packages/metasploit.vm/metasploit.vm.nuspec | 2 +- packages/metasploit.vm/tools/chocolateyuninstall.ps1 | 2 +- packages/nmap.vm/nmap.vm.nuspec | 2 +- packages/nmap.vm/tools/chocolateyuninstall.ps1 | 2 +- packages/npcap.vm/npcap.vm.nuspec | 2 +- packages/npcap.vm/tools/chocolateyuninstall.ps1 | 2 +- packages/vbdec.vm/tools/chocolateyuninstall.ps1 | 2 +- packages/vbdec.vm/vbdec.vm.nuspec | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/7zip-15-05.vm/7zip-15-05.vm.nuspec b/packages/7zip-15-05.vm/7zip-15-05.vm.nuspec index 96d7e6b34..551764b13 100644 --- a/packages/7zip-15-05.vm/7zip-15-05.vm.nuspec +++ b/packages/7zip-15-05.vm/7zip-15-05.vm.nuspec @@ -2,7 +2,7 @@ 7zip-15-05.vm - 15.05.0.20240507 + 15.05.0.20240614 Igor Pavlov 7-Zip file archiver. This version is able to extract NSIS scripts. diff --git a/packages/7zip-15-05.vm/tools/chocolateyuninstall.ps1 b/packages/7zip-15-05.vm/tools/chocolateyuninstall.ps1 index 93621f917..cc36a76a8 100644 --- a/packages/7zip-15-05.vm/tools/chocolateyuninstall.ps1 +++ b/packages/7zip-15-05.vm/tools/chocolateyuninstall.ps1 @@ -7,7 +7,7 @@ $category = 'Productivity Tools' VM-Uninstall $toolName $category # Manually silently uninstall -VM-Uninstall-With-Uninstaller "7-Zip 15.05*" "EXE" "/S" +VM-Uninstall-With-Uninstaller "7-Zip 15.05*" $category "EXE" "/S" $extensions = @(".7z", ".bzip2", ".gzip", ".tar", ".wim", ".xz", ".txz", ".zip", ".rar") foreach ($extension in $extensions) { diff --git a/packages/explorersuite.vm/explorersuite.vm.nuspec b/packages/explorersuite.vm/explorersuite.vm.nuspec index a31783c94..9b9c6ca72 100644 --- a/packages/explorersuite.vm/explorersuite.vm.nuspec +++ b/packages/explorersuite.vm/explorersuite.vm.nuspec @@ -2,7 +2,7 @@ explorersuite.vm - 0.0.0.20230925 + 0.0.0.20240614 Erik Pistelli A suite of tools including CFF Explorer and a process viewer. diff --git a/packages/explorersuite.vm/tools/chocolateyuninstall.ps1 b/packages/explorersuite.vm/tools/chocolateyuninstall.ps1 index d27127a3b..8d359ed88 100644 --- a/packages/explorersuite.vm/tools/chocolateyuninstall.ps1 +++ b/packages/explorersuite.vm/tools/chocolateyuninstall.ps1 @@ -9,4 +9,4 @@ foreach ($subtoolName in $subtoolNames) { VM-Remove-From-Right-Click-Menu 'CFF explorer' -VM-Uninstall-With-Uninstaller "Explorer Suite IV" "EXE" "/VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-" +VM-Uninstall-With-Uninstaller "Explorer Suite IV" $category "EXE" "/VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-" diff --git a/packages/metasploit.vm/metasploit.vm.nuspec b/packages/metasploit.vm/metasploit.vm.nuspec index 00987f696..e14ef5de4 100644 --- a/packages/metasploit.vm/metasploit.vm.nuspec +++ b/packages/metasploit.vm/metasploit.vm.nuspec @@ -2,7 +2,7 @@ metasploit.vm - 6.4.13.20240613 + 6.4.13.20240614 Rapid7 A computer security project that provides information about security vulnerabilities, aids in penetration testing, and IDS signature development. diff --git a/packages/metasploit.vm/tools/chocolateyuninstall.ps1 b/packages/metasploit.vm/tools/chocolateyuninstall.ps1 index fe77a7b00..4eb9ffc85 100644 --- a/packages/metasploit.vm/tools/chocolateyuninstall.ps1 +++ b/packages/metasploit.vm/tools/chocolateyuninstall.ps1 @@ -7,7 +7,7 @@ $category = 'Command & Control' VM-Uninstall $toolName $category # Silently uninstall -VM-Uninstall-With-Uninstaller $toolName "MSI" "/q /norestart" +VM-Uninstall-With-Uninstaller $toolName $category "MSI" "/q /norestart" # Remove directory, shortcut, shim VM-Uninstall $toolName $category \ No newline at end of file diff --git a/packages/nmap.vm/nmap.vm.nuspec b/packages/nmap.vm/nmap.vm.nuspec index 4dcf67e90..b6782a566 100644 --- a/packages/nmap.vm/nmap.vm.nuspec +++ b/packages/nmap.vm/nmap.vm.nuspec @@ -2,7 +2,7 @@ nmap.vm - 7.93.20230418.20240102 + 7.93.20230418.20240614 Fyodor, Nmap Project Port scanning utility and nc replacement with extended features diff --git a/packages/nmap.vm/tools/chocolateyuninstall.ps1 b/packages/nmap.vm/tools/chocolateyuninstall.ps1 index 5c38db70e..b896ca4e0 100644 --- a/packages/nmap.vm/tools/chocolateyuninstall.ps1 +++ b/packages/nmap.vm/tools/chocolateyuninstall.ps1 @@ -18,7 +18,7 @@ try { Uninstall-BinFile -Name "zenmap" # Silently uninstall - VM-Uninstall-With-Uninstaller "Nmap*" "EXE" "/S" + VM-Uninstall-With-Uninstaller "Nmap*" $category "EXE" "/S" } catch { VM-Write-Log-Exception $_ } diff --git a/packages/npcap.vm/npcap.vm.nuspec b/packages/npcap.vm/npcap.vm.nuspec index 0d496f0aa..50f4cdad3 100644 --- a/packages/npcap.vm/npcap.vm.nuspec +++ b/packages/npcap.vm/npcap.vm.nuspec @@ -2,7 +2,7 @@ npcap.vm - 1.79.0.20240606 + 1.79.0.20240614 Nmap Project Npcap is an architecture for packet capture and network analysis for Windows operating systems, consisting of a software library and a network driver. diff --git a/packages/npcap.vm/tools/chocolateyuninstall.ps1 b/packages/npcap.vm/tools/chocolateyuninstall.ps1 index 0b5298654..0285f54ca 100644 --- a/packages/npcap.vm/tools/chocolateyuninstall.ps1 +++ b/packages/npcap.vm/tools/chocolateyuninstall.ps1 @@ -1,5 +1,5 @@ $ErrorActionPreference = 'Continue' Import-Module vm.common -Force -DisableNameChecking -VM-Uninstall-With-Uninstaller "Npcap*" "EXE" "/S" +VM-Uninstall-With-Uninstaller "Npcap*" "" "EXE" "/S" diff --git a/packages/vbdec.vm/tools/chocolateyuninstall.ps1 b/packages/vbdec.vm/tools/chocolateyuninstall.ps1 index ff622c553..a3c704898 100644 --- a/packages/vbdec.vm/tools/chocolateyuninstall.ps1 +++ b/packages/vbdec.vm/tools/chocolateyuninstall.ps1 @@ -5,7 +5,7 @@ $toolName = 'vbdec' $category = 'Visual Basic' # Silently uninstall -VM-Uninstall-With-Uninstaller $toolName "EXE" "/VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-" +VM-Uninstall-With-Uninstaller $toolName $category "EXE" "/VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-" # Remove directory, shortcut, shim VM-Uninstall $toolName $category diff --git a/packages/vbdec.vm/vbdec.vm.nuspec b/packages/vbdec.vm/vbdec.vm.nuspec index a032c07a8..45a9403d3 100644 --- a/packages/vbdec.vm/vbdec.vm.nuspec +++ b/packages/vbdec.vm/vbdec.vm.nuspec @@ -2,7 +2,7 @@ vbdec.vm - 1.0.917.20240217 + 1.0.917.20240614 vbGamer45, David Zimmer VBDec works as a VB6 disassembler, PCode debugger, structure viewer for all vb6 executables, and can generate IDA scripts to integrate structures and named function offsets.