コード例 #1
0
        private void btnStart_Click(object sender, RoutedEventArgs e)
        {
            if (!string.IsNullOrWhiteSpace(txtNordAccount.Text))
            {
                var account = txtNordAccount.Text.Split(':');
                _nordNetworkCredential = new NetworkCredential(account[0], account[1]);
                _currentNordServer     = NordServer.ServersList[0];
            }

            if (_nordNetworkCredential == null && ProxyList.Count == 0)
            {
                MessageBox.Show("load proxy ServersList or set nord account");
                return;
            }

            if (ComboList.Count == 0)
            {
                MessageBox.Show("load ComboList");
                return;
            }

            if (ReferenceEquals(lblStatus.Content, "Status : Checking Proxies..."))
            {
                MessageBox.Show("wait to complete checking proxies");
                return;
            }

            ThreadGun = new ThreadGun <ComboItem>((Action <ComboItem>)Config, ComboList, (int)sldThreadCount.Value,
                                                  CompletedEvent,
                                                  ExceptionOccurredEvent).FillingMagazine();
            ThreadGun.Start();
            lblStatus.Content = "Status : Process Started...";

            new Thread(Status).Start();
        }
コード例 #2
0
 private void ExceptionOccurredEvent(ThreadGun <ComboItem> gun, IEnumerable <ComboItem> inputs, object input,
                                     Exception exception)
 {
     lock (FileLock)
     {
         File.AppendAllText("Error.txt", ((ComboItem)input).UserOrEmail + ':' + ((ComboItem)input).Password);
     }
 }
コード例 #3
0
ファイル: TestForm.cs プロジェクト: cd37ycs/ThreadGun
 private void btnThreadGun_Click(object sender, EventArgs e)
 {
     lstThreadGunResult.Items.Clear();
     _tg = new ThreadGun <int>((Action <int>)ActionThreadGun, Enumerable.Range(1, NumCount), 20,
                               tg_ExceptionOccurred);
     _tg.Completed += tg_Completed;
     _tg.FillingMagazine();
     _tg.Start();
 }
コード例 #4
0
ファイル: TestForm.cs プロジェクト: cd37ycs/ThreadGun
        private void tg_ExceptionOccurred(ThreadGun <int> gun, IEnumerable <int> inputs, object input,
                                          Exception exception)
        {
            MessageBox.Show($@"Exception Occurred!!!

Message :
{exception.Message}

Input :
{(int) input}");
        }
コード例 #5
0
        private static void Crack(Options options)
        {
            var hashes    = File.ReadAllLines(options.HashFile);
            var stopwatch = new Stopwatch();
            var passwords = File.ReadAllLines(options.PasswordFile);

            stopwatch.Start();

            Timer hashSpeedTimer;

            (hashSpeedTimer = new Timer(60 * 1000)).Elapsed += (sender, args) =>
            {
                HashPerMin      = _tempHashPerMin;
                _tempHashPerMin = 0;
            };
            hashSpeedTimer.Start();
            Timer checkSpeedTimer;

            (checkSpeedTimer = new Timer(1000)).Elapsed += (sender, args) =>
            {
                CheckPerSec      = _tempCheckPerSec;
                _tempCheckPerSec = 0;
            };
            checkSpeedTimer.Start();
            Timer printTimer;

            (printTimer = new Timer(2000)).Elapsed += (sender, args) =>
            {
                Console.Clear();
                var remainingTime = HashPerMin == 0 ? "Wait to calculate" : TimeSpan.FromMinutes((double)(hashes.Length - CheckedHash) / HashPerMin).TimeSpanToString();
                Console.Write($@"[+] Cracked Hash: {CrackedHash}
[+] Checked Hash: {CheckedHash}
[+] Current Hash: {CurrentHash}
[+] Hash/Min: {HashPerMin}
[+] Check/Sec: {CheckPerSec}
[+] Progress: {CheckedPass}/{hashes.Length * passwords.Length} {Math.Round(((double) CheckedPass / (hashes.Length * passwords.Length)) * 100)}%
[+] Time: {stopwatch.Elapsed.TimeSpanToString()} 
[+] Remaining time: {remainingTime}

[P] Pause - [R] Resume - [S] Save
");
            };
            printTimer.Start();

            _threadGun = new ThreadGun <string>(hash =>
            {
                Parallel.ForEach(passwords, (password, state) =>
                {
                    CheckedPass++;
                    _tempCheckPerSec++;
                    if (!Crypto.VerifyHashedPassword(hash, password))
                    {
                        return;
                    }
                    _result.Add(hash + ":" + password);
                    CrackedHash++;
                    state.Break();
                });
                _tempHashPerMin++;
                CheckedHash++;
                CurrentHash = hash;
            }, hashes, int.Parse(options.ThreadCount)
                                                , inputs =>
            {
                File.WriteAllLines("result.txt", _result);
                stopwatch.Stop();
                printTimer.Stop();
                hashSpeedTimer.Stop();
                checkSpeedTimer.Stop();
                Console.WriteLine("[+] Finished");
                _completed = true;
            }).FillingMagazine().Start();
        }