当前位置: 首页>>代码示例>>Python>>正文


Python toolbox.debug_output函数代码示例

本文整理汇总了Python中Malcom.auxiliary.toolbox.debug_output函数的典型用法代码示例。如果您正苦于以下问题:Python debug_output函数的具体用法?Python debug_output怎么用?Python debug_output使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了debug_output函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

	def __init__(self, analytics_instance):
		super(AnalyticsMessenger, self).__init__()
		self.name = 'analytics'
		self.analytics_instance = analytics_instance
		self.subscribe_channel('analytics', self.message_handler)
		#self.status_update()
		debug_output("[+] Analytics Messenger started")
开发者ID:Abdullah-Mughal,项目名称:malcom,代码行数:7,代码来源:messenger.py

示例2: analyze

    def analyze(self, line):

        line = line.strip()
        sline = line.split()
        try:
            if line[0] != "#" and len(sline) > 2:  # ignore comments and entries with no clear reference
                if sline[0].isdigit():
                    del sline[0]  # remove the useless first field

                _hostname = Hostname(hostname=sline[0])

                evil = {}
                evil["source"] = self.name
                evil["id"] = md5.new(sline[0] + sline[1]).hexdigest()
                evil["description"] = sline[1]  # malware, EK, etc
                evil["reference"] = sline[2]  # GG safe browsing, blog, other blacklist, etc...

                if sline[3]:  # add the last date of inclusion in the feed
                    if sline[3] == "relisted" and sline[4]:
                        evil["date_added"] = datetime.datetime.strptime(sline[4], "%Y%m%d")
                    else:
                        evil["date_added"] = datetime.datetime.strptime(sline[3], "%Y%m%d")

                _hostname.add_evil(evil)
                _hostname.seen(first=evil["date_added"])
                self.commit_to_db(_hostname)
        except Exception, e:
            toolbox.debug_output(str(e), type="error")
开发者ID:rajivraj,项目名称:malcom,代码行数:28,代码来源:malware_domains_dot_com.py

示例3: analytics

	def analytics(self):

		debug_output( "(host analytics for %s)" % self.value)

		new = []

		# only resolve A and CNAME records for subdomains
		if toolbox.is_subdomain(self.value):
			dns_info = toolbox.dns_get_records(self.value, ['A', 'CNAME'])
		else:
			dns_info = toolbox.dns_get_records(self.value)

		for rtype in dns_info:
				for entry in dns_info[rtype]:
					art = toolbox.find_artifacts(entry)
					for t in art:
						for findings in art[t]:
							if t == 'hostnames':
								new.append((rtype, Hostname(findings)))
							if t == 'urls':
								new.append((rtype, Url(findings)))
							if t == 'ips':
								new.append((rtype, Ip(findings)))


		# is _hostname a subdomain ?
		if len(self.value.split(".")) > 2:
			domain = toolbox.is_subdomain(self.value)
			if domain:
				new.append(('domain', Hostname(domain)))

		self['last_analysis'] = datetime.datetime.utcnow()
		self['next_analysis'] = self['last_analysis'] + datetime.timedelta(seconds=self['refresh_period'])

		return new
开发者ID:Abdullah-Mughal,项目名称:malcom,代码行数:35,代码来源:datatypes.py

示例4: send_nodes

	def send_nodes(self, elts=[], edges=[]):
		
		for e in elts:
			e['fields'] = e.display_fields

		data = { 'querya': {}, 'nodes':elts, 'edges': edges, 'type': 'nodeupdate'}
		try:
			if (len(elts) > 0 or len(edges) > 0) and self.ws:
				self.ws.send(dumps(data))
		except Exception, e:
			debug_output("Could not send nodes: %s" % e)
开发者ID:Rogunix,项目名称:malcom,代码行数:11,代码来源:netsniffer.py

示例5: analytics

	def analytics(self):
		debug_output("(url analytics for %s)" % self['value'])

		new = []
		#link with hostname
		# host = toolbox.url_get_host(self['value'])
		# if host == None:
		# 	self['hostname'] = "No hostname"
		# else:
		# 	self['hostname'] = host

		# find path
		path, scheme, hostname = toolbox.split_url(self['value'])
		self['path'] = path
		self['scheme'] = scheme
		self['hostname'] = hostname

		if toolbox.is_ip(self['hostname']):
			new.append(('host', Ip(toolbox.is_ip(self['hostname']))))
		elif toolbox.is_hostname(self['hostname']):
			new.append(('host', Hostname(toolbox.is_hostname(self['hostname']))))
		else:
			debug_output("No hostname found for %s" % self['value'], type='error')
			return

		self['last_analysis'] = datetime.datetime.utcnow()
		
		
		return new
开发者ID:2xyo,项目名称:malcom,代码行数:29,代码来源:datatypes.py

