Пример #1
0
        /// <summary>
        /// Initializes all default providers.
        /// </summary>
        public Providers(RuriLibSettingsService settings)
        {
            if (settings != null)
            {
                RandomUA         = new DefaultRandomUAProvider(settings);
                Captcha          = new CaptchaSharpProvider(settings);
                PuppeteerBrowser = new DefaultPuppeteerBrowserProvider(settings);
                ProxySettings    = new DefaultProxySettingsProvider(settings);
                Security         = new DefaultSecurityProvider(settings);
            }

            RNG = new DefaultRNGProvider();
        }
Пример #2
0
        /// <summary>
        /// Initializes all default providers.
        /// </summary>
        public Providers(RuriLibSettingsService settings)
        {
            if (settings != null)
            {
                RandomUA         = new DefaultRandomUAProvider(settings);
                EmailDomains     = new FileEmailDomainRepository();
                Captcha          = new CaptchaSharpProvider(settings);
                PuppeteerBrowser = new DefaultPuppeteerBrowserProvider(settings);
                GeneralSettings  = new DefaultGeneralSettingsProvider(settings);
                ProxySettings    = new DefaultProxySettingsProvider(settings);
                Security         = new DefaultSecurityProvider(settings);
            }

            RNG = new DefaultRNGProvider();
        }
Пример #3
0
 public JobFactoryService(ConfigService configService, RuriLibSettingsService settingsService, PluginRepository pluginRepo,
                          IHitRepository hitRepo, ProxySourceFactoryService proxySourceFactory, DataPoolFactoryService dataPoolFactory,
                          ProxyReloadService proxyReloadService, IRandomUAProvider randomUAProvider, IRNGProvider rngProvider, IJobLogger logger,
                          IProxyRepository proxyRepo)
 {
     this.configService      = configService;
     this.settingsService    = settingsService;
     this.pluginRepo         = pluginRepo;
     this.hitRepo            = hitRepo;
     this.proxySourceFactory = proxySourceFactory;
     this.dataPoolFactory    = dataPoolFactory;
     this.proxyReloadService = proxyReloadService;
     this.randomUAProvider   = randomUAProvider;
     this.rngProvider        = rngProvider;
     this.logger             = logger;
     this.proxyRepo          = proxyRepo;
 }
Пример #4
0
 public CaptchaSharpProvider(RuriLibSettingsService settings)
 {
     service = CaptchaServiceFactory.GetService(settings.RuriLibSettings.CaptchaSettings);
     CheckBalanceBeforeSolving = settings.RuriLibSettings.CaptchaSettings.CheckBalanceBeforeSolving;
     ServiceType = settings.RuriLibSettings.CaptchaSettings.CurrentService;
 }
Пример #5
0
 public RLSettingsViewModel()
 {
     service = SP.GetService <RuriLibSettingsService>();
 }
Пример #6
0
 public WordlistFactory(RuriLibSettingsService ruriLibSettings)
 {
     this.ruriLibSettings = ruriLibSettings;
 }
Пример #7
0
        private CancellationTokenSource cts; // Cancellation token for cancelling the StartCondition wait

        public Job(RuriLibSettingsService settings, PluginRepository pluginRepo, IJobLogger logger = null)
        {
            this.settings   = settings;
            this.pluginRepo = pluginRepo;
            this.logger     = logger;
        }
