diff --git a/.vs/BadPotato/v16/.suo b/.vs/BadPotato/v16/.suo index 77b1d3c..9724570 100644 Binary files a/.vs/BadPotato/v16/.suo and b/.vs/BadPotato/v16/.suo differ diff --git a/.vs/VSWorkspaceState.json b/.vs/VSWorkspaceState.json index 085b8da..63491a0 100644 --- a/.vs/VSWorkspaceState.json +++ b/.vs/VSWorkspaceState.json @@ -3,7 +3,9 @@ "", "\\obj", "\\obj\\Release", - "\\Properties" + "\\Properties", + "\\RPC" ], + "SelectedNode": "\\BadPotato.csproj", "PreviewInSolutionExplorer": false } \ No newline at end of file diff --git a/.vs/slnx.sqlite b/.vs/slnx.sqlite index eee4eb2..8b1663b 100644 Binary files a/.vs/slnx.sqlite and b/.vs/slnx.sqlite differ diff --git a/BadPotato.csproj b/BadPotato.csproj index 722bda9..9580ab3 100644 --- a/BadPotato.csproj +++ b/BadPotato.csproj @@ -35,6 +35,7 @@ + diff --git a/Program.cs b/Program.cs index 027f580..4f04fd8 100644 --- a/Program.cs +++ b/Program.cs @@ -9,6 +9,7 @@ using System.Threading; using System.Reflection; using System.Collections.Generic; using static PingCastle.RPC.rprn; +using System.Management.Automation.Runspaces; class Entry { @@ -22,6 +23,10 @@ class Entry public static void pwncat( Assembly stage2) { ProtocolError = stage2.GetType("stagetwo.Protocol.ProtocolError"); stagetwo = stage2; + + // Give the PowerShell context an understanding of our C# functions + var runspace = (Runspace)stagetwo.GetType("stagetwo.PowerShell").GetField("runspace", BindingFlags.Public | BindingFlags.Static).GetValue(null); + runspace.SessionStateProxy.SetVariable("RPCAPI", typeof(BadPotato)); } } @@ -72,7 +77,7 @@ class BadPotato throw (Exception)Activator.CreateInstance(Entry.ProtocolError,new object[] { exc.ErrorCode, exc.Message }); } - public static Dictionary bad_potato() + public static Dictionary run() { SECURITY_ATTRIBUTES securityAttributes = new SECURITY_ATTRIBUTES(); string pipeName = Guid.NewGuid().ToString("N"); diff --git a/bin/Release/BadPotato.dll b/bin/Release/BadPotato.dll index 1114a1a..50b8215 100644 Binary files a/bin/Release/BadPotato.dll and b/bin/Release/BadPotato.dll differ diff --git a/bin/Release/BadPotato.dll.obfuscated b/bin/Release/BadPotato.dll.obfuscated new file mode 100644 index 0000000..33e5499 Binary files /dev/null and b/bin/Release/BadPotato.dll.obfuscated differ diff --git a/bin/Release/StrongVM/BadPotato.dll b/bin/Release/StrongVM/BadPotato.dll new file mode 100644 index 0000000..e2ed214 Binary files /dev/null and b/bin/Release/StrongVM/BadPotato.dll differ diff --git a/bin/Release/StrongVM/BadPotato.dll.config b/bin/Release/StrongVM/BadPotato.dll.config new file mode 100644 index 0000000..72a71af --- /dev/null +++ b/bin/Release/StrongVM/BadPotato.dll.config @@ -0,0 +1,6 @@ + + + + + + diff --git a/bin/Release/StrongVM/StrongVMRTx64.dll b/bin/Release/StrongVM/StrongVMRTx64.dll new file mode 100644 index 0000000..4332f7c Binary files /dev/null and b/bin/Release/StrongVM/StrongVMRTx64.dll differ diff --git a/bin/Release/StrongVM/StrongVMRTx86.dll b/bin/Release/StrongVM/StrongVMRTx86.dll new file mode 100644 index 0000000..5977bf9 Binary files /dev/null and b/bin/Release/StrongVM/StrongVMRTx86.dll differ diff --git a/obj/Debug/BadPotato.csproj.AssemblyReference.cache b/obj/Debug/BadPotato.csproj.AssemblyReference.cache index 34e7bc6..f5e894a 100644 Binary files a/obj/Debug/BadPotato.csproj.AssemblyReference.cache and b/obj/Debug/BadPotato.csproj.AssemblyReference.cache differ diff --git a/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache index 10404b1..17cb656 100644 Binary files a/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache and b/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ diff --git a/obj/Release/BadPotato.dll b/obj/Release/BadPotato.dll index 1114a1a..50b8215 100644 Binary files a/obj/Release/BadPotato.dll and b/obj/Release/BadPotato.dll differ