本文整理汇总了Python中core.colors.red方法的典型用法代码示例。如果您正苦于以下问题:Python colors.red方法的具体用法?Python colors.red怎么用?Python colors.red使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类core.colors
的用法示例。
在下文中一共展示了colors.red方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: hq
# 需要导入模块: from core import colors [as 别名]
# 或者: from core.colors import red [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)
示例2: modules
# 需要导入模块: from core import colors [as 别名]
# 或者: from core.colors import red [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("")
示例3: getInput
# 需要导入模块: from core import colors [as 别名]
# 或者: from core.colors import red [as 别名]
def getInput(typ):
if typ == 'domip':
typ = 'domain or ip'
inp = input('%s%s>>%s ' % (typ, red, end))
return inp
示例4: fuzzer
# 需要导入模块: from core import colors [as 别名]
# 或者: from core.colors import red [as 别名]
def fuzzer(url, params, headers, GET, delay, timeout, WAF, encoding):
for fuzz in fuzzes:
if delay == 0:
delay = 0
t = delay + randint(delay, delay * 2) + counter(fuzz)
sleep(t)
try:
if encoding:
fuzz = encoding(unquote(fuzz))
data = replaceValue(params, xsschecker, fuzz, copy.deepcopy)
response = requester(url, data, headers, GET, delay/2, timeout)
except:
logger.error('WAF is dropping suspicious requests.')
if delay == 0:
logger.info('Delay has been increased to %s6%s seconds.' % (green, end))
delay += 6
limit = (delay + 1) * 50
timer = -1
while timer < limit:
logger.info('\rFuzzing will continue after %s%i%s seconds.\t\t\r' % (green, limit, end))
limit -= 1
sleep(1)
try:
requester(url, params, headers, GET, 0, 10)
logger.good('Pheww! Looks like sleeping for %s%i%s seconds worked!' % (
green, ((delay + 1) * 2), end))
except:
logger.error('\nLooks like WAF has blocked our IP Address. Sorry!')
break
if encoding:
fuzz = encoding(fuzz)
if fuzz.lower() in response.text.lower(): # if fuzz string is reflected in the response
result = ('%s[passed] %s' % (green, end))
# if the server returned an error (Maybe WAF blocked it)
elif str(response.status_code)[:1] != '2':
result = ('%s[blocked] %s' % (red, end))
else: # if the fuzz string was not reflected in the response completely
result = ('%s[filtered]%s' % (yellow, end))
logger.info('%s %s' % (result, fuzz))
示例5: check_cmethods
# 需要导入模块: from core import colors [as 别名]
# 或者: from core.colors import red [as 别名]
def check_cmethods():
print(colors.green+"\ntesting cmethods...\n"+colors.end)
fcm = open(getpath.core()+"cmethods.py", "r")
linenum = 1
for line in fcm:
if "self" not in line and "def " in line or "args" not in line and "def " in line:
if "__init__" not in line and "mcu" not in line and "#" not in line:
print("\033[1;31m[-]\033[0m error in line "+str(linenum)+":\n"+colors.end)
print(colors.red+line+colors.end)
testfailed()
linenum += 1
示例6: setFace
# 需要导入模块: from core import colors [as 别名]
# 或者: from core.colors import red [as 别名]
def setFace():
global shellface
global mm
if mm.moduleLoaded == 0:
shellface = "["+colors.bold+"arissploit"+colors.end+"]:"
else:
shellface = "["+colors.bold+"arissploit"+colors.end+"]"+"("+colors.red+mm.moduleName+colors.end+"):"
示例7: dom
# 需要导入模块: from core import colors [as 别名]
# 或者: from core.colors import red [as 别名]
def dom(response):
highlighted = []
sources = r'''document\.(URL|documentURI|URLUnencoded|baseURI|cookie|referrer)|location\.(href|search|hash|pathname)|window\.name|history\.(pushState|replaceState)(local|session)Storage'''
sinks = r'''eval|evaluate|execCommand|assign|navigate|getResponseHeaderopen|showModalDialog|Function|set(Timeout|Interval|Immediate)|execScript|crypto.generateCRMFRequest|ScriptElement\.(src|text|textContent|innerText)|.*?\.onEventName|document\.(write|writeln)|.*?\.innerHTML|Range\.createContextualFragment|(document|window)\.location'''
scripts = re.findall(r'(?i)(?s)<script[^>]*>(.*?)</script>', response)
sinkFound, sourceFound = False, False
for script in scripts:
script = script.split('\n')
num = 1
try:
for newLine in script:
line = newLine
parts = line.split('var ')
controlledVariables = set()
allControlledVariables = set()
if len(parts) > 1:
for part in parts:
for controlledVariable in allControlledVariables:
if controlledVariable in part:
controlledVariables.add(re.search(r'[a-zA-Z$_][a-zA-Z0-9$_]+', part).group().replace('$', '\$'))
pattern = re.finditer(sources, newLine)
for grp in pattern:
if grp:
source = newLine[grp.start():grp.end()].replace(' ', '')
if source:
if len(parts) > 1:
for part in parts:
if source in part:
controlledVariables.add(re.search(r'[a-zA-Z$_][a-zA-Z0-9$_]+', part).group().replace('$', '\$'))
sourceFound = True
line = line.replace(source, yellow + source + end)
for controlledVariable in controlledVariables:
allControlledVariables.add(controlledVariable)
for controlledVariable in allControlledVariables:
matches = list(filter(None, re.findall(r'\b%s\b' % controlledVariable, line)))
if matches:
line = re.sub(r'\b%s\b' % controlledVariable, yellow + controlledVariable + end, line)
pattern = re.finditer(sinks, newLine)
for grp in pattern:
if grp:
sink = newLine[grp.start():grp.end()].replace(' ', '')
if sink:
line = line.replace(sink, red + sink + end)
sinkFound = True
if line != newLine:
highlighted.append('%-3s %s' % (str(num), line.lstrip(' ')))
num += 1
except MemoryError:
pass
if sinkFound and sourceFound:
return highlighted
else:
return []
示例8: run
# 需要导入模块: from core import colors [as 别名]
# 或者: from core.colors import red [as 别名]
def run():
open_ports = []
variables['target'][0] = variables['target'][0].replace("http://", "")
variables['target'][0] = variables['target'][0].replace("https://", "")
try:
targetip = socket.gethostbyname(variables['target'][0])
except(socket.gaierror):
printError('Hostname could not be resolved!')
return ModuleError("Hostname could not be resolved!")
socket.setdefaulttimeout(0.5)
print(colors.blue+"-" * 60)
print("Please wait, scanning target...", targetip)
print("-" * 60+colors.end)
t1 = datetime.now()
end = variables['last'][0] + 1
try:
for port in range(int(variables['first'][0]),int(end)):
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
result = sock.connect_ex((targetip, port))
if result == 0:
print(colors.green+"Port {}: Open".format(port)+colors.end)
open_ports.append(port)
else:
print("\033[1;31m[-]\033[0m Port {}: Closed".format(port)+colors.end)
sock.close()
except(socket.gaierror):
printError('Hostname could not be resolved!')
return ModuleError("Hostname could not be resolved!")
except(socket.error):
printError(colors.red+"Couldn't connect to server!"+colors.end)
return ModuleError("Couldn't connect to server!")
except(ValueError):
printError("Port value must be integer!")
return ModuleError("Port value must be integer!")
# Checking the time again
t2 = datetime.now()
# Calculates the difference of time, to see how long it took to run the script
total = t2 - t1
# Printing the information to screen
printInform('Scanning completed in: '+ str(total))
return open_ports
示例9: check_module
# 需要导入模块: from core import colors [as 别名]
# 或者: from core.colors import red [as 别名]
def check_module(modadd):
print(colors.yellow+'checking',modadd.conf["name"]+colors.green)
module = modadd.__name__.replace("modules.", "")
if modadd.conf["name"] != module:
print("\033[1;31m[-]\033[0m \nmodules name doesn't match")
modadd.conf["version"]
if modadd.conf["shortdesc"] == 'none':
print(colors.red+'\ndesc variable has default value'+colors.green)
testfailed()
if modadd.conf["github"] == 'none':
print(colors.red+'\ngithub variable has default value'+colors.green)
testfailed()
if modadd.conf["author"] == 'none':
print(colors.red+'\ncreatedby variable has default value'+colors.green)
testfailed()
if modadd.conf["email"] == 'none':
print(colors.red+'\nemail variable has default value'+colors.green)
testfailed()
if modadd.conf["initdate"] == "none":
print(colors.red+'\ninitdate variable has default value'+colors.green)
testfailed()
if modadd.conf["lastmod"] == "none":
print(colors.red+'\nlastmod variable has default value'+colors.green)
testfailed()
try:
if modadd.conf["dependencies"][0] == None:
print("\033[1;31m[-]\033[0m \ndependencies has default value")
testfailed()
except KeyError:
pass
modadd.variables.items()
modadd.conf["apisupport"]
modadd.changelog
modadd.run
try:
modadd.customcommands
check_customcommands(modadd)
except AttributeError:
pass