diff options
Diffstat (limited to 'ShiftOS.Frontend/Hacking')
| -rw-r--r-- | ShiftOS.Frontend/Hacking/HackableProvider.cs | 4 | ||||
| -rw-r--r-- | ShiftOS.Frontend/Hacking/HackingCommands.cs | 51 |
2 files changed, 48 insertions, 7 deletions
diff --git a/ShiftOS.Frontend/Hacking/HackableProvider.cs b/ShiftOS.Frontend/Hacking/HackableProvider.cs index 5419030..e578fb0 100644 --- a/ShiftOS.Frontend/Hacking/HackableProvider.cs +++ b/ShiftOS.Frontend/Hacking/HackableProvider.cs @@ -36,9 +36,9 @@ namespace ShiftOS.Frontend return new byte[] { 0xDE, 0xAD, 0xBE, 0xEF }; //nyi } - public LootInfo[] GetLootInfo() + public Loot[] GetLoot() { - return JsonConvert.DeserializeObject<LootInfo[]>(Properties.Resources.LootInfo); + return JsonConvert.DeserializeObject<Loot[]>(Properties.Resources.LootInfo); } } } diff --git a/ShiftOS.Frontend/Hacking/HackingCommands.cs b/ShiftOS.Frontend/Hacking/HackingCommands.cs index e34bbd5..d07b174 100644 --- a/ShiftOS.Frontend/Hacking/HackingCommands.cs +++ b/ShiftOS.Frontend/Hacking/HackingCommands.cs @@ -18,7 +18,7 @@ namespace ShiftOS.Frontend var hackable = Hacking.AvailableToHack.FirstOrDefault(x => x.ID == id); if (hackable == null) { - Console.WriteLine("[sploitset] device not found on network."); + Console.WriteLine("[connectlib] device not found on network."); return; } Hacking.InitHack(hackable); @@ -31,7 +31,7 @@ namespace ShiftOS.Frontend { if (Hacking.CurrentHackable == null) { - Console.WriteLine("[sploitset] not connected"); + Console.WriteLine("[connectlib] not connected"); } string Port = args["port"].ToString(); string ExploitName = args["id"].ToString(); @@ -63,7 +63,7 @@ namespace ShiftOS.Frontend { if (Hacking.CurrentHackable == null) { - Console.WriteLine("[sploitset] not connected"); + Console.WriteLine("[connectlib] not connected"); } string PayloadName = args["id"].ToString(); var PayloadID = Hacking.AvailablePayloads.FirstOrDefault(x => x.ID == PayloadName); @@ -87,7 +87,7 @@ namespace ShiftOS.Frontend { if (Hacking.CurrentHackable == null) { - Console.WriteLine("[sploitset] not connected"); + Console.WriteLine("[connectlib] not connected"); } foreach (var port in Hacking.CurrentHackable.PortsToUnlock) { @@ -130,7 +130,7 @@ namespace ShiftOS.Frontend { if (Hacking.CurrentHackable == null) { - Console.WriteLine("[sploitset] not connected"); + Console.WriteLine("[connectlib] not connected"); } if (Hacking.CurrentHackable.PayloadExecuted.Count == 0) { @@ -139,5 +139,46 @@ namespace ShiftOS.Frontend } Hacking.FinishHack(); } + + [Command("ftp-list")] + public static void ListAllFTP(Dictionary<string, object> args) + { + if (Hacking.CurrentHackable == null) + { + Console.WriteLine("[connectlib] not connected"); + } + foreach (var loot in Hacking.CurrentHackable.ServerFTPLoot) + { + Console.WriteLine(loot.LootName + ": (assumed: " + loot.FriendlyName + ")" ); + } + } + + [Command("ftp-download")] + [RequiresArgument("file")] + public static void DownloadFTP(Dictionary<string, object> args) + { + if (Hacking.CurrentHackable == null) + { + Console.WriteLine("[connectlib] not connected"); + } + string FindName = args["file"].ToString(); + var LootID = Hacking.AvailableLoot.FirstOrDefault(x => x.LootName == FindName); + if (LootID == null) + { + Console.WriteLine("[SimplFTP] file not found on server."); + return; + } + if (!Hacking.CurrentHackable.ServerFTPLoot.Contains(LootID)) + { + Console.WriteLine("[SimplFTP] file not found on server."); + return; + } + if (!Shiftorium.Buy(FindName, 0)) + { + Console.WriteLine("[SimplFTP] Could not download file. Either the upgrade does not exist or the user doesn't have 0 codepoints (wat)"); + return; + } + Console.WriteLine("[SimplFTP] downloaded file"); + } } } |
