aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS.WinForms/VirtualEnvironments.cs
diff options
context:
space:
mode:
authorMichael <[email protected]>2017-06-24 14:41:45 -0400
committerMichael <[email protected]>2017-06-24 14:41:45 -0400
commit8621b3ddffdd8211604f01d90ff40c9b2991f27a (patch)
tree925fc7ed52ba29189f6a4f76f939ea97ca7539f0 /ShiftOS.WinForms/VirtualEnvironments.cs
parent1661f9a5bd46dbd7d2586787c55bfc407c027629 (diff)
downloadshiftos_thereturn-8621b3ddffdd8211604f01d90ff40c9b2991f27a.tar.gz
shiftos_thereturn-8621b3ddffdd8211604f01d90ff40c9b2991f27a.tar.bz2
shiftos_thereturn-8621b3ddffdd8211604f01d90ff40c9b2991f27a.zip
breaking the bonds storyline
Diffstat (limited to 'ShiftOS.WinForms/VirtualEnvironments.cs')
-rw-r--r--ShiftOS.WinForms/VirtualEnvironments.cs109
1 files changed, 109 insertions, 0 deletions
diff --git a/ShiftOS.WinForms/VirtualEnvironments.cs b/ShiftOS.WinForms/VirtualEnvironments.cs
index 5faa6ff..fb39569 100644
--- a/ShiftOS.WinForms/VirtualEnvironments.cs
+++ b/ShiftOS.WinForms/VirtualEnvironments.cs
@@ -2,7 +2,9 @@
using System.Collections.Generic;
using System.Linq;
using System.Text;
+using System.Threading;
using System.Threading.Tasks;
+using ShiftOS.Engine;
namespace ShiftOS.WinForms
{
@@ -27,6 +29,113 @@ namespace ShiftOS.WinForms
_environments.Clear();
}
+ const string VALID_PASSWORD_CHARS = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890-_";
+
+
+ [RequiresUpgrade("brute")]
+ [Command("brute")]
+ public static void Brute()
+ {
+ TerminalBackend.PrefixEnabled = false;
+ bool cracked = false;
+ var brute = Properties.Resources.brute;
+ var str = new System.IO.MemoryStream(brute);
+ var reader = new NAudio.Wave.Mp3FileReader(str);
+ var _out = new NAudio.Wave.WaveOut();
+ _out.Init(reader);
+ _out.PlaybackStopped += (o, a) =>
+ {
+ if (cracked == false)
+ {
+ cracked = true;
+ TerminalCommands.Clear();
+ ConsoleEx.Bold = true;
+ ConsoleEx.ForegroundColor = ConsoleColor.Red;
+ Console.WriteLine(" - access denied - ");
+ ConsoleEx.ForegroundColor = ConsoleColor.Gray;
+ ConsoleEx.Bold = false;
+ ConsoleEx.Italic = true;
+ Console.WriteLine("password could not be cracked before connection termination.");
+ }
+ TerminalBackend.PrefixEnabled = true;
+ TerminalBackend.PrintPrompt();
+ _out.Dispose();
+ reader.Dispose();
+ str.Dispose();
+ };
+ _out.Play();
+
+ var t = new Thread(() =>
+ {
+
+
+ Console.WriteLine("brute - version 1.0");
+ Console.WriteLine("Copyright (c) 2018 hacker101. All rights reserved.");
+ Console.WriteLine();
+ Thread.Sleep(4000);
+ Console.WriteLine("Scanning outbound connections...");
+ if (string.IsNullOrWhiteSpace(Applications.FileSkimmer.OpenConnection.SystemName))
+ {
+ Thread.Sleep(2000);
+ Console.WriteLine(" - no outbound connections to scan, aborting - ");
+ _out.Stop();
+ _out.Dispose();
+ reader.Dispose();
+ str.Dispose();
+ }
+ else
+ {
+ Thread.Sleep(2000);
+ var con = Applications.FileSkimmer.OpenConnection;
+ Console.WriteLine($@"{con.SystemName}
+------------------
+
+Active connection: ftp, rts
+System name: {con.SystemName}
+Users: {con.Users.Count}");
+ Thread.Sleep(500);
+ var user = con.Users.FirstOrDefault(x => x.Permissions == Objects.UserPermissions.Root);
+ if (user == null)
+ Console.WriteLine(" - no users found with root access - this is a shiftos bug - ");
+ else
+ {
+ Console.WriteLine(" - starting bruteforce attack on user: " + user.Username + " - ");
+ var rnd = new Random();
+
+ char[] pass = new char[user.Password.Length];
+ for (int i = 0; i < pass.Length; i++)
+ {
+ if (cracked == true)
+ break;
+ while (pass[i] != user.Password[i])
+ {
+ if (cracked == true)
+ break;
+ char c = VALID_PASSWORD_CHARS[rnd.Next(VALID_PASSWORD_CHARS.Length)];
+ if (char.IsLetterOrDigit(c))
+ {
+ pass[i] = c;
+ Console.WriteLine(new string(pass));
+ Console.WriteLine();
+ Thread.Sleep(1);
+ }
+ }
+ }
+ if (cracked == false)
+ {
+ cracked = true;
+ TerminalCommands.Clear();
+ Console.WriteLine(" - credentials cracked. -");
+ Console.WriteLine($@"sysname: {con.SystemName}
+user: {user.Username}
+password: {user.Password}");
+ }
+ }
+ }
+ });
+ t.Start();
+ }
+
public static ShiftOSEnvironment Get(string sysname)
{
return _environments.FirstOrDefault(x => x.SystemName == sysname);