Exemple #1
0
        public static void RunExperimentalSweep(ExperimentalConfiguration[] configurations)
        {
            foreach (ExperimentalConfiguration config in configurations)
            {
                DateTime now     = DateTime.Now;
                string   dirName = config.OutputPath; // + config.OutputDirectoryName;
                Directory.CreateDirectory(dirName);
                string path = dirName;                // + @"\";

                if (errorWriter == null)
                {
                    errorWriter = (new StreamWriter(new FileStream(path + "error.txt", FileMode.OpenOrCreate, FileAccess.ReadWrite)));
                }

                DebugLogger logger = new DebugLogger();

                try
                {
                    SimulatedPasswords simPasswords = new SimulatedPasswords(logger, config);
                    Simulator          simulator    = new Simulator(logger, path, config, simPasswords);
                    simulator.RunAsync();
                }
                catch (Exception e)
                {
                    lock (errorWriter)
                    {
                        while (e != null)
                        {
                            errorWriter.WriteLine(e.Message);
                            errorWriter.WriteLine(e.StackTrace);
                            errorWriter.WriteLine(e);
                            e = e.InnerException;
                        }
                        errorWriter.Flush();
                    }
                }
            }
        }
Exemple #2
0
        public Simulator(DebugLogger logger, string path, ExperimentalConfiguration myExperimentalConfiguration, SimulatedPasswords simPasswords)
        {
            _simPasswords = simPasswords;
            _logger       = logger;
            if (_Attempts == null)
            {
                _Attempts = new ConcurrentStreamWriter(path + "Attempts.txt");
            }

            _logger.WriteStatus("Entered Simulator constructor");
            _experimentalConfiguration = myExperimentalConfiguration;
            BlockingAlgorithmOptions options = _experimentalConfiguration.BlockingOptions;

            //_logger.WriteStatus("Creating binomial ladder");
            _binomialLadderFilter =
                new BinomialLadderFilter(options.NumberOfBitsInBinomialLadderFilter_N, options.HeightOfBinomialLadder_H);
            _ipHistoryCache        = new ConcurrentDictionary <IPAddress, SimIpHistory>();
            _userAccountController = new SimulatedUserAccountController();

            _recentIncorrectPasswords = new AgingMembershipSketch(16, 128 * 1024);

            //_logger.WriteStatus("Exiting Simulator constructor");
        }
Exemple #3
0
 public SimulatedLoginAttemptGenerator(ExperimentalConfiguration experimentalConfiguration, SimulatedAccounts simAccounts, IpPool ipPool, SimulatedPasswords simPasswords)
 {
     _simAccounts = simAccounts;
     _experimentalConfiguration = experimentalConfiguration;
     _ipPool       = ipPool;
     _simPasswords = simPasswords;
 }
Exemple #4
0
 public SimulatedAccounts(IpPool ipPool, SimulatedPasswords simPasswords, DebugLogger logger)
 {
     _ipPool       = ipPool;
     _logger       = logger;
     _simPasswords = simPasswords;
 }