mirror of
https://github.com/rapid7/metasploit-payloads
synced 2025-01-08 14:36:22 +01:00
Add the last few features to the User binding
This commit is contained in:
parent
b32fd52bfd
commit
64c57f203b
File diff suppressed because it is too large
Load Diff
@ -6,7 +6,7 @@
|
||||
#ifndef _METERPRETER_SOURCE_EXTENSION_POWERSHELL_RUNNER_H
|
||||
#define _METERPRETER_SOURCE_EXTENSION_POWERSHELL_RUNNER_H
|
||||
|
||||
#define PSHRUNNER_DLL_LEN 22016
|
||||
#define PSHRUNNER_DLL_LEN 22528
|
||||
|
||||
extern unsigned char PowerShellRunnerDll[PSHRUNNER_DLL_LEN];
|
||||
|
||||
|
@ -24,5 +24,34 @@
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static string GetSid()
|
||||
{
|
||||
System.Diagnostics.Debug.Write("[PSH BINDING] Invoking binding call GetSid");
|
||||
|
||||
Tlv tlv = new Tlv();
|
||||
|
||||
var result = Core.InvokeMeterpreterBinding(true, tlv.ToRequest("stdapi_sys_config_getsid"));
|
||||
|
||||
if (result != null)
|
||||
{
|
||||
var responseTlv = Tlv.FromResponse(result);
|
||||
if (responseTlv[TlvType.Result].Count > 0 &&
|
||||
(int)responseTlv[TlvType.Result][0] == 0)
|
||||
{
|
||||
return (string)responseTlv[TlvType.Sid][0];
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
public static bool IsSystem()
|
||||
{
|
||||
System.Diagnostics.Debug.Write("[PSH BINDING] Invoking binding call IsSystem");
|
||||
|
||||
return SystemSID == GetSid();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user