Exemple #1
0
        private static void Experiment()
        {
            Bruteforcer bruteforcer = new Bruteforcer(AlphaMin, AlphaMax, C, RoMin, RoMax, TMin, TMax, Iterations);

            AcoProcessor.AcoParameters parameters = new AcoProcessor.AcoParameters();
            parameters.pheromonMin     = 0.2;
            parameters.q               = 1;
            parameters.pheromonInitial = 1;

            AcoProcessor.AcoParameters[] list = bruteforcer.Iterate(parameters);

            List <double> results = new List <double>();

            Graph graph = Graph.Builder.GetRandomPentagram();

            AcoProcessor processor = new AcoProcessor(Graph.Builder.GetRandomPentagram());

            double shortestPath = double.PositiveInfinity;

            AcoProcessor.AcoParameters optimal = new AcoProcessor.AcoParameters();

            foreach (var param in list)
            {
                int[]  path;
                double result = processor.GetShortestPath(param, out path);
                results.Add(result);

                if (result < shortestPath)
                {
                    shortestPath = result;
                    optimal      = param;
                }
            }

            string output = Utils.ParamsToTable(list, results);

            Console.WriteLine(output);

            Console.WriteLine("Graph: ");
            Console.WriteLine(graph);

            File.WriteAllLines("out.txt", output.Split('\n'));

            Console.ForegroundColor = ConsoleColor.Green;
            Console.WriteLine("Optimal: " + optimal.ToString() + ", result: " + shortestPath);
        }
Exemple #2
0
        public void Execute(Dictionary <string, string> arguments)
        {
            Console.WriteLine("\r\n[*] Action: Perform Kerberos Brute Force\r\n");
            try
            {
                this.ParseArguments(arguments);
                if (this.passwords.Length == 0 && this.hashes.Length == 0)
                {
                    throw new BruteArgumentException("[X] You must supply a secret! Use /password:<password> or /passwords:<file> or /hash:<hash> or /hashes:<file>");
                }
                this.ObtainUsers();

                IBruteforcerReporter consoleReporter = new BruteforceConsoleReporter(this.outfile, this.verbose, this.saveTickets);

                Console.WriteLine("Continue?");
                string a = Console.ReadLine();

                Bruteforcer bruter  = new Bruteforcer(this.domain, this.dc, consoleReporter);
                bool        success = bruter.Attack(this.usernames, this.passwords, this.hashes);
                if (success)
                {
                    if (!String.IsNullOrEmpty(this.outfile))
                    {
                        Console.WriteLine("\r\n[+] Done: Credentials should be saved in \"{0}\"\r\n", this.outfile);
                    }
                    else
                    {
                        Console.WriteLine("\r\n[+] Done\r\n", this.outfile);
                    }
                }
                else
                {
                    Console.WriteLine("\r\n[-] Done: No credentials were discovered :'(\r\n");
                }
            }
            catch (BruteArgumentException ex)
            {
                Console.WriteLine("\r\n" + ex.Message + "\r\n");
            }
            catch (RubeusException ex)
            {
                Console.WriteLine("\r\n" + ex.Message + "\r\n");
            }
        }
Exemple #3
0
        public void Execute(Dictionary <string, string> arguments)
        {
            Console.WriteLine("\r\n[*] Action: Perform Kerberos Brute Force\r\n");
            try
            {
                this.ParseArguments(arguments);
                this.ObtainUsers();

                IBruteforcerReporter consoleReporter = new BruteforceConsoleReporter(
                    this.outfile, this.verbose, this.saveTickets);

                Bruteforcer bruter  = new Bruteforcer(this.domain, this.dc, consoleReporter);
                bool        success = bruter.Attack(this.usernames, this.passwords);
                if (success)
                {
                    if (!String.IsNullOrEmpty(this.outfile))
                    {
                        Console.WriteLine("\r\n[+] Done: Credentials should be saved in \"{0}\"\r\n", this.outfile);
                    }
                    else
                    {
                        Console.WriteLine("\r\n[+] Done\r\n", this.outfile);
                    }
                }
                else
                {
                    Console.WriteLine("\r\n[-] Done: No credentials were discovered :'(\r\n");
                }
            }
            catch (BruteArgumentException ex)
            {
                Console.WriteLine("\r\n" + ex.Message + "\r\n");
            }
            catch (RubeusException ex)
            {
                Console.WriteLine("\r\n" + ex.Message + "\r\n");
            }
        }