branch develop updated (d2a9fd9 -> 50c9f8c)
This is an automated email from the git hooks/post-receive script. New change to branch develop in repository mum. See http://git.chorem.org/mum.git from d2a9fd9 modules that don't need a connection launched separately (ping, http, smtp) + autoconf after scan also for these ones new 8ccda8f added timeout on smtp module => without, the thread RunMonitoring may not end new 50c9f8c new nmap params for UDP port of snmp detection + corrected init_conn + using telnetlib for smtp check The 2 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Detailed log of new commits: commit 50c9f8cf9b5c9c9796fef9086adbd47306d3488b Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Thu Apr 23 11:36:22 2015 +0200 new nmap params for UDP port of snmp detection + corrected init_conn + using telnetlib for smtp check commit 8ccda8f67e86cdff4ad1fd1b65e93cc45382a112 Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Wed Apr 22 17:31:48 2015 +0200 added timeout on smtp module => without, the thread RunMonitoring may not end Summary of changes: app/module_loader.py | 1 + app/modules/monitoring_modules/http.py | 6 ++++-- app/modules/monitoring_modules/smtp.py | 7 +++---- app/modules/nmap_detection.py | 6 +++++- app/modules/storage_modules/shelve_db.py | 25 ++++++++++++++++++------- app/process_monitoring.py | 5 +++-- static/js/controllers/scanCtrl.js | 2 +- views/hostpage.html | 3 +-- 8 files changed, 36 insertions(+), 19 deletions(-) -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
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 8ccda8f67e86cdff4ad1fd1b65e93cc45382a112 Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Wed Apr 22 17:31:48 2015 +0200 added timeout on smtp module => without, the thread RunMonitoring may not end --- app/modules/monitoring_modules/http.py | 4 +++- app/modules/monitoring_modules/smtp.py | 3 +-- app/modules/storage_modules/shelve_db.py | 4 ---- app/process_monitoring.py | 5 +++-- views/hostpage.html | 3 +-- 5 files changed, 8 insertions(+), 11 deletions(-) diff --git a/app/modules/monitoring_modules/http.py b/app/modules/monitoring_modules/http.py index 56d3327..97c5b0a 100644 --- a/app/modules/monitoring_modules/http.py +++ b/app/modules/monitoring_modules/http.py @@ -16,7 +16,9 @@ def check(addr_host, port_list, cnfe): for i in range(len(port_list)): if port_list[i]['portname'] == part: http_port_found = True - res_http_check = urllib2.urlopen("http://" + addr_host + ":" + str(port_list[i]['portid']) + res_http_check = urllib2.urlopen("http://" + addr_host + ":" + str(port_list[i]['portid']), + None, + 10 ).getcode() == 200 if not http_port_found: exception_inst = getattr(cnfe, "CommandNotFoundException")( diff --git a/app/modules/monitoring_modules/smtp.py b/app/modules/monitoring_modules/smtp.py index f21ae0a..d5d37a9 100644 --- a/app/modules/monitoring_modules/smtp.py +++ b/app/modules/monitoring_modules/smtp.py @@ -16,8 +16,7 @@ def check(addr_host, port_list, cnfe): for i in range(len(port_list)): if port_list[i]['portname'] == part: smtp_port_found = True - s = smtplib.SMTP(addr_host, str(port_list[i]['portid'])) - s.quit() + smtplib.SMTP(addr_host, str(port_list[i]['portid']), None, 10) if not smtp_port_found: exception_inst = getattr(cnfe, "CommandNotFoundException")( part, addr_host diff --git a/app/modules/storage_modules/shelve_db.py b/app/modules/storage_modules/shelve_db.py index d32612a..0b3662b 100644 --- a/app/modules/storage_modules/shelve_db.py +++ b/app/modules/storage_modules/shelve_db.py @@ -6,8 +6,6 @@ import json import shelve import traceback import threading -import socket - import os.path @@ -162,8 +160,6 @@ class shelve_db: (see get_conection_modules_list() on module_loader) :param dict_mod_info: a dictionnary containing informations about the different monitoring modules (see get_info_mod_monitoring() on module_loader) - :param a list of integers representing the known ports for the connection modules, that may not have been - detected by nmap """ self.open_db() addr_host = str(addr_host) # Shelve doesn't support Unicode diff --git a/app/process_monitoring.py b/app/process_monitoring.py index efafd13..f9c7982 100644 --- a/app/process_monitoring.py +++ b/app/process_monitoring.py @@ -130,9 +130,10 @@ class RunMonitoring(threading.Thread): self.wsc = wsc def run(self): - sys.stdout.flush() + #sys.stdout.flush() for dict_mod in self.list_dict_mod: + #sys.stdout.flush() #print "Launching " + str(dict_mod['mod_name']) + " on " + str(dict_mod['addr']) - sys.stdout.flush() + #sys.stdout.flush() self.ml.run_one_monitoring_module(dict_mod['mod_name'], dict_mod['addr']) self.wsc.notify_state_change() \ No newline at end of file diff --git a/views/hostpage.html b/views/hostpage.html index cc79503..24aa4e2 100644 --- a/views/hostpage.html +++ b/views/hostpage.html @@ -116,12 +116,11 @@ <script type="text/ng-template" id="modal_conf_label.html"> <div class="modal-header"> - <h3 class="modal-title">Configure</h3> + <h3 class="modal-title">Configure {{conf_args.mod_name}} for {{conf_args.addr_host}}</h3> </div> <div class="modal-body"> <form> <div class="form-group"> - <h3>{{conf_args.mod_name}}</h3> <label for="freq">Frequency check: each</label> <div class="row" id="freq"> <div class="col-xs-2"> -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
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 50c9f8cf9b5c9c9796fef9086adbd47306d3488b Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Thu Apr 23 11:36:22 2015 +0200 new nmap params for UDP port of snmp detection + corrected init_conn + using telnetlib for smtp check --- app/module_loader.py | 1 + app/modules/monitoring_modules/http.py | 2 +- app/modules/monitoring_modules/smtp.py | 6 +++--- app/modules/nmap_detection.py | 6 +++++- app/modules/storage_modules/shelve_db.py | 21 ++++++++++++++++++--- static/js/controllers/scanCtrl.js | 2 +- 6 files changed, 29 insertions(+), 9 deletions(-) diff --git a/app/module_loader.py b/app/module_loader.py index 174ce9c..bd78d61 100644 --- a/app/module_loader.py +++ b/app/module_loader.py @@ -27,6 +27,7 @@ class ModuleLoader: def __init__(self, conf): self.conf = conf self.db = self.load_db(self.conf['keys_location']) + self.db.reset_tasks() self.loaded_mod_moni = {} # See load_all_monitoring_modules self.loaded_mod_detect = {} # See load_all_detection_modules self.loaded_mod_conn = {} # See load_all_connection_modules diff --git a/app/modules/monitoring_modules/http.py b/app/modules/monitoring_modules/http.py index 97c5b0a..8ba058f 100644 --- a/app/modules/monitoring_modules/http.py +++ b/app/modules/monitoring_modules/http.py @@ -27,4 +27,4 @@ def check(addr_host, port_list, cnfe): raise exception_inst return res_http_check except urllib2.URLError: - res_http_check = False \ No newline at end of file + return False \ No newline at end of file diff --git a/app/modules/monitoring_modules/smtp.py b/app/modules/monitoring_modules/smtp.py index d5d37a9..253d5bc 100644 --- a/app/modules/monitoring_modules/smtp.py +++ b/app/modules/monitoring_modules/smtp.py @@ -1,6 +1,6 @@ __author__ = 'aguilbaud' -import smtplib +import telnetlib compatible_os = ["all"] block = "network" @@ -16,7 +16,7 @@ def check(addr_host, port_list, cnfe): for i in range(len(port_list)): if port_list[i]['portname'] == part: smtp_port_found = True - smtplib.SMTP(addr_host, str(port_list[i]['portid']), None, 10) + res_smtp_check = telnetlib.Telnet(addr_host, int(port_list[i]['portid']), 10).read_some() != "" if not smtp_port_found: exception_inst = getattr(cnfe, "CommandNotFoundException")( part, addr_host @@ -24,4 +24,4 @@ def check(addr_host, port_list, cnfe): raise exception_inst return res_smtp_check except Exception: - res_smtp_check = False \ No newline at end of file + return False \ No newline at end of file diff --git a/app/modules/nmap_detection.py b/app/modules/nmap_detection.py index 532d2db..873ed6a 100644 --- a/app/modules/nmap_detection.py +++ b/app/modules/nmap_detection.py @@ -122,7 +122,11 @@ class nmap_detection: # save directly it on the database def parse_res(self, ip): # opening the xml file with minidom parser - root = minidom.parse(self.filename) + try: + root = minidom.parse(self.filename) + except IOError: + exception_inst = getattr(self.HostNotFoundException, "HostNotFoundException")(ip) + raise exception_inst pexpect.run("rm -f " + self.filename) collection = root.documentElement diff --git a/app/modules/storage_modules/shelve_db.py b/app/modules/storage_modules/shelve_db.py index 0b3662b..16aa2ed 100644 --- a/app/modules/storage_modules/shelve_db.py +++ b/app/modules/storage_modules/shelve_db.py @@ -51,6 +51,15 @@ class shelve_db: self.db = None self.lock.release() + def reset_tasks(self): + self.open_db() + try: + self.db['tasks'] = [] + except Exception: + print traceback.format_exc() + finally: + self.close_db() + def init_global_conf(self, loaded_mod_moni): """ This method is executed once at each launch of the application. @@ -217,9 +226,15 @@ class shelve_db: if port["portname"] in conn_infos: # if this open port is part of the loaded connections dict_conn[port["portname"]] = {} - for param in conn_infos[port["portname"]]['params']: - dict_conn[port["portname"]][param] = None - dict_conn[port["portname"]]["priority"] = 0 + if len(conn_infos[port['portname']]['params'].keys()) == 1 and \ + 'port' in conn_infos[port['portname']]['params']: + # if there is only the port to configure, the conn module can be activated because is + # already configured + dict_conn[port["portname"]]["priority"] = 1 + else: + for param in conn_infos[port["portname"]]['params']: + dict_conn[port["portname"]][param] = None + dict_conn[port["portname"]]["priority"] = 0 dict_conn[port["portname"]]["port"] = int(port["portid"]) else: for loaded_conn_mod in conn_infos: diff --git a/static/js/controllers/scanCtrl.js b/static/js/controllers/scanCtrl.js index 6b3e306..d30ae6d 100644 --- a/static/js/controllers/scanCtrl.js +++ b/static/js/controllers/scanCtrl.js @@ -8,7 +8,7 @@ mumApp.controller('scanCtrl', function($scope, $rootScope) { $scope.show_opt = false; - $scope.nmap_options = "-A -Pn --unprivileged"; + $scope.nmap_options = "-sU -sS -p U:161,T:1-8080,61209 -A -Pn"; $scope.$on("success", function (event, args) { $scope.state = "Success!"; -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
participants (1)
-
chorem.org scm