示例6: generate_pcap

	def generate_pcap(self):
		if len (self.pkts) > 0:
			debug_output("Generating PCAP for %s (length: %s)" % (self.name, len(self.pkts)))
			filename = Malcom.config['SNIFFER_DIR'] + "/" + self.pcap_filename
			wrpcap(filename, self.pkts)
			debug_output("Saving session to DB")
			self.analytics.data.save_sniffer_session(self)
开发者ID:Rogunix,项目名称:malcom,代码行数:7,代码来源:netsniffer.py

示例7: __init__

    def __init__(self, feedengine_instance):
        super(FeedsMessenger, self).__init__()
        self.name = "feeds"
        self.feedengine_instance = feedengine_instance

        debug_output("[+] Feed messenger started")
        self.subscribe_channel('feeds', self.message_handler)
开发者ID:batidiane,项目名称:malcom,代码行数:7,代码来源:messenger.py

示例8: send_nodes

 def send_nodes(self, elts=[], edges=[]):
     data = {"querya": {}, "nodes": elts, "edges": edges, "type": "nodeupdate"}
     try:
         if (len(elts) > 0 or len(edges) > 0) and self.ws:
             self.ws.send(dumps(data))
     except Exception, e:
         debug_output("Could not send nodes: %s" % e)
开发者ID:heinbrian,项目名称:malcom,代码行数:7,代码来源:netsniffer.py

示例9: get_pcap

 def get_pcap(self):
     debug_output("Generating PCAP (length: %s)" % len(self.pkts))
     if len(self.pkts) == 0:
         return ""
     wrpcap("/tmp/temp.cap", self.pkts)
     pcap = open("/tmp/temp.cap").read()
     return pcap
开发者ID:heinbrian,项目名称:malcom,代码行数:7,代码来源:netsniffer.py

示例10: __init__

	def __init__(self):
		super(SnifferMessenger, self).__init__()
		self.name = 'sniffer'
		self.snifferengine = None
		self.subscribe_channel('sniffer-commands', self.command_handler)
		self.command_lock = threading.Lock()
		debug_output("[+] Sniffer Messenger started")
开发者ID:CYJ,项目名称:malcom,代码行数:7,代码来源:messenger.py

示例11: load_yara_rules

	def load_yara_rules(self, path):
		debug_output("Compiling YARA rules from %s" % path)
		if path[-1] != '/':	path += '/' # add trailing slash if not present
		filepaths = {}
		for file in os.listdir(path):
			filepaths[file] = path + file
		debug_output("Loaded %s YARA rule files in %s" % (len(filepaths), path))
		return yara.compile(filepaths=filepaths)
开发者ID:eldraco,项目名称:malcom,代码行数:8,代码来源:netsniffer.py

示例12: run_scheduled_feeds

	def run_scheduled_feeds(self):
		for feed_name in [f for f in self.feeds if (self.feeds[f].next_run < datetime.utcnow() and self.feeds[f].enabled)]:	
			debug_output('Starting thread for feed %s...' % feed_name)
			self.run_feed(feed_name)

		for t in self.threads:
			if self.threads[t].is_alive():
				self.threads[t].join()
开发者ID:eldraco,项目名称:malcom,代码行数:8,代码来源:feed.py

示例13: run_all_feeds

    def run_all_feeds(self):
        debug_output("Running all feeds")
        for feed_name in [f for f in self.feeds if self.feeds[f].enabled]:
            debug_output("Starting thread for feed %s..." % feed_name)
            self.run_feed(feed_name)

        for t in self.threads:
            if self.threads[t].is_alive():
                self.threads[t].join()
开发者ID:Rogunix,项目名称:malcom,代码行数:9,代码来源:feed.py

示例14: broadcast

	def broadcast(self, msg, channel, type="bcast"):
		queryid = str(random.random())

		message = json.dumps({'msg': msg, 'queryid': queryid, 'src': self.name, 'type':type})
		try:
			# print "broadcast [%s] : %s" % (channel, type)
			self.r.publish(channel, message)
		except Exception, e:
			debug_output("Could not broadcast: %s" % (e), 'error')
开发者ID:eldraco,项目名称:malcom,代码行数:9,代码来源:SharedData.py

示例15: load_pcap

	def load_pcap(self):

		filename = self.pcap_filename
		debug_output("Loading PCAP from %s " % filename)
		self.pkts += self.sniff(stopper=self.stop_sniffing, filter=self.filter, prn=self.handlePacket, stopperTimeout=1, offline=Malcom.config['SNIFFER_DIR']+"/"+filename)	
		
		debug_output("Loaded %s packets from file." % len(self.pkts))

		return True
开发者ID:Rogunix,项目名称:malcom,代码行数:9,代码来源:netsniffer.py


注:本文中的Malcom.auxiliary.toolbox.debug_output函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。