aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS.Frontend/Hacking
diff options
context:
space:
mode:
authorwilliam341 <[email protected]>2017-07-29 10:46:42 -0700
committerwilliam341 <[email protected]>2017-07-29 10:46:55 -0700
commitf31eff4566655bc9aff2e5efe4ac24ef941020f0 (patch)
tree39f5b20bdfda850c1617926d5da21072186111c2 /ShiftOS.Frontend/Hacking
parent20ab7710cdf79adf7a2cff107b9ebdfe3b97633c (diff)
downloadshiftos_thereturn-f31eff4566655bc9aff2e5efe4ac24ef941020f0.tar.gz
shiftos_thereturn-f31eff4566655bc9aff2e5efe4ac24ef941020f0.tar.bz2
shiftos_thereturn-f31eff4566655bc9aff2e5efe4ac24ef941020f0.zip
wew
Diffstat (limited to 'ShiftOS.Frontend/Hacking')
-rw-r--r--ShiftOS.Frontend/Hacking/HackingCommands.cs42
1 files changed, 40 insertions, 2 deletions
diff --git a/ShiftOS.Frontend/Hacking/HackingCommands.cs b/ShiftOS.Frontend/Hacking/HackingCommands.cs
index d07b174..5d51006 100644
--- a/ShiftOS.Frontend/Hacking/HackingCommands.cs
+++ b/ShiftOS.Frontend/Hacking/HackingCommands.cs
@@ -9,8 +9,19 @@ 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 +36,7 @@ namespace ShiftOS.Frontend
}
[Command("exploit")]
+ [ShellConstraint("sploitset> ")]
[RequiresArgument("id")]
[RequiresArgument("port")]
public static void Exploit(Dictionary<string, object> args)
@@ -32,6 +44,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 +71,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 +98,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 +113,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 +124,7 @@ namespace ShiftOS.Frontend
}
[Command("exploits")]
+ [ShellConstraint("sploitset> ")]
public static void ScanExploits()
{
Console.WriteLine("[sploitset] found " + Hacking.AvailableExploits.Length + " exploits installed");
@@ -116,6 +135,7 @@ namespace ShiftOS.Frontend
}
[Command("payloads")]
+ [ShellConstraint("sploitset> ")]
public static void ListAllPayloads()
{
Console.WriteLine("[sploitset] found " + Hacking.AvailablePayloads.Length + " payloads");
@@ -126,11 +146,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 +162,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 +183,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);