本文整理汇总了Python中CTCore.alert_message方法的典型用法代码示例。如果您正苦于以下问题:Python CTCore.alert_message方法的具体用法?Python CTCore.alert_message怎么用?Python CTCore.alert_message使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CTCore
的用法示例。
在下文中一共展示了CTCore.alert_message方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: check_path
# 需要导入模块: import CTCore [as 别名]
# 或者: from CTCore import alert_message [as 别名]
def check_path(path,type="file"):
directory = os.path.dirname(path)
if type == "file" and os.path.isdir(path):
CTCore.alert_message("Please specify a full path and not a folder",msg_type.ERROR)
return False
if not os.path.isdir(directory):
print newLine + " Directory {} doesn't exists. Create? (Y/n):".format(directory),
ans = raw_input()
if ans.lower() == "y" or ans == "":
os.makedirs(directory)
return True
else:
return False
else:
return True
示例2: main
# 需要导入模块: import CTCore [as 别名]
# 或者: from CTCore import alert_message [as 别名]
def main(args, pcap_file):
if (args.update):
CTCore.update_captipper()
CTCore.pcap_file = pcap_file[0]
print("[A] Analyzing PCAP: " + CTCore.pcap_file)
start_ws = args.server_off # Boolean to start web server
CTCore.PORT = args.port # Web server port
CTCore.b_use_short_uri = args.short_url # Display short URI paths
CTCore.b_auto_ungzip = args.ungzip
if(args.report is not None):
CTCore.b_auto_ungzip = True
parse_pcap.run(CTCore.pcap_file)
if not CTCore.conversations:
sys.exit("No HTTP conversations were found in PCAP file")
print(CTCore.newLine + "[+] Traffic Activity Time: "),
try:
print(CTCore.activity_date_time)
except:
print "Couldn't retrieve time"
print("[+] Conversations Found:" + CTCore.newLine)
CTCore.show_conversations()
if (start_ws and args.dump is None and args.report is None):
try:
CTCore.web_server = server()
CTCore.web_server.start()
time.sleep(0.1) # Fixes graphic issues
CTCore.web_server_turned_on = True
except Exception,e:
CTCore.alert_message("Error starting Web Server:", CTCore.msg_type.ERROR)
if str(e).find("Errno 1004") > 0 or str(e).find("Errno 98") > 0:
print " Port " + str(CTCore.PORT) + " is already taken."
print " Change the port using 'CapTipper.py <pcap_file> -p <port=80>' or use '-s' to disable web server"
print " Proceeding without starting the web server..." + CTCore.newLine
else:
print " " + str(e)