def run(self, check_only=False, wordlists=None, threads=10): """ Run scan. 1. Ensure the target is reachable and in debug mode 2. Load plugins and run them 3. Output tokens generated from issued requests Scans can be performed in aggressive mode where aggressive plugins will be run. The engine can be configured using a different wordlists and a specific number of threads. :param check_only: only perform checks on target, do not run plugins :param wordlists: wordlists file or directory :param threads: number of workers to run simultaneously """ self.log.info('Starting scan on %s', self.url) start = datetime.now() self.log.info('%s is a great day', start) wordlists = wordlists or self.wordlists # Checks print() self.check() # Stop if only check if not check_only: # Start engine, load and run plugins engine = Engine(threads, session=self.session) engine.start() try: options = dict(wordlists=wordlists, output=self.output) manager = PluginManager(symfony=self.symfony, engine=engine, **options) manager.run() finally: engine.stop() if self.symfony.files and self.output: print() self.log.info('Saving files to %s', self.output) for path, data in self.symfony.files.items(): self.write(self.output, path, data) self.log.info('Saved %d files', len(self.symfony.files)) print() self.log.info('Generated tokens: %s', ' '.join(r.token for r in self.requests if r.token)) duration = str(datetime.now() - start).split('.')[0] self.log.info('Scan completed in %s', duration)
def credentials(cls, args): """Credentials handler.""" # Prep symfony = Symfony(url=args.url, session=args.session) engine = Engine(size=args.threads, session=args.session) engine.start() # Run cls.log.info(Logs.name) Logs(symfony, engine).run() # Save engine.stop() if args.output: print() EOS.save(symfony, args.output)
def sources(cls, args): """Sources handler.""" # Prep symfony = Symfony(url=args.url, session=args.session) engine = Engine(size=args.threads, session=args.session) engine.start() # Run cls.log.info(Info.name) Info(symfony).run() print() cls.log.info(Sources.name) Sources(symfony, engine).run() # Save engine.stop() if args.output: print() EOS.save(symfony, args.output)