aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS.Frontend
diff options
context:
space:
mode:
Diffstat (limited to 'ShiftOS.Frontend')
-rw-r--r--ShiftOS.Frontend/Apps/Network.cs12
-rw-r--r--ShiftOS.Frontend/Hacking/HackableProvider.cs5
-rw-r--r--ShiftOS.Frontend/Hacking/HackerTestCommands.cs45
-rw-r--r--ShiftOS.Frontend/Properties/Resources.Designer.cs39
-rw-r--r--ShiftOS.Frontend/Properties/Resources.resx3
-rw-r--r--ShiftOS.Frontend/Resources/Exploits.txt2
-rw-r--r--ShiftOS.Frontend/Resources/Payloads.txt4
-rw-r--r--ShiftOS.Frontend/Resources/Ports.txt32
-rw-r--r--ShiftOS.Frontend/ShiftOS.Frontend.csproj1
9 files changed, 133 insertions, 10 deletions
diff --git a/ShiftOS.Frontend/Apps/Network.cs b/ShiftOS.Frontend/Apps/Network.cs
index 5cbc385..cd67e6a 100644
--- a/ShiftOS.Frontend/Apps/Network.cs
+++ b/ShiftOS.Frontend/Apps/Network.cs
@@ -128,7 +128,7 @@ namespace ShiftOS.Frontend.Apps
protected override void OnLayout(GameTime gameTime)
{
- _title.X = 15;
+ /*_title.X = 15;
_title.Y = 15;
_subtitle.X = 15;
@@ -174,7 +174,7 @@ Loot rarity: {_current.Data.LootRarity}
}
}
- base.OnLayout(gameTime);
+ base.OnLayout(gameTime);*/
}
public class PortView : Control
@@ -198,21 +198,21 @@ Loot rarity: {_current.Data.LootRarity}
protected override void OnLayout(GameTime gameTime)
{
- _start.Y = (Height - _start.Height) / 2;
+ /*_start.Y = (Height - _start.Height) / 2;
_start.X = (Width - _start.Width) - 15;
unlocked = _port.Locks.Count > 0;
- base.OnLayout(gameTime);
+ base.OnLayout(gameTime);*/
}
protected override void OnPaint(GraphicsContext gfx)
{
- gfx.Clear(LoadedSkin.ControlTextColor.ToMonoColor());
+ /*gfx.Clear(LoadedSkin.ControlTextColor.ToMonoColor());
gfx.DrawRectangle(1, 1, Width - 2, Height - 2, LoadedSkin.ControlColor.ToMonoColor());
gfx.DrawString(_port.Name + " (" + _port.Value + ")", 15, 15, LoadedSkin.ControlTextColor.ToMonoColor(), LoadedSkin.Header3Font);
string _status = "Tier: " + _port.Tier.ToString();
string lockstatus = (unlocked == true) ? "Unlocked" : $"{_port.Locks.Count} locks";
_status += " - " + lockstatus;
- gfx.DrawString(_status, 15, 15 + LoadedSkin.Header3Font.Height + 5, LoadedSkin.ControlTextColor.ToMonoColor(), LoadedSkin.MainFont);
+ gfx.DrawString(_status, 15, 15 + LoadedSkin.Header3Font.Height + 5, LoadedSkin.ControlTextColor.ToMonoColor(), LoadedSkin.MainFont);*/
}
public event Action<Port> ConnectionStarted;
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<Payload[]>(Properties.Resources.Payloads);
}
+ public Port[] GetPorts()
+ {
+ return JsonConvert.DeserializeObject<Port[]>(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<string, object> args)
@@ -41,6 +68,24 @@ namespace ShiftOS.Frontend
Console.WriteLine(hackable.WelcomeMessage);
}
+ [Command("describeport")]
+ [RequiresArgument("id")]
+ public static void DescribePort(Dictionary<string, object> 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<string, object> args)
diff --git a/ShiftOS.Frontend/Properties/Resources.Designer.cs b/ShiftOS.Frontend/Properties/Resources.Designer.cs
index 1d451a1..dfc728e 100644
--- a/ShiftOS.Frontend/Properties/Resources.Designer.cs
+++ b/ShiftOS.Frontend/Properties/Resources.Designer.cs
@@ -153,7 +153,7 @@ namespace ShiftOS.Frontend.Properties {
/// FriendlyName: &quot;FTP Payload&quot;,
/// PayloadName: &quot;ftpull&quot;
/// EffectiveAgainstFirewall: 1,
- /// EffectiveAgainstPort: &quot;FileServer&quot;,
+ /// EffectiveAgainst: &quot;FileServer&quot;,
/// }
///].
/// </summary>
@@ -164,6 +164,43 @@ namespace ShiftOS.Frontend.Properties {
}
/// <summary>
+ /// Looks up a localized string similar to /* ShiftOS Ports data file
+ /// *
+ /// * This file contains information about all ports in the game&apos;s campaign.
+ /// *
+ /// */
+ ///
+ ///[
+ /// {
+ /// FriendlyName: &quot;SMTP mailserver (unencrypted)&quot;,
+ /// AttachTo: &quot;EmailServer&quot;
+ /// Value: 25,
+ /// Name: &quot;smtp&quot;,
+ /// },
+ /// {
+ /// FriendlyName: &quot;File Transfer Protocol&quot;,
+ /// AttachTo: &quot;FileServer&quot;
+ /// Value: 21,
+ /// Name: &quot;ftp&quot;,
+ /// },
+ /// {
+ /// FriendlyName: &quot;ShiftSSH server&quot;,
+ /// AttachTo: &quot;SSHServer&quot;
+ /// Value: 22,
+ /// Name: &quot;ssh&quot;,
+ /// },
+ /// {
+ /// FriendlyName: &quot;MySQL server&quot;,
+ /// AttachTo: &quot;Database&quot;
+ /// Val [rest of string was truncated]&quot;;.
+ /// </summary>
+ public static string Ports {
+ get {
+ return ResourceManager.GetString("Ports", resourceCulture);
+ }
+ }
+
+ /// <summary>
/// Looks up a localized string similar to [].
/// </summary>
public static string Shiftorium {
diff --git a/ShiftOS.Frontend/Properties/Resources.resx b/ShiftOS.Frontend/Properties/Resources.resx
index 80ed513..0b514f7 100644
--- a/ShiftOS.Frontend/Properties/Resources.resx
+++ b/ShiftOS.Frontend/Properties/Resources.resx
@@ -148,4 +148,7 @@
<data name="Payloads" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\resources\payloads.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
</data>
+ <data name="Ports" type="System.Resources.ResXFileRef, System.Windows.Forms">
+ <value>..\resources\ports.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
+ </data>
</root> \ No newline at end of file
diff --git a/ShiftOS.Frontend/Resources/Exploits.txt b/ShiftOS.Frontend/Resources/Exploits.txt
index 0e0dd64..45b0250 100644
--- a/ShiftOS.Frontend/Resources/Exploits.txt
+++ b/ShiftOS.Frontend/Resources/Exploits.txt
@@ -7,7 +7,7 @@
[
{
FriendlyName: "FTP Exploit",
- ExploitName: "ftpwn"
+ ExploitName: "ftpwn",
EffectiveAgainstPort: "FileServer",
}
] \ No newline at end of file
diff --git a/ShiftOS.Frontend/Resources/Payloads.txt b/ShiftOS.Frontend/Resources/Payloads.txt
index 1c7ff2d..1ce0f43 100644
--- a/ShiftOS.Frontend/Resources/Payloads.txt
+++ b/ShiftOS.Frontend/Resources/Payloads.txt
@@ -7,8 +7,8 @@
[
{
FriendlyName: "FTP Payload",
- PayloadName: "ftpull"
+ PayloadName: "ftpull",
EffectiveAgainstFirewall: 1,
- EffectiveAgainstPort: "FileServer",
+ EffectiveAgainst: "FileServer",
}
] \ No newline at end of file
diff --git a/ShiftOS.Frontend/Resources/Ports.txt b/ShiftOS.Frontend/Resources/Ports.txt
new file mode 100644
index 0000000..4813496
--- /dev/null
+++ b/ShiftOS.Frontend/Resources/Ports.txt
@@ -0,0 +1,32 @@
+/* ShiftOS Ports data file
+ *
+ * This file contains information about all ports in the game's campaign.
+ *
+ */
+
+[
+ {
+ FriendlyName: "SMTP mailserver (unencrypted)",
+ AttachTo: "EmailServer",
+ Value: 25,
+ Name: "smtp",
+ },
+ {
+ FriendlyName: "File Transfer Protocol",
+ AttachTo: "FileServer",
+ Value: 21,
+ Name: "ftp",
+ },
+ {
+ FriendlyName: "ShiftSSH server",
+ AttachTo: "SSHServer",
+ Value: 22,
+ Name: "ssh",
+ },
+ {
+ FriendlyName: "MySQL server",
+ AttachTo: "Database",
+ Value: 3306,
+ Name: "sql",
+ }
+] \ No newline at end of file
diff --git a/ShiftOS.Frontend/ShiftOS.Frontend.csproj b/ShiftOS.Frontend/ShiftOS.Frontend.csproj
index 5f3d18a..eff61a2 100644
--- a/ShiftOS.Frontend/ShiftOS.Frontend.csproj
+++ b/ShiftOS.Frontend/ShiftOS.Frontend.csproj
@@ -190,6 +190,7 @@
<None Include="Resources\LootInfo.txt" />
</ItemGroup>
<ItemGroup>
+ <Content Include="Resources\Ports.txt" />
<Content Include="Resources\Payloads.txt" />
<Content Include="Resources\Exploits.txt" />
</ItemGroup>