def portscan(self, args): output.dataOut('[*] 加载端口扫描插件...') #参数解析 ip = args.t mask = args.m port = args.p file = args.f outfile = args.o # 获取配置文件里的端口信息 scanports = self.cf.scanports() #调用插件 if ip: output.target(ip) ps = PortScan(ip=ip, ports=scanports) elif mask: if port: ps = PortScan(single_port=port, Mask=mask) else: output.warning('please input port') elif file: ps = PortScan(file=file, ports=scanports) if outfile: self.report(portscan_result, outfile)
def portscan(self,args): output.dataOut('[*] 加载端口扫描插件...') #参数解析 ip = args.t mask = args.m port = args.p file = args.f outfile = args.o # 获取配置文件里的端口信息 scanports = self.cf.scanports() #调用插件 if ip: output.target(ip) ps = PortScan(ip=ip,ports=scanports) elif mask: if port: ps = PortScan(single_port=port,Mask=mask) else: output.warning('please input port') elif file: ps = PortScan(file=file,ports=scanports) if outfile: self.report(portscan_result,outfile)
def crypto(self, args): output.dataOut('[*] 加载crypto插件...') #参数解析 #print args if args.kaisa: kaisa(args.kaisa) elif args.kaisa2: kaisa2(args.kaisa2) elif args.morse: morse(args.morse) elif args.zhalan: zhalan(args.zhalan) elif args.nbase64: nbase64(args.nbase64) elif args.b2s: bintostr(args.b2s) elif args.a2s: asciitostr(args.a2s) elif args.h2s: hextostr(args.h2s)
def crypto(self,args): output.dataOut('[*] 加载crypto插件...') #参数解析 #print args if args.kaisa: kaisa(args.kaisa) elif args.kaisa2: kaisa2(args.kaisa2) elif args.morse: morse(args.morse) elif args.zhalan: zhalan(args.zhalan) elif args.nbase64: nbase64(args.nbase64) elif args.b2s: bintostr(args.b2s) elif args.a2s: asciitostr(args.a2s) elif args.h2s: hextostr(args.h2s)
def webdir(self, args): output.dataOut('[*] 加载目录扫描插件...') #参数解析 url = args.u outfile = args.o output.target(url) #配置文件解析 mode = self.cf.webdir_mode() thread_mode = mode #调用扫描插件 if mode == '0': Thread_func(url, data, threads_num) if mode == '1': Gevent_func(url, data, threads_num) if mode == '2': speed(Thread_func, url) if outfile: self.report(webdir_result, outfile)
def webdir(self,args): output.dataOut('[*] 加载目录扫描插件...') #参数解析 url = args.u outfile = args.o output.target(url) #配置文件解析 mode = self.cf.webdir_mode() thread_mode = mode #调用扫描插件 if mode == '0': Thread_func(url,data,threads_num) if mode =='1': Gevent_func(url,data,threads_num) if mode == '2': speed(Thread_func,url) if outfile: self.report(webdir_result,outfile)
def whois(self, args): output.dataOut('[*] 加载whois查询插件...') #参数解析 domain = args.t if domain: whois(domain)
def subnet(self, args): output.dataOut('[*] 加载C段扫描插件...') #参数解析 ip = args.t if ip: Subnet(ip)
def Exploit(self, args): #self.isview = args.v #添加一个-v显示详细信息的参数 # list所有的poc if args.list: files = [] all_files = os.listdir(paths['SCRIPT_PATH']) #print all_files for file in all_files: if 'pyc' in file or '__init__.py' in file: pass else: files.append(file) #print files mes1 = '[*] Script Name(总共%s个POC)' % str(len(files) - 1) output.dataOut(mes1) for file in files: if '__init__' not in file and 'pyc' not in file: output.dataOut(' ' + file) # 查询文件名 if args.q: keyword = args.q files = [] all_files = os.listdir(paths['SCRIPT_PATH']) #print all_files for file in all_files: if 'pyc' in file or '__init__.py' in file: pass else: files.append(file) mes = "[*] 查询关键字: %s" % keyword output.dataOut(mes) for file in files: if '__init__' not in file: if keyword in file: output.dataOut(' ' + file) #加载poc文件 if args.s: script_name = args.s if script_name.endswith('.py'): script_name = script_name[:-3] #print script_name output.pocOut('[*] 加载poc: %s.py ...\n' % script_name) script_path = paths['SCRIPT_PATH'] + script_name self.script_objs = loadScript(script_name) #print self.script_obj.poc(1) if (args.s and not args.u) and (args.s and not args.m) and (args.s and not args.f): output.error('请设置target目标') sys.exit() if args.a: if args.m: output.warning('please input single target') sys.exit() output.target(args.u) files = os.listdir(paths['SCRIPT_PATH']) for file in files: if file.endswith( '.py' ) and '__init__' not in file and 'test' not in file: file = file.rstrip('.py') self.script_objs = loadScript(file) #print self.script_objs loadTargets(args) output.pocOut('\n[*] 加载poc: %s.py' % file) self.scan() #print exploit_result self.printtable() if args.o: outfile = args.o self.report(exploit_result, outfile) sys.exit() #加载目标 loadTargets(args) # 如果是单个url, 直接调用scan函数,没必要用多线程 if args.u: output.target(args.u) self.scan() else: self.run() self.printtable() if args.o: outfile = args.o self.report(exploit_result, outfile)
def whois(self,args): output.dataOut('[*] 加载whois查询插件...') #参数解析 domain = args.t if domain: whois(domain)
def subnet(self,args): output.dataOut('[*] 加载C段扫描插件...') #参数解析 ip = args.t if ip: Subnet(ip)
def Exploit(self,args): #self.isview = args.v #添加一个-v显示详细信息的参数 # list所有的poc if args.list: files = [] all_files = os.listdir(paths['SCRIPT_PATH']) #print all_files for file in all_files: if 'pyc' in file or '__init__.py' in file: pass else: files.append(file) #print files mes1 = '[*] Script Name(总共%s个POC)'%str(len(files)-1) output.dataOut(mes1) for file in files: if '__init__' not in file and 'pyc' not in file: output.dataOut(' '+file) # 查询文件名 if args.q: keyword = args.q files = [] all_files = os.listdir(paths['SCRIPT_PATH']) #print all_files for file in all_files: if 'pyc' in file or '__init__.py' in file: pass else: files.append(file) mes = "[*] 查询关键字: %s"%keyword output.dataOut(mes) for file in files: if '__init__' not in file : if keyword in file: output.dataOut(' '+file) #加载poc文件 if args.s: script_name = args.s if script_name.endswith('.py'): script_name = script_name[:-3] #print script_name output.pocOut('[*] 加载poc: %s.py ...\n'%script_name) script_path = paths['SCRIPT_PATH']+script_name self.script_objs = loadScript(script_name) #print self.script_obj.poc(1) if (args.s and not args.u) and (args.s and not args.m): output.error('请设置target目标') sys.exit() if args.a: if args.m: output.warning('please input single target') sys.exit() output.target(args.u) files = os.listdir(paths['SCRIPT_PATH']) for file in files: if file.endswith('.py') and '__init__' not in file and 'test' not in file: file = file.rstrip('.py') self.script_objs = loadScript(file) #print self.script_objs loadTargets(args) output.pocOut('\n[*] 加载poc: %s.py'%file) self.scan() #print exploit_result self.printtable() if args.o: outfile = args.o self.report(exploit_result,outfile) sys.exit() #加载目标 loadTargets(args) # 如果是单个url, 直接调用scan函数,没必要用多线程 if args.u: output.target(args.u) self.scan() else: self.run() self.printtable() if args.o: outfile = args.o self.report(exploit_result,outfile)