From 65f79e4b238bd231d0d5e2e73c0bda0494e23608 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 27 Jun 2017 15:43:09 -0400 Subject: Make brute better. --- ShiftOS.WinForms/VirtualEnvironments.cs | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) (limited to 'ShiftOS.WinForms/VirtualEnvironments.cs') diff --git a/ShiftOS.WinForms/VirtualEnvironments.cs b/ShiftOS.WinForms/VirtualEnvironments.cs index fb39569..019c46c 100644 --- a/ShiftOS.WinForms/VirtualEnvironments.cs +++ b/ShiftOS.WinForms/VirtualEnvironments.cs @@ -100,25 +100,20 @@ Users: {con.Users.Count}"); 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]) + for(char c = (char)0; c < (char)255; c++) { - if (cracked == true) + if (!char.IsLetterOrDigit(c)) + continue; + pass[i] = c; + if (pass[i] == user.Password[i]) 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); - } + Console.WriteLine(new string(pass)); } } if (cracked == false) -- cgit v1.2.3