diff options
author | clymb3r <bialek.joseph@gmail.com> | 2015-09-30 21:32:04 -0700 |
---|---|---|
committer | clymb3r <bialek.joseph@gmail.com> | 2015-09-30 21:32:04 -0700 |
commit | 235af294aee9587c73bf82feff0566742a72c10b (patch) | |
tree | d9da03c08fe2187cb07e544e606d12bbecbfd8f9 /Exfiltration | |
parent | 2e7dc43edbefec958cde80c7b739386cba3cd557 (diff) | |
download | PowerSploit-235af294aee9587c73bf82feff0566742a72c10b.tar.gz PowerSploit-235af294aee9587c73bf82feff0566742a72c10b.zip |
Fix for multi-processor systems
Fix processor architecture detection for multi-processor systems.
Diffstat (limited to 'Exfiltration')
-rw-r--r-- | Exfiltration/Invoke-Mimikatz.ps1 | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/Exfiltration/Invoke-Mimikatz.ps1 b/Exfiltration/Invoke-Mimikatz.ps1 index 02b1b8d..fc8365b 100644 --- a/Exfiltration/Invoke-Mimikatz.ps1 +++ b/Exfiltration/Invoke-Mimikatz.ps1 @@ -2586,8 +2586,25 @@ $RemoteScriptBlock = { #Load the PE reflectively Write-Verbose "Calling Invoke-MemoryLoadLibrary" - if (((Get-WmiObject -Class Win32_Processor).AddressWidth / 8) -ne [System.Runtime.InteropServices.Marshal]::SizeOf([Type][IntPtr])) + try { + $Processors = Get-WmiObject -Class Win32_Processor + } + catch + { + throw ($_.Exception) + } + + if ($Processors -is [array]) + { + $Processor = $Processors[0] + } else { + $Processor = $Processors + } + + if ( ( $Processor.AddressWidth) -ne (([System.IntPtr]::Size)*8) ) + { + Write-Verbose ( "Architecture: " + $Processor.AddressWidth + " Process: " + ([System.IntPtr]::Size * 8)) Write-Error "PowerShell architecture (32bit/64bit) doesn't match OS architecture. 64bit PS must be used on a 64bit OS." -ErrorAction Stop } |