diff --git a/packages/metasploit.vm/metasploit.vm.nuspec b/packages/metasploit.vm/metasploit.vm.nuspec index 3b9d97862..00987f696 100644 --- a/packages/metasploit.vm/metasploit.vm.nuspec +++ b/packages/metasploit.vm/metasploit.vm.nuspec @@ -2,7 +2,7 @@ metasploit.vm - 6.3.30.20230811 + 6.4.13.20240613 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/chocolateyinstall.ps1 b/packages/metasploit.vm/tools/chocolateyinstall.ps1 index 2391c754c..fed38053a 100644 --- a/packages/metasploit.vm/tools/chocolateyinstall.ps1 +++ b/packages/metasploit.vm/tools/chocolateyinstall.ps1 @@ -5,14 +5,35 @@ try { $toolName = 'Metasploit' $category = 'Command & Control' - $exeUrl = 'https://windows.metasploit.com/metasploitframework-latest.msi' - $exeSha256 = '470039711E182C4551169A776AFC8C10B4BAEA1600334449998894B2D725D49A' - # can't install to specified path. + # Download the installer + $packageArgs = @{ + packageName = $env:ChocolateyPackageName + file = Join-Path ${Env:TEMP} 'metasploitframework-latest.msi' + url = 'https://windows.metasploit.com/metasploitframework-latest.msi' + } + $filePath = Get-ChocolateyWebFile @packageArgs + VM-Assert-Path $filePath + VM-Assert-Signature $filePath + + # Install the downloaded installer + $packageArgs = @{ + packageName = $env:ChocolateyPackageName + file = $filePath + fileType = 'MSI' + silentArgs = "/quiet /norestart /l*v `"$($env:TEMP)\$($env:chocolateyPackageName).$($env:chocolateyPackageVersion).MsiInstall.log`"" + } + Install-ChocolateyInstallPackage @packageArgs -ErrorAction SilentlyContinue + $toolDir = Join-Path ${Env:SystemDrive} "metasploit-framework" $binDir = Join-Path $toolDir "bin" $executablePath = (Join-Path $binDir "msfconsole.bat") - VM-Install-With-Installer $toolName $category "MSI" "/q /norestart" $executablePath $exeUrl -sha256 $exeSha256 + dir c:\ + + VM-Assert-Path $executablePath + + VM-Install-Shortcut -toolName $toolName -category $category -executablePath $executablePath + Install-BinFile -Name $toolName -Path $executablePath } catch { VM-Write-Log-Exception $_ }