def client(): util.ping_test() client_list = [] pool = ThreadPool(150) for i in range(700): print 'Starting client', i client = EchoClient('10.66.10.1', 12345, 64*1000) pool.add_task(client.start) client_list.append(client) pool.wait_completion() delay_list = [] for client in client_list: if client.running_time is None: delay_ms = 0 else: delay_ms = client.running_time * 1000.0 delay_list.append(delay_ms) cdf_list = util.make_cdf(delay_list) with open('data/microflow_delay.txt', 'w') as f: for (x, y) in zip(delay_list, cdf_list): print >> f, x, y
def sshkey(self): port = 22 if self.args.port is not None: port = self.args.port try: pool = ThreadPool(self.args.thread) except Exception, err: print >> sys.stderr, err sys.exit(1)
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()
def openvpn(self): port = 443 if not os.path.exists(self.openvpn_path): print >> sys.stderr, "openvpn: %s path doesn't exists on the system !!!"% (self.openvpn_path) sys.exit(1) if self.args.port is not None: port = self.args.port try: pool = ThreadPool(int(self.args.thread)) except Exception, err: print >> sys.stderr, err sys.exit(1)
def rdp(self): port = 3389 if not os.path.exists(self.xfreerdp_path): print >> sys.stderr, "xfreerdp: %s path doesn't exists on the system !!!"% (self.xfreerdp_path) sys.exit(1) if self.args.port is not None: port = self.args.port try: pool = ThreadPool(int(self.args.thread)) except Exception, err: print >> sys.stderr, err sys.exit(1)
def vnckey(self, *options): port = 5900 if not os.path.exists(self.vncviewer_path): print >> sys.stderr, "vncviewer: %s path doesn't exists on the system !!!"% (self.vncviewer_path) sys.exit(1) if self.args.port is not None: port = self.args.port if not os.path.isfile(self.args.passwd): print >> sys.stderr, "Password must be file !!!" sys.exit(1) try: pool = ThreadPool(int(self.args.thread)) except Exception, err: print >> sys.stderr, err sys.exit(1)
sys.stdout.write('\r' + msg + ' ' * (self.console_width - len(msg)) + '\n\r') sys.stdout.flush() totail = interpret(self.sub_domain, self.target) 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',