コード例 #1
0
ファイル: ip_translate.py プロジェクト: zzwpower/WDScanner
def trs(args):
    import os
    iplist, domain = args
    tp = Pool(3)
    path = os.path.split(os.path.realpath(__file__))[0]
    for ip in iplist:
        command = "python {path}/../whatcms/portscan.py --host {ip} --domain {domain}"
        if domain.find('get_crpret') == -1:
            runcmd = command.format(path=path, ip=ip, domain=domain)
        else:
            runcmd = command.format(path=path, ip=ip, domain=ip)
        tp.push(run_comand32, runcmd)
    tp.wait()
    tp.busy()
コード例 #2
0
        self._print_msg('[+] sub domain brute finish ...')

        try:
            sqlquery = "insert `vuln_subdomain` (`domain`,`taskid`,`result`,`addtime`) VALUES (%s,%s,%s,%s)"
            query = str(self.target), str(self.taskid), json.dumps(
                list(totail)), str(datetime.datetime.now())
            execute(sqlquery, query)
        except Exception as e:
            print(str(e))
            pass
        tp = ThreadPool(3)
        for res in totail:
            args = res['ip'], res['domain'].strip('.')
            #trs(res['ip'],res['domain'].strip('.'))
            tp.push(trs, args)
        tp.wait()
        tp.busy()

        return totail


if __name__ == '__main__':
    parser = optparse.OptionParser('usage: %prog [options] target.com',
                                   version="%prog 1.0.6")
    parser.add_option(
        '-f',
        dest='file',
        default='subnames.txt',
        help='File contains new line delimited subs, default is subnames.txt.')
    parser.add_option(
        '--full',