本文整理汇总了Python中src.utils.settings.print_success_msg函数的典型用法代码示例。如果您正苦于以下问题:Python print_success_msg函数的具体用法?Python print_success_msg怎么用?Python print_success_msg使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了print_success_msg函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: server_identification
def server_identification(server_banner):
found_server_banner = False
if settings.VERBOSITY_LEVEL >= 1:
info_msg = "Identifying the target server... "
sys.stdout.write(settings.print_info_msg(info_msg))
sys.stdout.flush()
for i in range(0,len(settings.SERVER_BANNERS)):
match = re.search(settings.SERVER_BANNERS[i].lower(), server_banner.lower())
if match:
if settings.VERBOSITY_LEVEL >= 1:
print "[ " + Fore.GREEN + "SUCCEED" + Style.RESET_ALL + " ]"
if settings.VERBOSITY_LEVEL >= 1:
success_msg = "The target server was identified as "
success_msg += server_banner + Style.RESET_ALL + "."
print settings.print_success_msg(success_msg)
settings.SERVER_BANNER = match.group(0)
found_server_banner = True
# Set up default root paths
if "apache" in settings.SERVER_BANNER.lower():
if settings.TARGET_OS == "win":
settings.WEB_ROOT = "\\htdocs"
else:
settings.WEB_ROOT = "/var/www"
elif "nginx" in settings.SERVER_BANNER.lower():
settings.WEB_ROOT = "/usr/share/nginx"
elif "microsoft-iis" in settings.SERVER_BANNER.lower():
settings.WEB_ROOT = "\\inetpub\\wwwroot"
break
else:
if settings.VERBOSITY_LEVEL >= 1:
print "[ " + Fore.RED + "FAILED" + Style.RESET_ALL + " ]"
warn_msg = "The server which was identified as '"
warn_msg += server_banner + "' seems unknown."
print settings.print_warning_msg(warn_msg)
开发者ID:security-geeks,项目名称:commix,代码行数:35,代码来源:requests.py
示例2: process_json_data
def process_json_data():
while True:
success_msg = "JSON data found in POST data."
if not menu.options.batch:
question_msg = success_msg
question_msg += " Do you want to process it? [Y/n] > "
sys.stdout.write(settings.print_question_msg(question_msg))
json_process = sys.stdin.readline().replace("\n","").lower()
else:
if settings.VERBOSITY_LEVEL >= 1:
print settings.print_success_msg(success_msg)
json_process = ""
if len(json_process) == 0:
json_process = "y"
if json_process in settings.CHOICE_YES:
settings.IS_JSON = True
break
elif json_process in settings.CHOICE_NO:
break
elif json_process in settings.CHOICE_QUIT:
raise SystemExit()
else:
err_msg = "'" + json_process + "' is not a valid answer."
print settings.print_error_msg(err_msg)
pass
开发者ID:security-geeks,项目名称:commix,代码行数:25,代码来源:checks.py
示例3: application_identification
def application_identification(server_banner, url):
found_application_extension = False
if settings.VERBOSITY_LEVEL >= 1:
info_msg = "Identifying the target application ... "
sys.stdout.write(settings.print_info_msg(info_msg))
sys.stdout.flush()
root, application_extension = splitext(urlparse(url).path)
settings.TARGET_APPLICATION = application_extension[1:].upper()
if settings.TARGET_APPLICATION:
found_application_extension = True
if settings.VERBOSITY_LEVEL >= 1:
print "[ " + Fore.GREEN + "SUCCEED" + Style.RESET_ALL + " ]"
success_msg = "The target application was identified as "
success_msg += settings.TARGET_APPLICATION + Style.RESET_ALL + "."
print settings.print_success_msg(success_msg)
# Check for unsupported target applications
for i in range(0,len(settings.UNSUPPORTED_TARGET_APPLICATION)):
if settings.TARGET_APPLICATION.lower() in settings.UNSUPPORTED_TARGET_APPLICATION[i].lower():
err_msg = settings.TARGET_APPLICATION + " exploitation is not yet supported."
print settings.print_critical_msg(err_msg)
raise SystemExit()
if not found_application_extension:
if settings.VERBOSITY_LEVEL >= 1:
print "[ " + Fore.RED + "FAILED" + Style.RESET_ALL + " ]"
warn_msg = "Heuristics have failed to identify target application."
print settings.print_warning_msg(warn_msg)
开发者ID:security-geeks,项目名称:commix,代码行数:29,代码来源:requests.py
示例4: authentication_process
def authentication_process():
auth_url = menu.options.auth_url
auth_data = menu.options.auth_data
cj = cookielib.CookieJar()
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))
request = opener.open(urllib2.Request(auth_url))
cookies = ""
for cookie in cj:
cookie_values = cookie.name + "=" + cookie.value + "; "
cookies += cookie_values
if len(cookies) != 0 :
menu.options.cookie = cookies.rstrip()
if settings.VERBOSITY_LEVEL >= 1:
success_msg = "The received cookie is "
success_msg += menu.options.cookie + Style.RESET_ALL + "."
print settings.print_success_msg(success_msg)
urllib2.install_opener(opener)
request = urllib2.Request(auth_url, auth_data)
# Check if defined extra headers.
headers.do_check(request)
# Get the response of the request.
response = requests.get_request_response(request)
return response
开发者ID:BMaChina,项目名称:commix,代码行数:27,代码来源:authentication.py
示例5: snif
def snif(dns_server):
success_msg = "Started the sniffer between you" + Style.BRIGHT
success_msg += " and the DNS server " + Fore.YELLOW + dns_server
success_msg += Style.RESET_ALL + Style.BRIGHT + "."
print settings.print_success_msg(success_msg)
while True:
sniff(filter="port 53", prn=querysniff, store = 0)
开发者ID:aventado,项目名称:commix,代码行数:7,代码来源:dns_exfiltration.py
示例6: snif
def snif(ip_dst, ip_src):
success_msg = "Started the sniffer between " + Fore.YELLOW + ip_src
success_msg += Style.RESET_ALL + Style.BRIGHT + " and " + Fore.YELLOW
success_msg += ip_dst + Style.RESET_ALL + Style.BRIGHT + "."
print settings.print_success_msg(success_msg)
while True:
sniff(filter = "icmp and src " + ip_dst, prn=packet_handler, timeout=settings.DELAY)
开发者ID:aventado,项目名称:commix,代码行数:8,代码来源:icmp_exfiltration.py
示例7: encoding_detection
def encoding_detection(response):
if not menu.options.encoding:
charset_detected = False
if settings.VERBOSITY_LEVEL >= 1:
info_msg = "Identifing the indicated web-page charset... "
sys.stdout.write(settings.print_info_msg(info_msg))
sys.stdout.flush()
try:
# Detecting charset
charset = response.headers.getparam('charset')
if len(charset) != 0 :
charset_detected = True
else:
content = re.findall(r";charset=(.*)\"", html_data)
if len(content) != 0 :
charset = content
charset_detected = True
else:
# Check if HTML5 format
charset = re.findall(r"charset=['\"](.*?)['\"]", html_data)
if len(charset) != 0 :
charset_detected = True
# Check the identifyied charset
if charset_detected :
settings.DEFAULT_ENCODING = charset
if settings.VERBOSITY_LEVEL >= 1:
print "[ " + Fore.GREEN + "SUCCEED" + Style.RESET_ALL + " ]"
settings.ENCODING = charset.lower()
if settings.ENCODING.lower() not in settings.ENCODING_LIST:
warn_msg = "The indicated web-page charset " + settings.ENCODING + " seems unknown."
print settings.print_warning_msg(warn_msg)
else:
if settings.VERBOSITY_LEVEL >= 1:
success_msg = "The indicated web-page charset appears to be "
success_msg += settings.ENCODING + Style.RESET_ALL + "."
print settings.print_success_msg(success_msg)
else:
pass
except:
pass
if charset_detected == False and settings.VERBOSITY_LEVEL >= 1:
print "[ " + Fore.RED + "FAILED" + Style.RESET_ALL + " ]"
else:
settings.ENCODING = menu.options.encoding
if settings.ENCODING.lower() not in settings.ENCODING_LIST:
err_msg = "The user-defined charset '" + settings.ENCODING + "' seems unknown. "
err_msg += "Please visit 'http://docs.python.org/library/codecs.html#standard-encodings' "
err_msg += "to get the full list of supported charsets."
print settings.print_critical_msg(err_msg)
raise SystemExit()
开发者ID:security-geeks,项目名称:commix,代码行数:50,代码来源:requests.py
示例8: notification
def notification(url, technique):
try:
if settings.LOAD_SESSION == True:
success_msg = "A previously stored session has been held against that host."
print settings.print_success_msg(success_msg)
while True:
question_msg = "Do you want to resume to the "
question_msg += technique.rsplit(" ", 2)[0]
question_msg += " injection point? [Y/n/q] > "
sys.stdout.write(settings.print_question_msg(question_msg))
settings.LOAD_SESSION = sys.stdin.readline().replace("\n", "").lower()
if settings.LOAD_SESSION in settings.CHOICE_YES:
return True
elif settings.LOAD_SESSION in settings.CHOICE_NO:
settings.LOAD_SESSION = False
if technique[:1] != "c":
while True:
question_msg = "Which technique do you want to re-evaluate? [(C)urrent/(a)ll/(n)one] > "
sys.stdout.write(settings.print_question_msg(question_msg))
proceed_option = sys.stdin.readline().replace("\n", "").lower()
if proceed_option.lower() in settings.CHOICE_PROCEED:
if proceed_option.lower() == "a":
settings.RETEST = True
break
elif proceed_option.lower() == "c":
settings.RETEST = False
break
elif proceed_option.lower() == "n":
raise SystemExit()
else:
pass
else:
if proceed_option.lower() == "":
proceed_option = "enter"
err_msg = "'" + proceed_option + "' is not a valid answer."
print settings.print_error_msg(err_msg)
pass
if settings.SESSION_APPLIED_TECHNIQUES:
menu.options.tech = "".join(settings.AVAILABLE_TECHNIQUES)
return False
elif settings.LOAD_SESSION in settings.CHOICE_QUIT:
raise SystemExit()
else:
if settings.LOAD_SESSION == "":
settings.LOAD_SESSION = "enter"
err_msg = "'" + settings.LOAD_SESSION + "' is not a valid answer."
print settings.print_error_msg(err_msg)
pass
except sqlite3.OperationalError, err_msg:
print settings.print_critical_msg(err_msg)
开发者ID:Raz71,项目名称:commix,代码行数:50,代码来源:session_handler.py
示例9: uninstaller
def uninstaller():
info_msg = "Starting the uninstaller... "
sys.stdout.write(settings.print_info_msg(info_msg))
sys.stdout.flush()
try:
subprocess.Popen("rm -rf /usr/bin/" + settings.APPLICATION + " >/dev/null 2>&1", shell=True).wait()
subprocess.Popen("rm -rf /usr/share/" + settings.APPLICATION + " >/dev/null 2>&1", shell=True).wait()
except:
print "[" + Fore.RED + " FAILED " + Style.RESET_ALL + "]"
sys.exit(0)
sys.stdout.write("[" + Fore.GREEN + " SUCCEED " + Style.RESET_ALL + "]\n")
sys.stdout.flush()
success_msg = "The un-installation of commix has finished!"
print settings.print_success_msg(success_msg)
开发者ID:BMaChina,项目名称:commix,代码行数:15,代码来源:install.py
示例10: powershell_version
def powershell_version(separator, TAG, prefix, suffix, whitespace, http_request_method, url, vuln_parameter, alter_shell, filename):
cmd = settings.PS_VERSION
if alter_shell:
cmd = cmd.replace("'","\\'")
#Command execution results.
response = cb_injector.injection(separator, TAG, cmd, prefix, suffix, whitespace, http_request_method, url, vuln_parameter, alter_shell, filename)
# Evaluate injection results.
if session_handler.export_stored_cmd(url, cmd, vuln_parameter) == None:
# Evaluate injection results.
ps_version = cb_injector.injection_results(response, TAG, cmd)
ps_version = "".join(str(p) for p in ps_version)
session_handler.store_cmd(url, cmd, ps_version, vuln_parameter)
else:
ps_version = session_handler.export_stored_cmd(url, cmd, vuln_parameter)
try:
if float(ps_version):
settings.PS_ENABLED = True
if settings.VERBOSITY_LEVEL >= 1:
print ""
# Output PowerShell's version number
success_msg = "The PowerShell's version number is "
success_msg += ps_version + Style.RESET_ALL + Style.BRIGHT
sys.stdout.write(settings.print_success_msg(success_msg) + ".\n")
sys.stdout.flush()
# Add infos to logs file.
output_file = open(filename, "a")
success_msg = "The PowerShell's version number is " + ps_version + ".\n"
output_file.write(" " + re.compile(re.compile(settings.ANSI_COLOR_REMOVAL)).sub("",settings.SUCCESS_SIGN) + success_msg)
output_file.close()
except ValueError:
warn_msg = "Heuristics have failed to identify PowerShell's version, "
warn_msg += "which means that some payloads or injection techniques may be failed."
print settings.print_warning_msg(warn_msg)
settings.PS_ENABLED = False
checks.ps_check_failed()
开发者ID:BMaChina,项目名称:commix,代码行数:35,代码来源:cb_enumeration.py
示例11: file_read
def file_read(separator, TAG, prefix, suffix, whitespace, http_request_method, url, vuln_parameter, alter_shell, filename):
file_to_read = menu.options.file_read
# Execute command
if settings.TARGET_OS == "win":
cmd = settings.WIN_FILE_READ + file_to_read
else:
cmd = settings.FILE_READ + file_to_read
response = cb_injector.injection(separator, TAG, cmd, prefix, suffix, whitespace, http_request_method, url, vuln_parameter, alter_shell, filename)
if session_handler.export_stored_cmd(url, cmd, vuln_parameter) == None:
# Evaluate injection results.
shell = cb_injector.injection_results(response, TAG, cmd)
shell = "".join(str(p) for p in shell)
session_handler.store_cmd(url, cmd, shell, vuln_parameter)
else:
shell = session_handler.export_stored_cmd(url, cmd, vuln_parameter)
if menu.options.verbose:
print ""
if shell:
success_msg = "The contents of file '" + Style.UNDERLINE
success_msg += file_to_read + Style.RESET_ALL + "' : "
sys.stdout.write(settings.print_success_msg(success_msg))
print shell
output_file = open(filename, "a")
success_msg = "The contents of file '"
success_msg += file_to_read + "' : " + shell + ".\n"
output_file.write(" " + settings.SUCCESS_SIGN + success_msg)
output_file.close()
else:
warn_msg = "It seems that you don't have permissions "
warn_msg += "to read the '" + file_to_read + "' file."
sys.stdout.write(settings.print_warning_msg(warn_msg) + "\n")
sys.stdout.flush()
开发者ID:ardiansn,项目名称:commix,代码行数:32,代码来源:cb_file_access.py
示例12: hostname
def hostname(separator, maxlen, TAG, cmd, prefix, suffix, whitespace, timesec, http_request_method, url, vuln_parameter, alter_shell, filename, url_time_response):
_ = False
cmd = settings.HOSTNAME
if session_handler.export_stored_cmd(url, cmd, vuln_parameter) == None or menu.options.ignore_session:
# The main command injection exploitation.
check_how_long, output = tb_injector.injection(separator, maxlen, TAG, cmd, prefix, suffix, whitespace, timesec, http_request_method, url, vuln_parameter, alter_shell, filename, url_time_response)
session_handler.store_cmd(url, cmd, output, vuln_parameter)
_ = True
else:
output = session_handler.export_stored_cmd(url, cmd, vuln_parameter)
shell = output
if shell:
if settings.VERBOSITY_LEVEL <= 1 and not menu.options.ignore_session and _:
print ""
success_msg = "The hostname is " + shell
sys.stdout.write(settings.print_success_msg(success_msg) + ".")
sys.stdout.flush()
# Add infos to logs file.
output_file = open(filename, "a")
success_msg = "The hostname is " + shell + ".\n"
output_file.write(re.compile(re.compile(settings.ANSI_COLOR_REMOVAL)).sub("",settings.SUCCESS_SIGN) + success_msg)
output_file.close()
else:
warn_msg = "Heuristics have failed to identify the hostname."
print settings.print_warning_msg(warn_msg)
开发者ID:security-geeks,项目名称:commix,代码行数:25,代码来源:tb_enumeration.py
示例13: powershell_version
def powershell_version(separator, maxlen, TAG, cmd, prefix, suffix, whitespace, timesec, http_request_method, url, vuln_parameter, alter_shell, filename, url_time_response):
_ = False
cmd = settings.PS_VERSION
if alter_shell:
cmd = cmd.replace("'","\\'")
if session_handler.export_stored_cmd(url, cmd, vuln_parameter) == None or menu.options.ignore_session:
# The main command injection exploitation.
check_how_long, output = tb_injector.injection(separator, maxlen, TAG, cmd, prefix, suffix, whitespace, timesec, http_request_method, url, vuln_parameter, alter_shell, filename, url_time_response)
session_handler.store_cmd(url, cmd, output, vuln_parameter)
_ = True
else:
output = session_handler.export_stored_cmd(url, cmd, vuln_parameter)
ps_version = output
try:
if float(ps_version):
settings.PS_ENABLED = True
ps_version = "".join(str(p) for p in output)
if settings.VERBOSITY_LEVEL <= 1 and not menu.options.ignore_session and _:
print ""
# Output PowerShell's version number
success_msg = "The PowerShell's version number is "
success_msg += ps_version + Style.RESET_ALL + Style.BRIGHT
sys.stdout.write(settings.print_success_msg(success_msg) + ".")
sys.stdout.flush()
# Add infos to logs file.
output_file = open(filename, "a")
success_msg = "The PowerShell's version number is " + ps_version + ".\n"
output_file.write(re.compile(re.compile(settings.ANSI_COLOR_REMOVAL)).sub("",settings.SUCCESS_SIGN) + success_msg)
output_file.close()
except ValueError:
warn_msg = "Heuristics have failed to identify the version of Powershell, "
warn_msg += "which means that some payloads or injection techniques may be failed."
print "\n" + settings.print_warning_msg(warn_msg)
settings.PS_ENABLED = False
开发者ID:security-geeks,项目名称:commix,代码行数:34,代码来源:tb_enumeration.py
示例14: file_read
def file_read(separator, payload, TAG, delay, prefix, suffix, whitespace, http_request_method, url, vuln_parameter, OUTPUT_TEXTFILE, alter_shell, filename):
file_to_read = menu.options.file_read
# Execute command
if settings.TARGET_OS == "win":
cmd = settings.WIN_FILE_READ + file_to_read
else:
cmd = settings.FILE_READ + file_to_read
response = fb_injector.injection(separator, payload, TAG, cmd, prefix, suffix, whitespace, http_request_method, url, vuln_parameter, OUTPUT_TEXTFILE, alter_shell, filename)
if session_handler.export_stored_cmd(url, cmd, vuln_parameter) == None:
# Evaluate injection results.
shell = fb_injector.injection_results(url, OUTPUT_TEXTFILE, delay)
shell = "".join(str(p) for p in shell)
session_handler.store_cmd(url, cmd, shell, vuln_parameter)
else:
shell = session_handler.export_stored_cmd(url, cmd, vuln_parameter)
if settings.VERBOSITY_LEVEL >= 1:
print ""
if shell:
success_msg = "The contents of file '"
success_msg += file_to_read + "'" + Style.RESET_ALL + ": "
sys.stdout.write(settings.print_success_msg(success_msg))
print shell
output_file = open(filename, "a")
success_msg = "The contents of file '"
success_msg += file_to_read + "' : " + shell + ".\n"
output_file.write(" " + re.compile(re.compile(settings.ANSI_COLOR_REMOVAL)).sub("",settings.SUCCESS_SIGN) + success_msg)
output_file.close()
else:
warn_msg = "It seems that you don't have permissions "
warn_msg += "to read the '" + file_to_read + "' file."
sys.stdout.write(settings.print_warning_msg(warn_msg) + "\n")
sys.stdout.flush()
开发者ID:BMaChina,项目名称:commix,代码行数:32,代码来源:fb_file_access.py
示例15: system_information
def system_information(separator, payload, TAG, timesec, prefix, suffix, whitespace, http_request_method, url, vuln_parameter, OUTPUT_TEXTFILE, alter_shell, filename):
if settings.TARGET_OS == "win":
settings.RECOGNISE_OS = settings.WIN_RECOGNISE_OS
cmd = settings.RECOGNISE_OS
if session_handler.export_stored_cmd(url, cmd, vuln_parameter) == None or menu.options.ignore_session:
# Command execution results.
response = fb_injector.injection(separator, payload, TAG, cmd, prefix, suffix, whitespace, http_request_method, url, vuln_parameter, OUTPUT_TEXTFILE, alter_shell, filename)
# Evaluate injection results.
target_os = fb_injector.injection_results(url, OUTPUT_TEXTFILE, timesec)
target_os = "".join(str(p) for p in target_os)
session_handler.store_cmd(url, cmd, target_os, vuln_parameter)
else:
target_os = session_handler.export_stored_cmd(url, cmd, vuln_parameter)
if target_os:
target_os = "".join(str(p) for p in target_os)
if settings.TARGET_OS != "win":
cmd = settings.DISTRO_INFO
if session_handler.export_stored_cmd(url, cmd, vuln_parameter) == None or menu.options.ignore_session:
# Command execution results.
response = fb_injector.injection(separator, payload, TAG, cmd, prefix, suffix, whitespace, http_request_method, url, vuln_parameter, OUTPUT_TEXTFILE, alter_shell, filename)
# Perform target page reload (if it is required).
if settings.URL_RELOAD:
response = requests.url_reload(url, timesec)
# Evaluate injection results.
distro_name = fb_injector.injection_results(url, OUTPUT_TEXTFILE, timesec)
distro_name = "".join(str(p) for p in distro_name)
if len(distro_name) != 0:
target_os = target_os + " (" + distro_name + ")"
session_handler.store_cmd(url, cmd, target_os, vuln_parameter)
else:
target_os = session_handler.export_stored_cmd(url, cmd, vuln_parameter)
if settings.TARGET_OS == "win":
cmd = settings.WIN_RECOGNISE_HP
else:
cmd = settings.RECOGNISE_HP
if session_handler.export_stored_cmd(url, cmd, vuln_parameter) == None or menu.options.ignore_session:
# Command execution results.
response = fb_injector.injection(separator, payload, TAG, cmd, prefix, suffix, whitespace, http_request_method, url, vuln_parameter, OUTPUT_TEXTFILE, alter_shell, filename)
# Evaluate injection results.
target_arch = fb_injector.injection_results(url, OUTPUT_TEXTFILE, timesec)
target_arch = "".join(str(p) for p in target_arch)
session_handler.store_cmd(url, cmd, target_arch, vuln_parameter)
else:
target_arch = session_handler.export_stored_cmd(url, cmd, vuln_parameter)
if target_arch:
# if settings.VERBOSITY_LEVEL >= 1:
# print ""
success_msg = "The target operating system is " + target_os + Style.RESET_ALL
success_msg += Style.BRIGHT + " and the hardware platform is " + target_arch
sys.stdout.write(settings.print_success_msg(success_msg) + ".\n")
sys.stdout.flush()
# Add infos to logs file.
output_file = open(filename, "a")
success_msg = "The target operating system is " + target_os
success_msg += " and the hardware platform is " + target_arch + ".\n"
output_file.write(re.compile(re.compile(settings.ANSI_COLOR_REMOVAL)).sub("",settings.SUCCESS_SIGN) + success_msg)
output_file.close()
else:
warn_msg = "Heuristics have failed to retrieve the system information."
print settings.print_warning_msg(warn_msg)
开发者ID:security-geeks,项目名称:commix,代码行数:60,代码来源:fb_enumeration.py
示例16: powershell_version
def powershell_version(separator, maxlen, TAG, cmd, prefix, suffix, whitespace, delay, http_request_method, url, vuln_parameter, OUTPUT_TEXTFILE, alter_shell, filename, url_time_response):
cmd = settings.PS_VERSION
if alter_shell:
cmd = cmd.replace("'","\\'")
#Command execution results.
if session_handler.export_stored_cmd(url, cmd, vuln_parameter) == None:
# The main command injection exploitation.
check_how_long, output = tfb_injector.injection(separator, maxlen, TAG, cmd, prefix, suffix, whitespace, delay, http_request_method, url, vuln_parameter, OUTPUT_TEXTFILE, alter_shell, filename, url_time_response)
session_handler.store_cmd(url, cmd, output, vuln_parameter)
new_line = "\n"
else:
output = session_handler.export_stored_cmd(url, cmd, vuln_parameter)
new_line = ""
ps_version = output
try:
if float(ps_version):
settings.PS_ENABLED = True
ps_version = "".join(str(p) for p in output)
if settings.VERBOSITY_LEVEL >= 1:
print ""
# Output PowerShell's version number
success_msg = "The PowerShell's version number is "
success_msg += ps_version + Style.RESET_ALL + Style.BRIGHT
sys.stdout.write(new_line + settings.print_success_msg(success_msg) + ".")
sys.stdout.flush()
# Add infos to logs file.
output_file = open(filename, "a")
success_msg = "The PowerShell's version number is " + ps_version + ".\n"
output_file.write(" " + settings.SUCCESS_SIGN + success_msg)
output_file.close()
except ValueError:
warn_msg = "Heuristics have failed to identify PowerShell's version, "
warn_msg += "which means that some payloads or injection techniques may be failed."
print "\n" + settings.print_warning_msg(warn_msg)
settings.PS_ENABLED = False
开发者ID:Cyber-Forensic,项目名称:commix,代码行数:35,代码来源:tfb_enumeration.py
示例17: hostname
def hostname(separator, TAG, prefix, suffix, whitespace, http_request_method, url, vuln_parameter, alter_shell, filename, timesec):
if settings.TARGET_OS == "win":
settings.HOSTNAME = settings.WIN_HOSTNAME
cmd = settings.HOSTNAME
if session_handler.export_stored_cmd(url, cmd, vuln_parameter) == None or menu.options.ignore_session:
# Command execution results.
response = cb_injector.injection(separator, TAG, cmd, prefix, suffix, whitespace, http_request_method, url, vuln_parameter, alter_shell, filename)
# Perform target page reload (if it is required).
if settings.URL_RELOAD:
response = requests.url_reload(url, timesec)
# Evaluate injection results.
shell = cb_injector.injection_results(response, TAG, cmd)
shell = "".join(str(p) for p in shell)
session_handler.store_cmd(url, cmd, shell, vuln_parameter)
else:
shell = session_handler.export_stored_cmd(url, cmd, vuln_parameter)
if shell:
shell = "".join(str(p) for p in shell)
success_msg = "The hostname is " + shell
sys.stdout.write(settings.print_success_msg(success_msg) + ".\n")
sys.stdout.flush()
# Add infos to logs file.
output_file = open(filename, "a")
success_msg = "The hostname is " + shell + ".\n"
output_file.write(re.compile(re.compile(settings.ANSI_COLOR_REMOVAL)).sub("",settings.SUCCESS_SIGN) + success_msg)
output_file.close()
else:
warn_msg = "Heuristics have failed to identify the hostname."
print settings.print_warning_msg(warn_msg)
开发者ID:security-geeks,项目名称:commix,代码行数:29,代码来源:cb_enumeration.py
示例18: is_JSON_check
def is_JSON_check(parameter):
try:
json_object = json.loads(parameter)
if re.search(settings.JSON_RECOGNITION_REGEX, parameter):
if settings.VERBOSITY_LEVEL >= 1 and not settings.IS_JSON:
success_msg = Style.BRIGHT + "JSON data"
success_msg += Style.RESET_ALL + Style.BRIGHT
success_msg += " found in POST data"
success_msg += Style.RESET_ALL + "."
print settings.print_success_msg(success_msg)
except ValueError, err_msg:
if not "No JSON object could be decoded" in err_msg:
err_msg = "JSON " + str(err_msg) + ". "
print settings.print_critical_msg(err_msg) + "\n"
sys.exit(0)
return False
开发者ID:aventado,项目名称:commix,代码行数:17,代码来源:parameters.py
示例19: user_agent_header
def user_agent_header():
# Check if defined "--random-agent" option.
if menu.options.random_agent:
if (menu.options.agent != settings.DEFAULT_USER_AGENT) or menu.options.mobile:
err_msg = "The option '--random-agent' is incompatible with option '--user-agent' or switch '--mobile'."
print settings.print_critical_msg(err_msg)
raise SystemExit()
else:
info_msg = "Fetching random HTTP User-Agent header... "
sys.stdout.write(settings.print_info_msg(info_msg))
sys.stdout.flush()
try:
menu.options.agent = random.choice(settings.USER_AGENT_LIST)
print "[ " + Fore.GREEN + "SUCCEED" + Style.RESET_ALL + " ]"
success_msg = "The fetched random HTTP User-Agent header is '" + menu.options.agent + "'."
print settings.print_success_msg(success_msg)
except:
print "[ " + Fore.RED + "FAILED" + Style.RESET_ALL + " ]"
开发者ID:security-geeks,项目名称:commix,代码行数:18,代码来源:main.py
示例20: system_information
def system_information(separator, maxlen, TAG, cmd, prefix, suffix, whitespace, timesec, http_request_method, url, vuln_parameter, alter_shell, filename, url_time_response):
_ = False
if settings.TARGET_OS == "win":
settings.RECOGNISE_OS = settings.WIN_RECOGNISE_OS
cmd = settings.RECOGNISE_OS
if session_handler.export_stored_cmd(url, cmd, vuln_parameter) == None or menu.options.ignore_session:
# The main command injection exploitation.
check_how_long, output = tb_injector.injection(separator, maxlen, TAG, cmd, prefix, suffix, whitespace, timesec, http_request_method, url, vuln_parameter, alter_shell, filename, url_time_response)
session_handler.store_cmd(url, cmd, output, vuln_parameter)
_ = True
else:
output = session_handler.export_stored_cmd(url, cmd, vuln_parameter)
target_os = output
if settings.VERBOSITY_LEVEL <= 1 and not menu.options.ignore_session and _:
print ""
if target_os:
if settings.TARGET_OS != "win":
cmd = settings.DISTRO_INFO
if session_handler.export_stored_cmd(url, cmd, vuln_parameter) == None or menu.options.ignore_session:
if settings.VERBOSITY_LEVEL <= 1 and not menu.options.ignore_session and _:
sys.stdout.write("")
check_how_long, output = tb_injector.injection(separator, maxlen, TAG, cmd, prefix, suffix, whitespace, timesec, http_request_method, url, vuln_parameter, alter_shell, filename, url_time_response)
session_handler.store_cmd(url, cmd, output, vuln_parameter)
else:
output = session_handler.export_stored_cmd(url, cmd, vuln_parameter)
distro_name = output
if len(distro_name) != 0:
target_os = target_os + " (" + distro_name + ")"
if settings.TARGET_OS == "win":
cmd = settings.WIN_RECOGNISE_HP
else:
cmd = settings.RECOGNISE_HP
if session_handler.export_stored_cmd(url, cmd, vuln_parameter) == None or menu.options.ignore_session:
if settings.VERBOSITY_LEVEL <= 1 and not menu.options.ignore_session and _:
sys.stdout.write("\n")
# The main command injection exploitation.
check_how_long, output = tb_injector.injection(separator, maxlen, TAG, cmd, prefix, suffix, whitespace, timesec, http_request_method, url, vuln_parameter, alter_shell, filename, url_time_response)
session_handler.store_cmd(url, cmd, output, vuln_parameter)
else:
output = session_handler.export_stored_cmd(url, cmd, vuln_parameter)
target_arch = output
if target_arch:
if settings.VERBOSITY_LEVEL <= 1 and not menu.options.ignore_session and _:
print ""
success_msg = "The target operating system is " + target_os + Style.RESET_ALL
success_msg += Style.BRIGHT + " and the hardware platform is " + target_arch
sys.stdout.write(settings.print_success_msg(success_msg) + ".")
sys.stdout.flush()
# Add infos to logs file.
output_file = open(filename, "a")
success_msg = "The target operating system is " + target_os
success_msg += " and the hardware platform is " + target_arch + ".\n"
output_file.write(re.compile(re.compile(settings.ANSI_COLOR_REMOVAL)).sub("",settings.SUCCESS_SIGN) + success_msg)
output_file.close()
else:
warn_msg = "Heuristics have failed to retrieve the system information."
print settings.print_warning_msg(warn_msg)
开发者ID:security-geeks,项目名称:commix,代码行数:57,代码来源:tb_enumeration.py
注:本文中的src.utils.settings.print_success_msg函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论