本文整理匯總了Python中core.colors.end方法的典型用法代碼示例。如果您正苦於以下問題:Python colors.end方法的具體用法?Python colors.end怎麽用?Python colors.end使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類core.colors
的用法示例。
在下文中一共展示了colors.end方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: heuristic
# 需要導入模塊: from core import colors [as 別名]
# 或者: from core.colors import end [as 別名]
def heuristic(response, paramList):
done = []
forms = re.findall(r'(?i)(?s)<form.*?</form.*?>', response)
for form in forms:
method = re.search(r'(?i)method=[\'"](.*?)[\'"]', form)
inputs = re.findall(r'(?i)(?s)<input.*?>', response)
if inputs != None and method != None:
for inp in inputs:
inpName = re.search(r'(?i)name=[\'"](.*?)[\'"]', inp)
if inpName:
inpName = d(e(inpName.group(1)))
if inpName not in done:
if inpName in paramList:
paramList.remove(inpName)
done.append(inpName)
paramList.insert(0, inpName)
print('%s Heuristic found a potential %s parameter: %s%s%s' % (good, method.group(1), green, inpName, end))
print('%s Prioritizing it' % info)
emptyJSvars = re.finditer(r'var\s+([^=]+)\s*=\s*[\'"`][\'"`]', response)
for each in emptyJSvars:
inpName = each.group(1)
done.append(inpName)
paramList.insert(0, inpName)
print('%s Heuristic found a potential parameter: %s%s%s' % (good, green, inpName, end))
print('%s Prioritizing it' % info)
示例2: hq
# 需要導入模塊: from core import colors [as 別名]
# 或者: from core.colors import end [as 別名]
def hq(choice, target=False):
if target:
try:
database[choice][0](target)
except:
print ('%s Skipped due to error: %s' % (bad, target))
elif choice == '0':
inp = getInput('all')
for func in list(database.values()):
try:
func[0](inp)
print (red + ('-' * 60) + end)
except:
pass
elif not target:
typ = database[choice][1]
inp = getInput(typ)
validatedInp = validate(inp, typ)
if validatedInp:
plugin = database[choice][0]
plugin(validatedInp)
else:
print ('%s Invalid input type' % bad)
示例3: arjun
# 需要導入模塊: from core import colors [as 別名]
# 或者: from core.colors import end [as 別名]
def arjun(url, GET, headers, delay, timeout):
paraNames = {}
response = requester(url, {}, headers, GET, delay, timeout).text
matches = re.findall(
r'<input.*?name=\'(.*?)\'.*?>|<input.*?name="(.*?)".*?>', response)
for match in matches:
try:
foundParam = match[1]
except UnicodeDecodeError:
continue
logger.good('Heuristics found a potentially valid parameter: %s%s%s. Priortizing it.' % (
green, foundParam, end))
if foundParam not in blindParams:
blindParams.insert(0, foundParam)
threadpool = concurrent.futures.ThreadPoolExecutor(max_workers=threadCount)
futures = (threadpool.submit(checky, param, paraNames, url,
headers, GET, delay, timeout) for param in blindParams)
for i, _ in enumerate(concurrent.futures.as_completed(futures)):
if i + 1 == len(blindParams) or (i + 1) % threadCount == 0:
logger.info('Progress: %i/%i\r' % (i + 1, len(blindParams)))
return paraNames
示例4: retireJs
# 需要導入模塊: from core import colors [as 別名]
# 或者: from core.colors import end [as 別名]
def retireJs(url, response):
scripts = js_extractor(response)
for script in scripts:
if script not in getVar('checkedScripts'):
updateVar('checkedScripts', script, 'add')
uri = handle_anchor(url, script)
response = requester(uri, '', getVar('headers'), True, getVar('delay'), getVar('timeout')).text
result = main_scanner(uri, response)
if result:
logger.red_line()
logger.good('Vulnerable component: ' + result['component'] + ' v' + result['version'])
logger.info('Component location: %s' % uri)
details = result['vulnerabilities']
logger.info('Total vulnerabilities: %i' % len(details))
for detail in details:
logger.info('%sSummary:%s %s' % (green, end, detail['identifiers']['summary']))
logger.info('Severity: %s' % detail['severity'])
logger.info('CVE: %s' % detail['identifiers']['CVE'][0])
logger.red_line()
示例5: run
# 需要導入模塊: from core import colors [as 別名]
# 或者: from core.colors import end [as 別名]
def run():
try:
try:
socket.setdefaulttimeout(float(variables['timeout'][0]))
except ValueError:
printError('Invalid timeout!')
return ModuleError("Invalid timeout!")
conn = http.client.HTTPConnection(variables['target'][0])
conn.request("HEAD","/index.html")
res = conn.getresponse()
results = res.getheaders()
print('')
for item in results:
print(colors.yellow+item[0], item[1]+colors.end)
print('')
return results
except http.client.InvalidURL:
printError('Invalid URL!')
return ("Invalid URL!")
except socket.gaierror:
printError('Name or service not known!')
return ModuleError("Name or service not known!")
except socket.timeout:
printError('Timeout!')
return ModuleError("Timeout!")
示例6: modules
# 需要導入模塊: from core import colors [as 別名]
# 或者: from core.colors import end [as 別名]
def modules(self, args):
t = PrettyTable([colors.bold+'Modules:', ''+colors.end])
t.align = 'l'
t.valing = 'm'
t.border = False
xml = moddbparser.parsemoddb()
root = xml[0]
for category in root:
if category.tag == "category":
t.add_row(["", ""])
t.add_row([colors.red+colors.uline+category.attrib["name"]+colors.end, colors.red+colors.uline+"Description"+colors.end])
for item in category:
if item.tag == "module":
for child in item:
if child.tag == "shortdesc":
t.add_row([item.attrib["name"], child.text])
break
print("")
print(t)
print("")
示例7: run
# 需要導入模塊: from core import colors [as 別名]
# 或者: from core.colors import end [as 別名]
def run(self, args):
if self.mm.moduleLoaded == 1:
try:
return self.modadd.run()
except KeyboardInterrupt:
print("\033[1;31m[-]\033[0m Module terminated!"+colors.end)
except PermissionError:
printError("Permission denied!")
return "[-] Permission denied!"
except:
print("\033[1;31m[-]\033[0m Unexpected error in module:\n")
traceback.print_exc(file=sys.stdout)
print(colors.end)
if api.enabled == True:
raise
else:
raise UnknownCommand("\033[1;31m[-]\033[0m Module is not loaded!")
示例8: set
# 需要導入模塊: from core import colors [as 別名]
# 或者: from core.colors import end [as 別名]
def set(self, args):
try:
self.modadd.variables[args[0]][0] = args[1]
print(colors.bold+args[0] +" ==> "+ str(args[1]) + colors.end)
except (NameError, KeyError):
print("\033[1;31m[-]\033[0m Option is not found!")
raise VariableError("\033[1;31m[-]\033[0m Option is not found!")
except IndexError:
print("\033[1;31m[-]\033[0m Invalid value!")
raise VariableError("\033[1;31m[-]\033[0m Invalid value!")
except:
print("\033[1;31m[-]\033[0m Unexpected error in module:\n")
traceback.print_exc(file=sys.stdout)
print(colors.end)
if api.enabled == True:
raise
示例9: deps
# 需要導入模塊: from core import colors [as 別名]
# 或者: from core.colors import end [as 別名]
def deps(self, args):
if self.mm.moduleLoaded == 0:
modules = glob.glob(getpath.modules()+"*.py")
dependencies = []
for module in modules:
try:
modadd = importlib.import_module("modules."+os.path.basename(module).replace(".py", ""))
for dep in modadd.conf["dependencies"]:
if dep not in dependencies:
dependencies.append(dep)
except ImportError:
print("\033[1;31m[-]\033[0m ImportError: "+os.path.basename(module).replace(".py", "")+colors.end)
break
except KeyError:
pass
for dep in dependencies:
print(dep)
else:
try:
for dep in self.modadd.conf["dependencies"]:
print(dep)
except KeyError:
printWarning("This module does not require any dependencies.")
示例10: mcu
# 需要導入模塊: from core import colors [as 別名]
# 或者: from core.colors import end [as 別名]
def mcu(self, command):
try:
if command[0] in self.modadd.customcommands.keys():
call = getattr(self.modadd, command[0])
try:
return call(command[1:])
except Exception as e:
print("\033[1;31m[-]\033[0m Unexpected error in module:\n")
traceback.print_exc(file=sys.stdout)
print(colors.end)
if api.enabled == True:
raise
else:
raise UnknownCommand("\033[1;31m[-]\033[0m Unrecognized command!")
except AttributeError:
raise UnknownCommand("\033[1;31m[-]\033[0m Unrecognized command!")
# Built-in commands
示例11: challenge
# 需要導入模塊: from core import colors [as 別名]
# 或者: from core.colors import end [as 別名]
def challenge():
try:
print(colors.green+"\nstarting challenge"+colors.green)
print(colors.green+"\ntesting modules\n"+colors.green)
check_modules()
compile_core()
compile_lib()
check_cmethods()
compile_api()
print(colors.green+"test passed!"+colors.end)
sys.exit(0)
except SystemExit as e:
sys.exit(e)
except:
print("\033[1;31m[-]\033[0m \ntest not passed!\n")
traceback.print_exc()
print(colors.end)
sys.exit(1)
示例12: printoptions
# 需要導入模塊: from core import colors [as 別名]
# 或者: from core.colors import end [as 別名]
def printoptions(modadd):
try:
print(" ")
t = PrettyTable([colors.red +'Option', 'Value', 'Description'+colors.end])
t.add_row(["------","-----","-----------"])
t.align = 'l'
t.valing = 'm'
t.border = False
for key, val in modadd.variables.items():
t.add_row([key, val[0], val[1]])
print (t,'\n')
try:
print(modadd.option_notes,'\n')
except(AttributeError):
pass
except Exception as error:
print("\033[1;31m[-]\033[0m error: module is corrupted\n")
traceback.print_exc(file=sys.stdout)
print(colors.end)
示例13: narrower
# 需要導入模塊: from core import colors [as 別名]
# 或者: from core.colors import end [as 別名]
def narrower(oldParamList, url, include, headers, GET, delay, originalResponse, originalCode, reflections, factors, threadCount):
newParamList = []
threadpool = concurrent.futures.ThreadPoolExecutor(max_workers=threadCount)
futures = (threadpool.submit(quickBruter, part, originalResponse, originalCode, reflections, factors, include, delay, headers, url, GET) for part in oldParamList)
for i, result in enumerate(concurrent.futures.as_completed(futures)):
if result.result():
newParamList.extend(slicer(result.result()))
print('%s Processing: %i/%-6i' % (info, i + 1, len(oldParamList)), end='\r')
return newParamList
示例14: crawl
# 需要導入模塊: from core import colors [as 別名]
# 或者: from core.colors import end [as 別名]
def crawl(addresses, processed, database, limit):
threadpool = concurrent.futures.ThreadPoolExecutor(max_workers=10)
futures = (threadpool.submit(getTransactions, address, processed, database, limit) for address in addresses)
for i, _ in enumerate(concurrent.futures.as_completed(futures)):
print('%s Progress: %i/%i ' % (info, i + 1, len(addresses)), end='\r')
示例15: banner
# 需要導入模塊: from core import colors [as 別名]
# 或者: from core.colors import end [as 別名]
def banner():
print ('''
%s⚡ %sBOLT%s ⚡%s
''' % (yellow, white, yellow, end))