From 5b9f1c7818792c8d206d0aa303205c84c3ef175b Mon Sep 17 00:00:00 2001 From: dledda-r7 Date: Thu, 21 Aug 2025 04:06:18 -0400 Subject: [PATCH 1/5] fix: update CI for meterpreter vs2022 --- .../shared_meterpreter_acceptance.yml | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/.github/workflows/shared_meterpreter_acceptance.yml b/.github/workflows/shared_meterpreter_acceptance.yml index 18798c7a9ae36..3cc68dbf2b9e2 100644 --- a/.github/workflows/shared_meterpreter_acceptance.yml +++ b/.github/workflows/shared_meterpreter_acceptance.yml @@ -269,12 +269,24 @@ jobs: working-directory: metasploit-payloads - name: Build Windows payloads via Visual Studio 2022 Build (Windows) - shell: cmd + shell: pwsh if: ${{ matrix.meterpreter.name == 'windows_meterpreter' && matrix.os == 'windows-2022' && inputs.build_metasploit_payloads }} run: | - cd c/meterpreter - git submodule init && git submodule update - make.bat + Set-Location "C:\Program Files (x86)\Microsoft Visual Studio\Installer\" + dir + $InstallPath = "C:\Program Files\Microsoft Visual Studio\2022\Enterprise" + $WorkLoads = '--config "D:\a\metasploit-payloads\metasploit-payloads\metasploit-payloads\c\meterpreter\vs-configs\vs2022.vsconfig"' + $Arguments = ('/c', "vs_installer.exe", 'modify', '--installPath', "`"$InstallPath`"", $WorkLoads, '--quiet', '--norestart', '--nocache') + $process = Start-Process -FilePath cmd.exe -ArgumentList $Arguments -Wait -PassThru -WindowStyle Hidden + if ($process.ExitCode -eq 0) { + Write-Host "components have been successfully added" + } else { + Write-Host "components were not installed" + exit 1 + } + Set-Location "D:\a\metasploit-payloads\metasploit-payloads\metasploit-payloads\c\meterpreter" + Start-Process -FilePath cmd.exe -ArgumentList ('/c', 'git', 'submodule', 'init', '&&', 'git', 'submodule', 'update') -Wait -PassThru -WindowStyle Hidden + Start-Process -FilePath cmd.exe -ArgumentList ('/c', '"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat"', '&&', 'make.bat') -Wait -PassThru -WindowStyle Hidden working-directory: metasploit-payloads - name: Build Windows payloads via Visual Studio 2025 Build (Windows) From 85c65bd48fc8b820ffd97b171a894c319c43377f Mon Sep 17 00:00:00 2001 From: dledda-r7 Date: Mon, 15 Sep 2025 08:04:35 -0400 Subject: [PATCH 2/5] fix: replace Start-Process with Invoke-Command in meterpreter acceptance --- .github/workflows/shared_meterpreter_acceptance.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/shared_meterpreter_acceptance.yml b/.github/workflows/shared_meterpreter_acceptance.yml index 3cc68dbf2b9e2..cad6aaf4ac061 100644 --- a/.github/workflows/shared_meterpreter_acceptance.yml +++ b/.github/workflows/shared_meterpreter_acceptance.yml @@ -285,8 +285,8 @@ jobs: exit 1 } Set-Location "D:\a\metasploit-payloads\metasploit-payloads\metasploit-payloads\c\meterpreter" - Start-Process -FilePath cmd.exe -ArgumentList ('/c', 'git', 'submodule', 'init', '&&', 'git', 'submodule', 'update') -Wait -PassThru -WindowStyle Hidden - Start-Process -FilePath cmd.exe -ArgumentList ('/c', '"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat"', '&&', 'make.bat') -Wait -PassThru -WindowStyle Hidden + Invoke-Command -FilePath cmd.exe -ArgumentList ('/c', 'git', 'submodule', 'init', '&&', 'git', 'submodule', 'update') + Invoke-Command -FilePath cmd.exe -ArgumentList ('/c', '"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat"', '&&', 'make.bat') working-directory: metasploit-payloads - name: Build Windows payloads via Visual Studio 2025 Build (Windows) From b30c3e32c6e8f74afe4609c1e7326fb5cf9e4549 Mon Sep 17 00:00:00 2001 From: dledda-r7 Date: Mon, 15 Sep 2025 08:53:39 -0400 Subject: [PATCH 3/5] fix: replace Start-Process with Invoke-Command in meterpreter acceptance --- .github/workflows/shared_meterpreter_acceptance.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/shared_meterpreter_acceptance.yml b/.github/workflows/shared_meterpreter_acceptance.yml index cad6aaf4ac061..6664cfd47dfea 100644 --- a/.github/workflows/shared_meterpreter_acceptance.yml +++ b/.github/workflows/shared_meterpreter_acceptance.yml @@ -285,8 +285,8 @@ jobs: exit 1 } Set-Location "D:\a\metasploit-payloads\metasploit-payloads\metasploit-payloads\c\meterpreter" - Invoke-Command -FilePath cmd.exe -ArgumentList ('/c', 'git', 'submodule', 'init', '&&', 'git', 'submodule', 'update') - Invoke-Command -FilePath cmd.exe -ArgumentList ('/c', '"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat"', '&&', 'make.bat') + Invoke-Command -ScriptBlock { cmd.exe /c git submodule init && git submodule update } + Invoke-Command -ScriptBlock { cmd.exe /c "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat" && make.bat } working-directory: metasploit-payloads - name: Build Windows payloads via Visual Studio 2025 Build (Windows) From 7be73c59e990694fe09cfb7427fd8cf1f5d08df2 Mon Sep 17 00:00:00 2001 From: dledda-r7 Date: Mon, 15 Sep 2025 09:33:54 -0400 Subject: [PATCH 4/5] fix: replace Start-Process with Invoke-Command in meterpreter acceptance --- .github/workflows/shared_meterpreter_acceptance.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/shared_meterpreter_acceptance.yml b/.github/workflows/shared_meterpreter_acceptance.yml index 6664cfd47dfea..9fc899f6b7a94 100644 --- a/.github/workflows/shared_meterpreter_acceptance.yml +++ b/.github/workflows/shared_meterpreter_acceptance.yml @@ -285,8 +285,10 @@ jobs: exit 1 } Set-Location "D:\a\metasploit-payloads\metasploit-payloads\metasploit-payloads\c\meterpreter" - Invoke-Command -ScriptBlock { cmd.exe /c git submodule init && git submodule update } - Invoke-Command -ScriptBlock { cmd.exe /c "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat" && make.bat } + $r = Invoke-Command -ScriptBlock { cmd.exe /c git submodule init && git submodule update } + Write-Host $r + $r = Invoke-Command -ScriptBlock { cmd.exe /c "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat" && make.bat } + Write-Host $r working-directory: metasploit-payloads - name: Build Windows payloads via Visual Studio 2025 Build (Windows) From 20345c22347831f14fd2ecf82203f6db8853cf3f Mon Sep 17 00:00:00 2001 From: dledda-r7 Date: Mon, 15 Sep 2025 10:12:45 -0400 Subject: [PATCH 5/5] fix: replace Start-Process with Invoke-Command in meterpreter acceptance --- .github/workflows/shared_meterpreter_acceptance.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/shared_meterpreter_acceptance.yml b/.github/workflows/shared_meterpreter_acceptance.yml index 9fc899f6b7a94..956d5fd4b0728 100644 --- a/.github/workflows/shared_meterpreter_acceptance.yml +++ b/.github/workflows/shared_meterpreter_acceptance.yml @@ -285,9 +285,9 @@ jobs: exit 1 } Set-Location "D:\a\metasploit-payloads\metasploit-payloads\metasploit-payloads\c\meterpreter" - $r = Invoke-Command -ScriptBlock { cmd.exe /c git submodule init && git submodule update } + $r = Invoke-Command -ScriptBlock { cmd.exe /c 'git submodule init && git submodule update' } Write-Host $r - $r = Invoke-Command -ScriptBlock { cmd.exe /c "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat" && make.bat } + $r = Invoke-Command -ScriptBlock { cmd.exe /c '"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat" && make.bat' } Write-Host $r working-directory: metasploit-payloads