Пример #8
0
        private static void Run(Options opts)
        {
            options = opts;

            var rlSettings = new RuriLibSettingsService("UserData");
            var pluginRepo = new PluginRepository("UserData/Plugins");

            // Unpack the config
            using var fs = new FileStream(opts.ConfigFile, FileMode.Open);
            var config = ConfigPacker.Unpack(fs).Result;

            // Setup the job
            job = new MultiRunJob(rlSettings, pluginRepo)
            {
                Providers  = new RuriLib.Models.Bots.Providers(rlSettings),
                Bots       = opts.BotsNumber,
                Config     = config,
                DataPool   = new FileDataPool(opts.WordlistFile, opts.WordlistType),
                HitOutputs = new List <IHitOutput> {
                    new FileSystemHitOutput("UserData/Hits")
                },
                ProxyMode    = opts.ProxyMode,
                ProxySources = new List <ProxySource> {
                    new FileProxySource(opts.ProxyFile)
                    {
                        DefaultType = opts.ProxyType
                    }
                }
            };

            // Ask custom inputs (if any)
            foreach (var input in config.Settings.InputSettings.CustomInputs)
            {
                System.Console.WriteLine($"{input.Description} ({input.DefaultAnswer}): ");
                var answer = System.Console.ReadLine();
                job.CustomInputsAnswers[input.VariableName] = string.IsNullOrWhiteSpace(answer)
                    ? input.DefaultAnswer
                    : answer;
            }

            // Hook event handlers
            job.OnCompleted += (sender, args) => completed = true;
            job.OnResult    += PrintResult;
            job.OnTaskError += PrintTaskError;
            job.OnError     += (sender, ex) => System.Console.WriteLine($"Error: {ex.Message}", Color.Tomato);

            // Start the job
            job.Start().Wait();

            // Wait until it finished
            while (!completed)
            {
                Thread.Sleep(100);
                UpdateTitle();
            }

            // Print colored finish message
            System.Console.Write($"Finished. Found: ");
            System.Console.Write($"{job.DataHits} hits, ", Color.GreenYellow);
            System.Console.Write($"{job.DataCustom} custom, ", Color.DarkOrange);
            System.Console.WriteLine($"{job.DataToCheck} to check.", Color.Aquamarine);

            // Prevent console from closing until the user presses return, then close
            System.Console.ReadLine();
            Environment.Exit(0);
        }
Пример #9
0
 public DefaultGeneralSettingsProvider(RuriLibSettingsService settings)
 {
     this.settings = settings.RuriLibSettings.GeneralSettings;
 }
Пример #10
0
 public DebuggerOptions(RuriLibSettingsService settings)
 {
     WordlistType = settings.Environment.WordlistTypes.First().Name;
 }
 public DefaultSecurityProvider(RuriLibSettingsService settings)
 {
     RestrictBlocksToCWD = settings.RuriLibSettings.GeneralSettings.RestrictBlocksToCWD;
 }
 public DefaultProxySettingsProvider(RuriLibSettingsService settings)
 {
     this.settings = settings.RuriLibSettings.ProxySettings;
 }
Пример #13
0
 public ProxyCheckJob(RuriLibSettingsService settings, PluginRepository pluginRepo, IJobLogger logger = null)
     : base(settings, pluginRepo, logger)
 {
 }
 public DefaultPuppeteerBrowserProvider(RuriLibSettingsService settings)
 {
     ChromeBinaryLocation = settings.RuriLibSettings.PuppeteerSettings.ChromeBinaryLocation;
 }
Пример #15
0
 public DefaultSeleniumBrowserProvider(RuriLibSettingsService settings)
 {
     ChromeBinaryLocation  = settings.RuriLibSettings.SeleniumSettings.ChromeBinaryLocation;
     FirefoxBinaryLocation = settings.RuriLibSettings.SeleniumSettings.FirefoxBinaryLocation;
     BrowserType           = settings.RuriLibSettings.SeleniumSettings.BrowserType;
 }
Пример #16
0
 public FileJobLogger(RuriLibSettingsService settings, string baseFolder)
 {
     this.settings   = settings;
     this.baseFolder = baseFolder;
     Directory.CreateDirectory(baseFolder);
 }
Пример #17
0
 public MultiRunJob(RuriLibSettingsService settings, PluginRepository pluginRepo, IJobLogger logger = null)
     : base(settings, pluginRepo, logger)
 {
 }
 public DataPoolFactoryService(IWordlistRepository wordlistRepo, RuriLibSettingsService ruriLibSettings)
 {
     this.wordlistRepo    = wordlistRepo;
     this.ruriLibSettings = ruriLibSettings;
 }
Пример #19
0
 public PuppeteerUnitTestJob(RuriLibSettingsService settings, PluginRepository pluginRepo, IJobLogger logger = null)
     : base(settings, pluginRepo, logger)
 {
 }
Пример #20
0
 public KeychainViewerViewModel(Keychain keychain)
 {
     rlSettingsService = SP.GetService <RuriLibSettingsService>();
     this.keychain     = keychain;
 }