You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 21, 2021. It is now read-only.
#Function written by Matt Graeber, Twitter: @mattifestation, Blog: http://www.exploit-monday.com/
Function Get-ProcAddress
{
Param
(
[OutputType([IntPtr])]
[Parameter( Position=0, Mandatory=$True )]
[String]
$Module,
[Parameter( Position=1, Mandatory=$True )]
[String]
$Procedure
)
# Get a reference to System.dll in the GAC
$SystemAssembly= [AppDomain]::CurrentDomain.GetAssemblies() |
Where-Object { $_.GlobalAssemblyCache-And$_.Location.Split('\\')[-1].Equals('System.dll') }
$UnsafeNativeMethods=$SystemAssembly.GetType('Microsoft.Win32.UnsafeNativeMethods')
# Get a reference to the GetModuleHandle and GetProcAddress methods
$GetModuleHandle=$UnsafeNativeMethods.GetMethod('GetModuleHandle')
$GetProcAddress=$UnsafeNativeMethods.GetMethod('GetProcAddress')
# Get a handle to the module specified
$Kern32Handle=$GetModuleHandle.Invoke($null, @($Module))
$tmpPtr=New-ObjectIntPtr$HandleRef=New-ObjectSystem.Runtime.InteropServices.HandleRef($tmpPtr, $Kern32Handle)
# Return the address of the function
Write-Output$GetProcAddress.Invoke($null, @([System.Runtime.InteropServices.HandleRef]$HandleRef, $Procedure))
}
0x02 system info
WindowsServer2019Datacenter
The text was updated successfully, but these errors were encountered:
0x00 error info
0x01 Get-ProcAddress func details
0x02 system info
The text was updated successfully, but these errors were encountered: