Пример #1
0
	def search_all(s_item):
		misp = misp_conn.MakeConn().get()
		result = misp.search_all(s_item['search'])
		if json_data['quiet']:
			for e in result['response']:
				return '{}{}{}\n'.format(url, '/events/view/', e['Event']['id'])
		elif out is None:
			return json.dumps(result['response'])
		else:
			with open(s_item['output'],'w') as search_res:
				search_res.write(json.dumps(result['response']))
Пример #2
0
	def search_params(json_data):
		if json_data['attributes']:
			controller = 'attributes'
		else:
			controller = 'events'
		misp = misp_conn.MakeConn().get()
		kwargs = {json_data['param']:json_data['search']}
		result = misp.search(controller, **kwargs)
		if json_data['quiet']:
			for e in result['response']:
				return '{}{}{}\n'.format(url, '/events/view/', e['Event']['id'])
		elif out is None:
			return json.dumps(result['response'])
		else:
			with open(json_data['output'],'w') as search_res:
				search_res.write(json.dumps(result['response']))
Пример #3
0
 def make_conn():
     return misp_conn.MakeConn().get()
Пример #4
0
 def add_attr(evattr):
     misp = misp_conn.MakeConn().get()
     past_event = misp.get_event(evattr.get("attr", "event"))
     new_event = misp.add_named_attribute(past_event,
                                          evattr.get("attr", "type"),
                                          evattr.get("attr", "value"))
Пример #5
0
	def get_event(eids):
		if eids >0:
			misp = misp_conn.MakeConn().get()
			json_event = misp.get_event(eids)
			return json_event
Пример #6
0
	def get_all_feeds():
		misp = misp_conn.MakeConn().get()
		return misp.cache_all_feeds()
Пример #7
0
    def connect_misp():

        return misp_conn.MakeConn().get()
Пример #8
0
 def feed_event(events):
     misp = misp_conn.MakeConn().get()
     feed_id = events.get("fetch", "feedid")
     return misp.fetch_feed(feed_id)