diff options
author | Matt Graeber <mattgraeber@gmail.com> | 2015-09-30 22:07:56 -0700 |
---|---|---|
committer | Matt Graeber <mattgraeber@gmail.com> | 2015-09-30 22:07:56 -0700 |
commit | 9f78286ea7b0ec65d2aa09893a076864dd8d14e9 (patch) | |
tree | fc68c81f32a44c893a16849baab858ef1667c7c9 /Exfiltration | |
parent | 03ed2adb56a608a6e10cda8b924d76f5a3f0147f (diff) | |
parent | 235af294aee9587c73bf82feff0566742a72c10b (diff) | |
download | PowerSploit-9f78286ea7b0ec65d2aa09893a076864dd8d14e9.tar.gz PowerSploit-9f78286ea7b0ec65d2aa09893a076864dd8d14e9.zip |
Merge pull request #77 from clymb3r/master
Fix 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 } |