1
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:
OJ 2016-03-23 15:25:17 +10:00
parent b32fd52bfd
commit 64c57f203b
3 changed files with 1073 additions and 1001 deletions

View File

@ -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];

View File

@ -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();
}
}
}