From 2d5b566da493c8669d05df2e8004f7ba6a2d29d5 Mon Sep 17 00:00:00 2001 From: william341 Date: Thu, 27 Jul 2017 17:27:31 -0700 Subject: hacking p2 --- ShiftOS.Frontend/Hacking/HackableProvider.cs | 5 +++ ShiftOS.Frontend/Hacking/HackerTestCommands.cs | 45 ++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) (limited to 'ShiftOS.Frontend/Hacking') diff --git a/ShiftOS.Frontend/Hacking/HackableProvider.cs b/ShiftOS.Frontend/Hacking/HackableProvider.cs index 6198b0c..5419030 100644 --- a/ShiftOS.Frontend/Hacking/HackableProvider.cs +++ b/ShiftOS.Frontend/Hacking/HackableProvider.cs @@ -26,6 +26,11 @@ namespace ShiftOS.Frontend return JsonConvert.DeserializeObject(Properties.Resources.Payloads); } + public Port[] GetPorts() + { + return JsonConvert.DeserializeObject(Properties.Resources.Ports); + } + public byte[] GetLootFromResource(string resId) { return new byte[] { 0xDE, 0xAD, 0xBE, 0xEF }; //nyi diff --git a/ShiftOS.Frontend/Hacking/HackerTestCommands.cs b/ShiftOS.Frontend/Hacking/HackerTestCommands.cs index 675356a..a72f267 100644 --- a/ShiftOS.Frontend/Hacking/HackerTestCommands.cs +++ b/ShiftOS.Frontend/Hacking/HackerTestCommands.cs @@ -19,6 +19,33 @@ namespace ShiftOS.Frontend } } + [Command("lsexploits")] + public static void ListAllExploits() + { + foreach (var exploit in Hacking.AvailableExploits) + { + Console.WriteLine(exploit.ID + ": " + exploit.FriendlyName); + } + } + + [Command("lspayloads")] + public static void ListAllPayloads() + { + foreach (var exploit in Hacking.AvailablePayloads) + { + Console.WriteLine(exploit.ID + ": " + exploit.FriendlyName); + } + } + + [Command("lsports")] + public static void ListAllPorts() + { + foreach (var exploit in Hacking.AvailablePorts) + { + Console.WriteLine(exploit.ID + ": " + exploit.FriendlyName); + } + } + [Command("describebackable")] [RequiresArgument("id")] public static void DescribeHackable(Dictionary args) @@ -41,6 +68,24 @@ namespace ShiftOS.Frontend Console.WriteLine(hackable.WelcomeMessage); } + [Command("describeport")] + [RequiresArgument("id")] + public static void DescribePort(Dictionary args) + { + string id = args["id"].ToString(); + var port = Hacking.AvailablePorts.FirstOrDefault(x => x.ID == id); + if (port == null) + { + Console.WriteLine("Port not found."); + return; + } + Console.WriteLine(port.FriendlyName); + Console.WriteLine("------------------------"); + Console.WriteLine(); + Console.WriteLine("Port: " + port.Value.ToString()); + Console.WriteLine("Name: " + port.Name); + } + [Command("inithack")] [RequiresArgument("id")] public static void InitHack(Dictionary args) -- cgit v1.2.3