Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when Running Mimikatz #38

Closed
aktibista opened this issue May 25, 2018 · 7 comments
Closed

Error when Running Mimikatz #38

aktibista opened this issue May 25, 2018 · 7 comments

Comments

@aktibista
Copy link

aktibista commented May 25, 2018

Hostname: win8
Command Line: powershell -command -
StdIn: [[powerkatz]] Invoke-Mimikatz -Command "privilege::debug sekurlsa::logonPasswords exit"
StdOut:
Exception calling "GetMethod" with "1" argument(s): "Ambiguous match found."
At line:886 char:6

  •     $GetProcAddress = $UnsafeNativeMethods.GetMethod('GetProcAddr ...
    
  •     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [], MethodInvocationException
    • FullyQualifiedErrorId : AmbiguousMatchException
@dm-mitre
Copy link
Contributor

This seems like a bug in PowerShell MimiKatz. We may need to upgrade the version.

@CG-root
Copy link

CG-root commented Jun 10, 2018

It seems that the issue starts from Windows 10 latest major update in April (Version 1803).

@CG-root
Copy link

CG-root commented Jun 10, 2018

I think I have solved it.

Change the following line:
$GetProcAddress = $UnsafeNativeMethods.GetMethod('GetProcAddress')

To

$GetProcAddress = $UnsafeNativeMethods.GetMethod('GetProcAddress', [reflection.bindingflags] "Public,Static", $null, [System.Reflection.CallingConventions]::Any, @((New-Object System.Runtime.InteropServices.HandleRef).GetType(), [string]), $null);

Let me know if this solves the issue

@aktibista
Copy link
Author

I confirm that the solution works!

@unkempthenry
Copy link
Contributor

Unsure if the above script change only works on Windows 8.1 and not 10 (see #47 ). We should probably update Powersploit and mimiktaz across the board.

@wyncollier
Copy link

CG-Root is a God. I can verify that the fix works on line 886.

@unkempthenry
Copy link
Contributor

0b2c9e0 uses the latest version of Invoke-Mimikatz from Empire, I believe that this should solve this problem for new installs. Thanks everyone for digging into this!

pwndad added a commit to pwndad/PowerSploit that referenced this issue Aug 31, 2018
Cobalt got the same "ambiguous" powershell issue, since they use your code:
https://blog.cobaltstrike.com/2018/05/24/powershell-shellcode-injection-on-win-10-v1803/

However, this genious fix from @CG-root for Invoke-Mimikatz solves the issue for Invoke-Shellcode as well:
mitre/caldera#38 (comment)
rtodora added a commit to rtodora/PowerSploit that referenced this issue Jan 28, 2019
Changed to work on patched win10 systems, line 886 from previous, per this post: mitre/caldera#38
gg-sec pushed a commit to gg-sec/update_invoke_mimikatz that referenced this issue Apr 6, 2020
breaktoprotect added a commit to breaktoprotect/stager that referenced this issue Oct 2, 2020
hkd3 added a commit to hkd3/Empire that referenced this issue Nov 13, 2020
hkd3 added a commit to hkd3/PowerSploit that referenced this issue Nov 13, 2020
dutragustavo added a commit to dutragustavo/PowerSploit that referenced this issue Jan 11, 2021
armysick added a commit to armysick/Empire that referenced this issue Jan 12, 2021
mp4383 pushed a commit to mp4383/Empire that referenced this issue Aug 6, 2021
ColeHouston added a commit to ColeHouston/PowerSploit that referenced this issue Jan 10, 2022
Used the fix for the ambiguous GetProcAddress match as given here: mitre/caldera#38
Also changed the function name in case that helps in avoiding any red flags from AV
jlangdev added a commit to jlangdev/EDRDemoTools that referenced this issue Jan 12, 2022
gfctam added a commit to gfctam/PowerSploit that referenced this issue May 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants