From 0c31550ac4b9e8ecc52d32db118ddda775750d5e Mon Sep 17 00:00:00 2001 From: bwatters-r7 Date: Mon, 31 Aug 2026 10:34:56 -0500 Subject: [PATCH 1/2] Prep for aarch64 support in rex-powershell --- modules/exploits/windows/smb/psexec.rb | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/modules/exploits/windows/smb/psexec.rb b/modules/exploits/windows/smb/psexec.rb index 329797828f0dd..4206c165d4894 100644 --- a/modules/exploits/windows/smb/psexec.rb +++ b/modules/exploits/windows/smb/psexec.rb @@ -66,11 +66,8 @@ def initialize(info = {}) }, 'Platform' => 'win', 'Targets' => [ - # PowerShell isn't offered for AArch64: the PowerShell shellcode-injection - # wrapper (rex-powershell) only knows how to spawn x86/x64 powershell.exe, - # so it can't be used to run AArch64 shellcode. [ 'Automatic', { 'Arch' => [ARCH_X86, ARCH_X64, ARCH_AARCH64] } ], - [ 'PowerShell', { 'Arch' => [ARCH_X86, ARCH_X64] } ], + [ 'PowerShell', { 'Arch' => [ARCH_X86, ARCH_X64, ARCH_AARCH64] } ], [ 'Native upload', { # upload a service executable 'Arch' => [ARCH_X86, ARCH_X64, ARCH_AARCH64], # service executables place the payload within a segment, 1GiB is a practical max in many cases. @@ -159,12 +156,7 @@ def exploit case target.name when 'Automatic' - # The PowerShell delivery path can only launch x86/x64 powershell.exe, so - # an AArch64 payload has to go straight to the native upload technique. - if payload_instance.arch.include?(ARCH_AARCH64) - print_status('Selecting native target') - native_upload_with_workaround(smbshare) - elsif powershell_installed?(smbshare, datastore['PSH_PATH']) + if powershell_installed?(smbshare, datastore['PSH_PATH']) print_status('Selecting PowerShell target') execute_powershell_payload else From 2b9c908eda75ca03f04d08a0bffb1c981815bfb2 Mon Sep 17 00:00:00 2001 From: bwatters-r7 Date: Mon, 31 Aug 2026 16:35:20 -0500 Subject: [PATCH 2/2] Update rex-powershell --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 9b0075c2fb4d9..a2decde1e84e8 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -538,7 +538,7 @@ GEM rex-arch rex-ole (0.1.9) rex-text - rex-powershell (0.1.103) + rex-powershell (0.1.105) bigdecimal rex-random_identifier rex-text