aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS.Frontend
diff options
context:
space:
mode:
authorwilliam341 <[email protected]>2017-07-28 21:38:44 -0700
committerwilliam341 <[email protected]>2017-07-28 21:38:44 -0700
commit56a3080c7bcf5a836de817807cda64216c184659 (patch)
treead0da162a44d519fce7c822962f527d5eecc1d88 /ShiftOS.Frontend
parent669bd3c0901929339cfc14bce0256659499151ae (diff)
downloadshiftos_thereturn-56a3080c7bcf5a836de817807cda64216c184659.tar.gz
shiftos_thereturn-56a3080c7bcf5a836de817807cda64216c184659.tar.bz2
shiftos_thereturn-56a3080c7bcf5a836de817807cda64216c184659.zip
loot kinda works lol
Diffstat (limited to 'ShiftOS.Frontend')
-rw-r--r--ShiftOS.Frontend/Hacking/HackableProvider.cs4
-rw-r--r--ShiftOS.Frontend/Hacking/HackingCommands.cs51
-rw-r--r--ShiftOS.Frontend/Properties/Resources.Designer.cs29
-rw-r--r--ShiftOS.Frontend/Properties/Resources.resx3
-rw-r--r--ShiftOS.Frontend/Resources/Exploits.txt4
-rw-r--r--ShiftOS.Frontend/Resources/Hackables.txt2
-rw-r--r--ShiftOS.Frontend/Resources/Payloads.txt4
-rw-r--r--ShiftOS.Frontend/Resources/Shiftorium.txt4
8 files changed, 86 insertions, 15 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");
+ }
}
}
diff --git a/ShiftOS.Frontend/Properties/Resources.Designer.cs b/ShiftOS.Frontend/Properties/Resources.Designer.cs
index 1e6a8f2..05b50c6 100644
--- a/ShiftOS.Frontend/Properties/Resources.Designer.cs
+++ b/ShiftOS.Frontend/Properties/Resources.Designer.cs
@@ -71,6 +71,33 @@ namespace ShiftOS.Frontend.Properties {
}
/// <summary>
+ /// Looks up a localized string similar to /* ShiftOS Exploits data file
+ /// *
+ /// * This file contains information about all exploits in the game&apos;s campaign.
+ /// *
+ /// */
+ ///
+ ///[
+ /// {
+ /// FriendlyName: &quot;FTP Exploit&quot;,
+ /// ExploitName: &quot;ftpwn&quot;,
+ /// EffectiveAgainstPort: &quot;FileServer&quot;
+ /// },
+ /// {
+ /// FriendlyName: &quot;SSH Exploit&quot;,
+ /// ExploitName: &quot;sshardline&quot;,
+ /// EffectiveAgainstPort: &quot;SSHServer&quot;,
+ /// Dependencies: &quot;sploitset_sshardline&quot;
+ /// }
+ ///].
+ /// </summary>
+ public static string Exploits {
+ get {
+ return ResourceManager.GetString("Exploits", resourceCulture);
+ }
+ }
+
+ /// <summary>
/// Looks up a localized string similar to /* ShiftOS hackables data file
/// *
/// * This file contains information about all hackable systems in the game&apos;s campaign.
@@ -86,7 +113,7 @@ namespace ShiftOS.Frontend.Properties {
/// WelcomeMessage: &quot;Don&apos;t make fun of SpamSyndicate web design.&quot;,
/// FirewallStrength: 0,
/// LootRarity: 1,
- /// LootAmount: 4,
+ /// LootAmount: 2,
/// ConnectionTimeoutLevel: 4,
/// SystemType: &quot;FileServer, SSHServer&quot;,
///
diff --git a/ShiftOS.Frontend/Properties/Resources.resx b/ShiftOS.Frontend/Properties/Resources.resx
index c4acd46..0676c58 100644
--- a/ShiftOS.Frontend/Properties/Resources.resx
+++ b/ShiftOS.Frontend/Properties/Resources.resx
@@ -148,4 +148,7 @@
<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>
+ <data name="Exploits" type="System.Resources.ResXFileRef, System.Windows.Forms">
+ <value>..\resources\exploits.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 a3fa2fc..463ce67 100644
--- a/ShiftOS.Frontend/Resources/Exploits.txt
+++ b/ShiftOS.Frontend/Resources/Exploits.txt
@@ -8,12 +8,12 @@
{
FriendlyName: "FTP Exploit",
ExploitName: "ftpwn",
- EffectiveAgainstPort: "FileServer"
+ EffectiveAgainstPort: "FileServer",
},
{
FriendlyName: "SSH Exploit",
ExploitName: "sshardline",
EffectiveAgainstPort: "SSHServer",
- Dependencies: "sploitset_sshardline"
+ Dependencies: "sploitset_sshardline",
}
] \ No newline at end of file
diff --git a/ShiftOS.Frontend/Resources/Hackables.txt b/ShiftOS.Frontend/Resources/Hackables.txt
index ca09057..b2fadcc 100644
--- a/ShiftOS.Frontend/Resources/Hackables.txt
+++ b/ShiftOS.Frontend/Resources/Hackables.txt
@@ -13,7 +13,7 @@
WelcomeMessage: "Don't make fun of SpamSyndicate web design.",
FirewallStrength: 0,
LootRarity: 1,
- LootAmount: 4,
+ LootAmount: 2,
ConnectionTimeoutLevel: 4,
SystemType: "FileServer, SSHServer",
diff --git a/ShiftOS.Frontend/Resources/Payloads.txt b/ShiftOS.Frontend/Resources/Payloads.txt
index d203158..7e74ba8 100644
--- a/ShiftOS.Frontend/Resources/Payloads.txt
+++ b/ShiftOS.Frontend/Resources/Payloads.txt
@@ -9,7 +9,7 @@
FriendlyName: "FTP Payload",
PayloadName: "ftpull",
EffectiveAgainstFirewall: 1,
- EffectiveAgainst: "FileServer"
+ EffectiveAgainst: "FileServer",
},
{
FriendlyName: "Force Heartbeat",
@@ -17,6 +17,6 @@
EffectiveAgainstFirewall: 1,
EffectiveAgainst: "SSHServer",
Function: 1,
- Dependencies: "sploitset_keepalive"
+ Dependencies: "sploitset_keepalive",
}
] \ No newline at end of file
diff --git a/ShiftOS.Frontend/Resources/Shiftorium.txt b/ShiftOS.Frontend/Resources/Shiftorium.txt
index 55368b3..1d31dcf 100644
--- a/ShiftOS.Frontend/Resources/Shiftorium.txt
+++ b/ShiftOS.Frontend/Resources/Shiftorium.txt
@@ -1,11 +1,11 @@
[
- }
+ {
Name: "sploitset_keepalive",
Cost: 1000000000,
Description: "lolyouarentsupposedtobeabletobuythis",
Dependencies: "thisupgradeshouldneverexistever;sploitset_sshardline",
},
- }
+ {
Name: "sploitset_sshardline",
Cost: 1000000000,
Description: "lolyouarentsupposedtobeabletobuythis",