diff options
| author | RogueAI42 <[email protected]> | 2017-07-31 19:44:51 +1000 |
|---|---|---|
| committer | RogueAI42 <[email protected]> | 2017-07-31 19:44:51 +1000 |
| commit | 23bd15d7cf7522fb05a5f2ea8e0a89d3a80efdc8 (patch) | |
| tree | fa5dc08a89014d79565f30b22c94403845239cc3 /ShiftOS.Frontend/Hacking | |
| parent | d953797369cd72a718b801e0036ce9ebb181f24f (diff) | |
| parent | 6366721315d8a62febeb5c0c0340f15ab7d35963 (diff) | |
| download | shiftos_thereturn-23bd15d7cf7522fb05a5f2ea8e0a89d3a80efdc8.tar.gz shiftos_thereturn-23bd15d7cf7522fb05a5f2ea8e0a89d3a80efdc8.tar.bz2 shiftos_thereturn-23bd15d7cf7522fb05a5f2ea8e0a89d3a80efdc8.zip | |
Merge remote-tracking branch 'upstream/monogame' into monogame
Diffstat (limited to 'ShiftOS.Frontend/Hacking')
| -rw-r--r-- | ShiftOS.Frontend/Hacking/HackerTestCommands.cs | 3 | ||||
| -rw-r--r-- | ShiftOS.Frontend/Hacking/HackingCommands.cs | 44 |
2 files changed, 45 insertions, 2 deletions
diff --git a/ShiftOS.Frontend/Hacking/HackerTestCommands.cs b/ShiftOS.Frontend/Hacking/HackerTestCommands.cs index 1b6a1c1..72c648e 100644 --- a/ShiftOS.Frontend/Hacking/HackerTestCommands.cs +++ b/ShiftOS.Frontend/Hacking/HackerTestCommands.cs @@ -10,6 +10,7 @@ namespace ShiftOS.Frontend { public static class HackerTestCommands { + [ShellConstraint("shiftos_debug> ")] [Command("lsports")] public static void ListAllPorts() { @@ -19,6 +20,7 @@ namespace ShiftOS.Frontend } } + [ShellConstraint("shiftos_debug> ")] [Command("describehackable")] [RequiresArgument("id")] public static void DescribeHackable(Dictionary<string, object> args) @@ -41,6 +43,7 @@ namespace ShiftOS.Frontend Console.WriteLine(hackable.WelcomeMessage); } + [ShellConstraint("shiftos_debug> ")] [Command("describeport")] [RequiresArgument("id")] public static void DescribePort(Dictionary<string, object> args) diff --git a/ShiftOS.Frontend/Hacking/HackingCommands.cs b/ShiftOS.Frontend/Hacking/HackingCommands.cs index d07b174..9ebb824 100644 --- a/ShiftOS.Frontend/Hacking/HackingCommands.cs +++ b/ShiftOS.Frontend/Hacking/HackingCommands.cs @@ -9,8 +9,21 @@ namespace ShiftOS.Frontend { class HackingCommands { + [Command("sploitset")] + public static void SploitSetEnter(Dictionary<string, object> args) + { + TerminalBackend.SetShellOverride("sploitset> "); + } + + [Command("ftp")] + public static void FTPEnter(Dictionary<string, object> args) + { + TerminalBackend.SetShellOverride("SimplFTP> "); + } + //TODO: Implement firewall cracking [Command("connect")] + [MetaCommand] [RequiresArgument("id")] public static void Connect(Dictionary<string, object> args) { @@ -25,6 +38,7 @@ namespace ShiftOS.Frontend } [Command("exploit")] + [ShellConstraint("sploitset> ")] [RequiresArgument("id")] [RequiresArgument("port")] public static void Exploit(Dictionary<string, object> args) @@ -32,6 +46,7 @@ namespace ShiftOS.Frontend if (Hacking.CurrentHackable == null) { Console.WriteLine("[connectlib] not connected"); + return; } string Port = args["port"].ToString(); string ExploitName = args["id"].ToString(); @@ -58,12 +73,14 @@ namespace ShiftOS.Frontend } [Command("inject")] + [ShellConstraint("sploitset> ")] [RequiresArgument("id")] public static void InjectPayload(Dictionary<string, object> args) { if (Hacking.CurrentHackable == null) { Console.WriteLine("[connectlib] not connected"); + return; } string PayloadName = args["id"].ToString(); var PayloadID = Hacking.AvailablePayloads.FirstOrDefault(x => x.ID == PayloadName); @@ -83,11 +100,13 @@ namespace ShiftOS.Frontend } [Command("listports")] + [ShellConstraint("sploitset> ")] public static void ListPorts(Dictionary<string, object> args) { if (Hacking.CurrentHackable == null) { Console.WriteLine("[connectlib] not connected"); + return; } foreach (var port in Hacking.CurrentHackable.PortsToUnlock) { @@ -96,6 +115,7 @@ namespace ShiftOS.Frontend } [Command("devicescan")] + [ShellConstraint("sploitset> ")] public static void ScanDevices() { Console.WriteLine("[sploitset] found " + Hacking.AvailableToHack.Length + " devices on the network"); @@ -106,6 +126,7 @@ namespace ShiftOS.Frontend } [Command("exploits")] + [ShellConstraint("sploitset> ")] public static void ScanExploits() { Console.WriteLine("[sploitset] found " + Hacking.AvailableExploits.Length + " exploits installed"); @@ -116,6 +137,7 @@ namespace ShiftOS.Frontend } [Command("payloads")] + [ShellConstraint("sploitset> ")] public static void ListAllPayloads() { Console.WriteLine("[sploitset] found " + Hacking.AvailablePayloads.Length + " payloads"); @@ -126,11 +148,13 @@ namespace ShiftOS.Frontend } [Command("disconnect")] + [MetaCommand] public static void Disconnect(Dictionary<string, object> args) { if (Hacking.CurrentHackable == null) { Console.WriteLine("[connectlib] not connected"); + return; } if (Hacking.CurrentHackable.PayloadExecuted.Count == 0) { @@ -140,12 +164,20 @@ namespace ShiftOS.Frontend Hacking.FinishHack(); } - [Command("ftp-list")] + [Command("list")] + [ShellConstraint("SimplFTP> ")] public static void ListAllFTP(Dictionary<string, object> args) { if (Hacking.CurrentHackable == null) { Console.WriteLine("[connectlib] not connected"); + return; + } + var PayloadID = Hacking.CurrentHackable.PayloadExecuted.FirstOrDefault(x => x.EffectiveAgainst.HasFlag(Objects.SystemType.FileServer)); + if (PayloadID == null) + { + Console.WriteLine("[SimplFTP] Not authorised."); + return; } foreach (var loot in Hacking.CurrentHackable.ServerFTPLoot) { @@ -153,13 +185,21 @@ namespace ShiftOS.Frontend } } - [Command("ftp-download")] + [Command("download")] + [ShellConstraint("SimplFTP> ")] [RequiresArgument("file")] public static void DownloadFTP(Dictionary<string, object> args) { if (Hacking.CurrentHackable == null) { Console.WriteLine("[connectlib] not connected"); + return; + } + var PayloadID = Hacking.CurrentHackable.PayloadExecuted.FirstOrDefault(x => x.EffectiveAgainst.HasFlag(Objects.SystemType.FileServer)); + if (PayloadID == null) + { + Console.WriteLine("[SimplFTP] Not authorised."); + return; } string FindName = args["file"].ToString(); var LootID = Hacking.AvailableLoot.FirstOrDefault(x => x.LootName == FindName); |
