Example #1
0
    def parsing_ouput(self):
        utils.print_good('Parsing result found to a file')
        final_result = utils.replace_argument(
            self.options, '$WORKSPACE/directory/$OUTPUT-summary.txt')

        # dirsearch part
        dirsearch_files = utils.list_files(self.options['WORKSPACE'] +
                                           '/directory/quick',
                                           pattern='*-dirsearch.txt')
        for file in dirsearch_files:
            data = utils.just_read(file)
            if data:
                utils.just_append(final_result, data)

        # wfuzz part
        wfuzz_files = utils.list_files(self.options['WORKSPACE'] +
                                       '/directory/quick',
                                       pattern='*-wfuzz.json')
        for file in wfuzz_files:
            data_json = utils.reading_json(file)
            if data_json:
                data = "\n".join([x.get("url") for x in data_json])
                utils.just_append(final_result, data)

        # final_result
        utils.clean_up(final_result)
        utils.check_output(final_result)
Example #2
0
    def gowithness(self, data):
        # add http:// and https:// prefix to domain
        domains = []
        utils.make_directory(self.options['WORKSPACE'] +
                             '/screenshot/screenshoots-gowitness')
        for item in data:
            host = utils.get_domain(item)
            domains.append("http://" + host)
            domains.append("https://" + host)
        http_file = utils.replace_argument(
            self.options, '$WORKSPACE/screenshot/$OUTPUT-hosts.txt')
        utils.just_write(http_file, "\n".join(domains))
        utils.clean_up(http_file)
        time.sleep(2)

        # screenshots with gowitness
        cmd = "$GO_PATH/gowitness file -s $WORKSPACE/screenshot/$OUTPUT-hosts.txt -t 30 --log-level fatal --destination $WORKSPACE/screenshot/screenshoots-gowitness/ --db $WORKSPACE/screenshot/screenshoots-gowitness/gowitness.db"

        execute.send_cmd(self.options,
                         utils.replace_argument(self.options,
                                                cmd), '', '', self.module_name)

        utils.just_waiting(self.options, self.module_name, seconds=10)

        cmd = "$GO_PATH/gowitness generate -n $WORKSPACE/screenshot/$OUTPUT-gowitness-screenshots.html  --destination  $WORKSPACE/screenshot/screenshoots-gowitness/ --db $WORKSPACE/screenshot/screenshoots-gowitness/gowitness.db"

        html_path = utils.replace_argument(
            self.options,
            "$WORKSPACE/portscan/$OUTPUT-gowitness-screenshots.html")
        execute.send_cmd(self.options,
                         utils.replace_argument(self.options, cmd), html_path,
                         '', self.module_name)
Example #3
0
    def parsing_ouput(self):
        utils.print_good('Parsing result found to a file')
        final_result = utils.replace_argument(
            self.options, '$WORKSPACE/directory/$OUTPUT-summary.txt')

        dirsearch_result = utils.replace_argument(
            self.options, '$WORKSPACE/directory/quick/$OUTPUT-dirsearch.txt')
        data = utils.just_read(dirsearch_result)
        if data:
            utils.just_append(final_result, data)

        dirble_result = utils.replace_argument(
            self.options, '$WORKSPACE/directory/full/$OUTPUT-dirble.txt')
        data = utils.just_read(dirble_result)
        if data:
            utils.just_append(final_result, data)

        # final_result
        utils.clean_up(final_result)
        utils.check_output(final_result)
Example #4
0
    def get_ipsace(self):
        amass_output = utils.replace_argument(
            self.options, '$WORKSPACE/subdomain/amass-$OUTPUT/amass.json')

        if not utils.not_empty_file(amass_output):
            return

        ips_file = utils.replace_argument(
            self.options, '$WORKSPACE/ipspace/$OUTPUT-ipspace.txt')

        data = []
        jsonl = utils.just_read(amass_output).splitlines()
        for line in jsonl:
            json_data = json.loads(line)
            for item in json_data.get('addresses'):
                ip = item.get('ip')
                cidr = item.get('cidr')
                asn = item.get('asn')
                utils.print_info("Found ASN for {0} on CIDR {1}".format(
                    asn, cidr))
                data.extend([ip, cidr])

        utils.just_append(ips_file, data)
        utils.clean_up(ips_file)