Skip to content

Commit fee3b4c

Browse files
author
Matt Graeber
committed
PowerShellMafia#147 Bugfix: Invoke-Mimikatz
Invoke-Mimikatz was not not handling functions exported by ordinal. Thank you @gentilkiwi for the suggested fix!
1 parent 8d46d02 commit fee3b4c

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Exfiltration/Invoke-Mimikatz.ps1

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1687,7 +1687,14 @@ $RemoteScriptBlock = {
16871687
}
16881688
else
16891689
{
1690-
[IntPtr]$NewThunkRef = $Win32Functions.GetProcAddress.Invoke($ImportDllHandle, $ProcedureName)
1690+
if($ProcedureName -is [string])
1691+
{
1692+
[IntPtr]$NewThunkRef = $Win32Functions.GetProcAddress.Invoke($ImportDllHandle, $ProcedureName)
1693+
}
1694+
else
1695+
{
1696+
[IntPtr]$NewThunkRef = $Win32Functions.GetProcAddressOrdinal.Invoke($ImportDllHandle, $ProcedureName)
1697+
}
16911698
}
16921699

16931700
if ($NewThunkRef -eq $null -or $NewThunkRef -eq [IntPtr]::Zero)

0 commit comments

Comments
 (0)