This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository mum. See http://git.chorem.org/mum.git commit adf329d9e8b8ccd83e2df99f82974d4d9386f83b Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Fri Apr 24 10:05:10 2015 +0200 traceroute saved with nmap scan + bugfix on db --- app/modules/nmap_detection.py | 10 ++++++++-- app/modules/storage_modules/shelve_db.py | 3 ++- app/mum.py | 8 ++++---- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/app/modules/nmap_detection.py b/app/modules/nmap_detection.py index 873ed6a..85991b4 100644 --- a/app/modules/nmap_detection.py +++ b/app/modules/nmap_detection.py @@ -146,8 +146,8 @@ class nmap_detection: dict_host = {} dict_host['addr'] = address.getAttribute('addr') - dict_host['date'] = host.getAttribute('endtime') - dict_host['state'] = status.getAttribute('state') + #dict_host['date'] = host.getAttribute('endtime') + #dict_host['state'] = status.getAttribute('state') dict_host['os'] = 'unknown' # par defaut hostnames_elem = host.getElementsByTagName('hostnames')[0] @@ -168,6 +168,12 @@ class nmap_detection: dict_port['portid'] = port.getAttribute('portid') dict_port['portname'] = service.getAttribute('name') list_dict_port.append(dict_port) + trace_elem = host.getElementsByTagName('trace')[0] + dict_host['traceroute'] = [] + for hop in trace_elem.getElementsByTagName('hop'): + dict_host['traceroute'].append(hop.getAttribute("ipaddr")) + if dict_host['addr'] in dict_host['traceroute']: + dict_host['traceroute'].remove(dict_host['addr']) dict_host['openports'] = list_dict_port # the host have its IP for ID on the db self.db.add_host(dict_host['addr'], diff --git a/app/modules/storage_modules/shelve_db.py b/app/modules/storage_modules/shelve_db.py index e26486e..0bee1c9 100644 --- a/app/modules/storage_modules/shelve_db.py +++ b/app/modules/storage_modules/shelve_db.py @@ -638,7 +638,8 @@ class shelve_db: rem_instr['mod_name'] = mod_name dict_instr['rem'].append(rem_instr) # and from the monitoring data structure - del self.db['hosts'][addr_host]['monitoring'][mod_name] + if mod_name in self.db['hosts'][addr_host]['monitoring']: + del self.db['hosts'][addr_host]['monitoring'][mod_name] state = 'success' for mod_in_monitoring in self.db['hosts'][addr_host]['monitoring']: if self.db['hosts'][addr_host]['monitoring'][mod_in_monitoring]['state'] == 'danger': diff --git a/app/mum.py b/app/mum.py index 2a711bb..1f9653d 100755 --- a/app/mum.py +++ b/app/mum.py @@ -157,9 +157,9 @@ def receive(ws): ws.send(json.dumps({"RES_GET_LOADED_CONN_MOD": ml.get_info_mod_conn()})) elif code == "GET_LOADED_NOTIF_MOD": # asekd from notification parameters page ws.send(json.dumps({"RES_GET_LOADED_NOTIF_MOD": ml.get_info_mod_notification()})) - elif code == "GET_ALL_SUBSCRIPTIONS": # asekd from notification parameters page + elif code == "GET_ALL_SUBSCRIPTIONS": # asekd from notification parameters page ws.send(json.dumps({"RES_GET_ALL_SUBSCRIPTIONS": ml.get_all_subscriptions()})) - elif code == "SET_IDLE_STATE": + elif code == "SET_IDLE_STATE": # asked from hostpage ml.set_idling_state(msg["SET_IDLE_STATE"]) dict_host_info = ml.get_host_info(msg["SET_IDLE_STATE"]) dict_host_info['loaded_moni_mod'] = ml.get_info_mod_monitoring() @@ -168,7 +168,7 @@ def receive(ws): elif code == "SET_MOD_ACTIVATION": # asked from hostpage, at the block activation conf ml.update_activated_modules(msg["SET_MOD_ACTIVATION"]) ws.send(json.dumps({"RES_GET_HOSTS": ml.db.get_hosts()})) - elif code == "TEST_CONN": + elif code == "TEST_CONN": # asked from hostpage, at the connection configuration modal try: ml.test_connection(msg["TEST_CONN"]["addr_host"], msg["TEST_CONN"]["conn_mod_name"]) @@ -183,7 +183,7 @@ def receive(ws): ws.send(json.dumps({"RES_INFO_HOST": ml.get_host_info(args['addr_host'])})) elif code == "GET_KEYS_LIST": # asked from hostpage, at the connection configuration ws.send(json.dumps({"KEYS_LIST": ml.get_public_keys_list()})) - elif code == "TASK_LIST": + elif code == "TASK_LIST": # asked from the header controller ws.send(json.dumps({"RES_TASK_LIST": ml.get_db().get_task_list()})) else: break -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.