Beispiel #1
0
    def __init__(self, args):

        self.options = {
            'url': args.url,
            'prefix': '',
            'user_agent': args.user_agent,
            'proxy': args.proxy,
            'verbosity': args.verbosity,
            'threads': 10,
            'chunk_size': 10,  # same as threads
            'run_all': args.run_all,
            'match_all': args.match_all,
            'stop_after': args.stop_after,
            'no_cache_load': args.no_cache_load,
            'no_cache_save': args.no_cache_save,
        }

        self.data = {
            'cache': Cache(),
            'results': Results(self.options),
            'fingerprints': Fingerprints(),
            'matcher': Match(),
            'colorizer': Color(),
            'printer': Printer(args.verbosity, Color()),
            'detected_cms': set(),
            'error_pages': set(),
            'queue': queue.Queue(),
            'requested': queue.Queue()
        }

        self.data['results'].set_printer(self.data['printer'])
        self.data['requester'] = Requester(self.options, self.data)
Beispiel #2
0
def generateFourPlayerSet():
    """
    Generate a board 9x9 with all the pieces
    :return:
    """

    green = Color("Green", "#01D758")
    blue = Color("Blue", "#0131B4")
    red = Color("Red", "#DB1702")
    yellow = Color("Yellow", "#FCDC12")

    board = Board((9, 9))

    board.cells[0][0].pions = [Chief((0, 0), yellow)]
    board.cells[0][1].pions = [Assassin((0, 1), yellow)]
    board.cells[0][2].pions = [Militant((0, 2), yellow)]
    board.cells[1][0].pions = [Reporter((1, 0), yellow)]
    board.cells[1][1].pions = [Diplomat((1, 1), yellow)]
    board.cells[1][2].pions = [Militant((1, 2), yellow)]
    board.cells[2][0].pions = [Militant((2, 0), yellow)]
    board.cells[2][1].pions = [Militant((2, 1), yellow)]
    board.cells[2][2].pions = [Necromobile((2, 2), yellow)]

    board.cells[0][6].pions = [Militant((0, 6), green)]
    board.cells[0][7].pions = [Assassin((0, 7), green)]
    board.cells[0][8].pions = [Chief((0, 8), green)]
    board.cells[1][6].pions = [Militant((1, 6), green)]
    board.cells[1][7].pions = [Diplomat((1, 7), green)]
    board.cells[1][8].pions = [Reporter((1, 8), green)]
    board.cells[2][6].pions = [Necromobile((2, 6), green)]
    board.cells[2][7].pions = [Militant((2, 7), green)]
    board.cells[2][8].pions = [Militant((2, 8), green)]

    board.cells[6][0].pions = [Chief((6, 0), blue)]
    board.cells[6][1].pions = [Assassin((6, 1), blue)]
    board.cells[6][2].pions = [Militant((6, 2), blue)]
    board.cells[7][0].pions = [Reporter((7, 0), blue)]
    board.cells[7][1].pions = [Diplomat((7, 1), blue)]
    board.cells[7][2].pions = [Militant((7, 2), blue)]
    board.cells[8][0].pions = [Militant((8, 0), blue)]
    board.cells[8][1].pions = [Militant((8, 1), blue)]
    board.cells[8][2].pions = [Necromobile((8, 2), blue)]

    board.cells[6][6].pions = [Militant((6, 6), red)]
    board.cells[6][7].pions = [Assassin((6, 7), red)]
    board.cells[6][8].pions = [Chief((6, 8), red)]
    board.cells[7][6].pions = [Militant((7, 6), red)]
    board.cells[7][7].pions = [Diplomat((7, 7), red)]
    board.cells[7][8].pions = [Reporter((7, 8), red)]
    board.cells[8][6].pions = [Necromobile((8, 6), red)]
    board.cells[8][7].pions = [Militant((8, 7), red)]
    board.cells[8][8].pions = [Militant((8, 8), red)]
Beispiel #3
0
    def __init__(self, args):

        urls = None
        interactive = True

        if args.input_file is not None:
            interactive = False

            with open(args.input_file, 'r') as input_file:
                urls = []
                for url in input_file.readlines():
                    u = url.strip()
                    urls.append(u if '://' in u else 'http://' + u)

        elif '://' not in args.url:
            args.url = 'http://' + args.url

        self.options = {
            'url': args.url,
            'urls': urls,
            'interactive': interactive,
            'prefix': '',
            'user_agent': args.user_agent,
            'proxy': args.proxy,
            'verbosity': args.verbosity,
            'threads': 10,
            'batch_size': 20,
            'run_all': args.run_all,
            'match_all': args.match_all,
            'stop_after': args.stop_after,
            'no_cache_load': args.no_cache_load,
            'no_cache_save': args.no_cache_save,
            'write_file': args.output_file
        }

        self.data = {
            'cache': Cache(),
            'results': Results(self.options),
            'fingerprints': Fingerprints(),
            'matcher': Match(),
            'colorizer': Color(),
            'printer': Printer(args.verbosity, Color()),
            'detected_cms': set(),
            'error_pages': set(),
            'requested': queue.Queue()
        }

        if self.options['write_file'] is not None:
            self.json_outputter = OutputJSON(self.options, self.data)
Beispiel #4
0
    def __init__(self, host, profile, verbose, desperate):
        self.plugins = self.load_plugins()
        self.host = host
        self.results = Results()
        self.cache = Cache()
        self.profile = Profile(profile)
        self.colorizer = Color()
        self.logs = Log()
        self.verbose = verbose

        self.check_url()
        self.redirect()
        self.cache.set_host(self.host)

        if desperate:
            self.desperate = Desperate()
        else:
            self.desperate = None
Beispiel #5
0
    def __init__(self, options):
        self.width = None
        self.color = Color()
        self.printer = None
        self.results = {}

        # the storage for 'string' and 'regex' matched fingerprints
        # since these don't need extra processing they are added directly
        # to the final scores
        self.scores = defaultdict(lambda: defaultdict(lambda: Counter()))
        #		      ^ Category          ^ Name              ^ Version

        # md5 fingerprints are based on content that might not hav been changed
        # across different versions of the cms. The score of a match is based on
        # the number of 'hits' for that URL. The finale score for a cms version will be:
        #  1 / number_of_hits
        #
        self.md5_matches = defaultdict(lambda: defaultdict(lambda: set()))
        #		           ^ Url               ^ cms               ^ versions

        self.sitemap = Sitemap()

        self.site_info = {'ip': '', 'title': '', 'cookies': ''}
Beispiel #6
0
 def __init__(self, color, value, available=True, in_play=False):
     self.color = Color(color)
     self.value = value
     self.available = available
     self.in_play = in_play
Beispiel #7
0
Datei: log.py Projekt: xstpl/wig
	def __init__(self):
		self.logs = defaultdict(lambda: defaultdict(set))
		self.colorizer = Color()
Beispiel #8
0
 def __init__(self):
     self.width = None
     self.color = Color()
     self.results = defaultdict(
         lambda: defaultdict(lambda: defaultdict(float)))