branch develop updated (12a97ad -> 0251b6b)
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 12a97ad added 5 and 10 min load mod + highest value on hostpage + 10 min fock default check + rounded stats + dashboard url updated on status filter new 592b0ac shelve doesn't need the key loc to instanciate + conf file loc argument can be a folder (.conf files read in lex order) new f6c5213 scan options can be specified on configuration file + scan page redone new 1793e09 bugfixes on new scan + total machines on header new 0251b6b scan conf can contain informations about the options + changes on scanpage The 4 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 0251b6b0d13e77c0c4fa5e3070a604953e599cee Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Thu May 28 13:57:45 2015 +0200 scan conf can contain informations about the options + changes on scanpage commit 1793e094f0f75b969752dc06391efc91db216249 Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Thu May 28 09:47:57 2015 +0200 bugfixes on new scan + total machines on header commit f6c5213f788e75b93ebfb6ab6f3cb4115b9edd5b Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Wed May 27 15:44:50 2015 +0200 scan options can be specified on configuration file + scan page redone commit 592b0acaa93bb5c66b84f9f561377f77fd417f86 Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Wed May 27 10:47:37 2015 +0200 shelve doesn't need the key loc to instanciate + conf file loc argument can be a folder (.conf files read in lex order) Summary of changes: app/module_loader.py | 39 ++++++++++-------- app/modules/storage_modules/shelve_db.py | 3 +- app/mum.py | 43 +++++++++++++++++--- app/websocket_func.py | 33 ++++++---------- mum.conf | 9 ++++- static/js/controllers/headCtrl.js | 16 +++++--- static/js/controllers/scanCtrl.js | 36 ++++++----------- views/index.html | 9 +++-- views/scan.html | 68 +++++++++++++++++++------------- 9 files changed, 150 insertions(+), 106 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 592b0acaa93bb5c66b84f9f561377f77fd417f86 Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Wed May 27 10:47:37 2015 +0200 shelve doesn't need the key loc to instanciate + conf file loc argument can be a folder (.conf files read in lex order) --- app/module_loader.py | 6 +++--- app/modules/storage_modules/shelve_db.py | 3 +-- app/mum.py | 33 +++++++++++++++++++++++++++----- 3 files changed, 32 insertions(+), 10 deletions(-) diff --git a/app/module_loader.py b/app/module_loader.py index 99501b1..6ca0034 100644 --- a/app/module_loader.py +++ b/app/module_loader.py @@ -26,7 +26,7 @@ class ModuleLoader: """ def __init__(self, conf): self.conf = conf - self.db = self.load_db(self.conf['keys_location']) + self.db = self.load_db() self.db.reset_tasks() self.loaded_mod_moni = {} # See load_all_monitoring_modules self.loaded_mod_detect = {} # See load_all_detection_modules @@ -35,14 +35,14 @@ class ModuleLoader: self.compatible_os_list = ['other'] # Will contain the list of os compatibles for every monitoring module loaded self.wsc = WebSocketContainer(self.db) - def load_db(self, key_loc): + def load_db(self): """ Creates an instance of the class shelve_db from storage_modules. :return: an instance of the shelve_db class """ db_name = "shelve_db" db = __import__("modules.storage_modules." + db_name, fromlist=modules.storage_modules) - db_instance = getattr(db, db_name)(self.conf['db_location'], key_loc) + db_instance = getattr(db, db_name)(self.conf['db_location']) return db_instance def get_db(self): diff --git a/app/modules/storage_modules/shelve_db.py b/app/modules/storage_modules/shelve_db.py index 4786513..579b56f 100644 --- a/app/modules/storage_modules/shelve_db.py +++ b/app/modules/storage_modules/shelve_db.py @@ -18,11 +18,10 @@ class shelve_db: Storage module for the persistant objects in Python : Shelve. Every function in need to access the database have to be implemented on this class. """ - def __init__(self, db_loc, key_loc): + def __init__(self, db_loc): self.db = None self.lock = threading.Lock() self.db_loc = db_loc - self.key_loc = key_loc def open_db(self): """ diff --git a/app/mum.py b/app/mum.py index efc48bd..d369a3e 100755 --- a/app/mum.py +++ b/app/mum.py @@ -120,15 +120,38 @@ if __name__ == '__main__': parser.add_argument("--smtp_server", help="name of the SMTP server to send e-mail notifications") parser.add_argument("--smtp_port", help="port number of the SMTP server") parser.add_argument("--smtp_address", help="e-mail address of the sender for e-mail notifications") + parser.add_argument("--scan", help="nmap scan option in JSON format : {str_name_scan: str_scan_options}") args = parser.parse_args() # creating the default conf structure from the configuration file conf = {} - fconf = open(args.conf_loc, 'r') - for line in fconf.read().splitlines(): - fields = line.split('=') - conf[fields[0]] = fields[1] - fconf.close() + + files_to_read = [] + + if os.path.isfile(args.conf_loc): + # the argument is a file name + files_to_read.append(args.conf_loc) + else: + # the argument is a directory name + path = args.conf_loc + '/' + for dir_content in os.listdir(args.conf_loc): + files_to_read.append(str(path + dir_content)) + # sorting the list in lexicographic order + files_to_read = sorted(files_to_read, key=str.lower) + + found_conf_file = False + for file_name in files_to_read: + # we read only files with '.conf' extension + if re.search('^.+\.conf$', file_name): + found_conf_file = True + fconf = open(file_name, 'r') + for line in fconf.read().splitlines(): + fields = line.split('=') + conf[fields[0]] = fields[1] + fconf.close() + if not found_conf_file: + p = argparse.ArgumentParser() + p.exit(status=0, message="No configuration file found in the path given. Does at least one '.conf' file exists?\n") # now, we overwrite each field of the configuration which are specified by command line argument dict_args = vars(args) -- 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 f6c5213f788e75b93ebfb6ab6f3cb4115b9edd5b Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Wed May 27 15:44:50 2015 +0200 scan options can be specified on configuration file + scan page redone --- app/module_loader.py | 33 +++++++++++-------- app/websocket_func.py | 32 +++++++----------- mum.conf | 3 +- static/js/controllers/headCtrl.js | 3 ++ static/js/controllers/scanCtrl.js | 36 ++++++++------------- views/scan.html | 68 +++++++++++++++++++++++---------------- 6 files changed, 89 insertions(+), 86 deletions(-) diff --git a/app/module_loader.py b/app/module_loader.py index 6ca0034..03f5fbc 100644 --- a/app/module_loader.py +++ b/app/module_loader.py @@ -53,6 +53,10 @@ class ModuleLoader: def get_websocket_container(self): return self.wsc + + def get_scan_options(self): + return json.loads(self.conf['scan']) + """ def get_all_known_ports(self): res = [] @@ -112,24 +116,27 @@ class ModuleLoader: ws.send(json.dumps({"ERROR": hnfe.__str__()})) return None - def create_empty_host(self, addr_host): + def create_empty_host(self, addr_host, ws): """ If for some reason the nmap scan is impossible, it is possible to add a host without preliminary nmap scan. Therefore, a fake empty nmap result is generated and the host is added this way on the database. :param addr_host: a string containing the IP address of the host. """ - fake_nmap_res = {} - fake_nmap_res['os'] = 'unknown' - fake_nmap_res['addr'] = addr_host - fake_nmap_res['hostname'] = '' - fake_nmap_res['openports'] = [] - self.db.add_host(addr_host, - json.dumps(fake_nmap_res), - self.get_conection_modules_list(), - self.get_monitoring_modules_list()) - monitoring_intructions = self.db.get_monitoring_instructions(addr_host) - for instr in monitoring_intructions: - self.add_to_waiting_list(instr) + if re.search('^\d{1,3}[.]\d{1,3}[.]\d{1,3}[.]\d{1,3}$', addr_host): + fake_nmap_res = {} + fake_nmap_res['os'] = 'unknown' + fake_nmap_res['addr'] = addr_host + fake_nmap_res['hostname'] = '' + fake_nmap_res['openports'] = [] + self.db.add_host(addr_host, + json.dumps(fake_nmap_res), + self.get_conection_modules_list(), + self.get_monitoring_modules_list()) + monitoring_intructions = self.db.get_monitoring_instructions(addr_host) + for instr in monitoring_intructions: + self.add_to_waiting_list(instr) + else: + ws.send(json.dumps({"ERROR": "You must specify a valid IP address to add a host without scan"})) def create_connection(self, addr_host, conf_conn): """ diff --git a/app/websocket_func.py b/app/websocket_func.py index 83552eb..1eaafff 100644 --- a/app/websocket_func.py +++ b/app/websocket_func.py @@ -32,17 +32,6 @@ class ThreadDetect(threading.Thread): for instr in monitoring_intructions: self.ml.add_to_waiting_list(instr) self.ml.remove_task(task_name) - """ - # now launching full detection - for ip in json.loads(scanned_ip): - conn = module_loader.load_conn("ssh", ip, "aguilbaud", "/home/aguilbaud/.ssh/id_rsa") - module_loader.run_all_detection_modules(db.get_host_os(ip), conn, db, self.ws) - monitoring_intructions = db.get_monitoring_instructions(ip) - for instr in monitoring_intructions: - process_monitoring.add_to_waiting_list(instr) - #module_loader.run_all_monitoring_modules("unix", conn, db, self.ws) - # adding entries on process monitoring - """ # Launching of the detection after getting a ip range. @@ -55,17 +44,14 @@ def start_first_detection(args, ml, ws): # asked from scan page def NMAP_SCAN_DEMAND(msg, ws, ml): - if os.getegid() != 0: - print "Error: Cannot run nmap without root privileges." - ws.send(json.dumps({"ERROR": "Cannot run nmap without root privileges."})) + if msg["NMAP_SCAN_DEMAND"]["nmap_options"] == '': + ml.create_empty_host(msg["NMAP_SCAN_DEMAND"]["ip_range"], ws) else: - start_first_detection(msg["NMAP_SCAN_DEMAND"], ml, ws) - - -# asked from scan page -def CREATE_EMPTY_HOST(msg, ws, ml): - ml.create_empty_host(msg["CREATE_EMPTY_HOST"]) - ws.send(json.dumps({"SUCCESS_MODULE": "Creation of new host"})) + if os.getegid() != 0: + print "Error: Cannot run nmap without root privileges." + ws.send(json.dumps({"ERROR": "Cannot run nmap without root privileges."})) + else: + start_first_detection(msg["NMAP_SCAN_DEMAND"], ml, ws) # asked from hostpage @@ -166,3 +152,7 @@ def GET_KEYS_LIST(msg, ws, ml): # asked from the header controller def TASK_LIST(msg, ws, ml): ws.send(json.dumps({"RES_TASK_LIST": ml.get_db().get_task_list()})) + + +def GET_SCAN_OPTIONS(msg, ws, ml): + ws.send(json.dumps({"RES_GET_SCAN_OPTIONS": ml.get_scan_options()})) \ No newline at end of file diff --git a/mum.conf b/mum.conf index 1524f55..df375cf 100644 --- a/mum.conf +++ b/mum.conf @@ -5,4 +5,5 @@ external_modules_location= keys_location= smtp_server= smtp_port= -smtp_address= \ No newline at end of file +smtp_address= +scan={"Scan and detect": "-sU -sS -p U:161,T:1-65535 -A -Pn", "Scan only": "-sU -sS -p U:161,T:1-65535", "No scan": ""} \ No newline at end of file diff --git a/static/js/controllers/headCtrl.js b/static/js/controllers/headCtrl.js index 993e171..65415f8 100644 --- a/static/js/controllers/headCtrl.js +++ b/static/js/controllers/headCtrl.js @@ -71,6 +71,9 @@ mumApp.controller('headCtrl', function ($scope, $rootScope, toastr, $interval, $ case "RES_GET_ALL_SUBSCRIPTIONS": $rootScope.$broadcast("resGetAllSubscriptions", obj[key]); break; + case "RES_GET_SCAN_OPTIONS": + $rootScope.$broadcast("resGetScanOptions", obj[key]); + break; case "RES_CALL_FUNC_DB": // Get a result after calling a funcion on the db $rootScope.$broadcast("resCall", obj[key]); break; diff --git a/static/js/controllers/scanCtrl.js b/static/js/controllers/scanCtrl.js index 711f48a..49e259e 100644 --- a/static/js/controllers/scanCtrl.js +++ b/static/js/controllers/scanCtrl.js @@ -1,6 +1,8 @@ -mumApp.controller('scanCtrl', function ($scope, $rootScope, $routeParams) { +mumApp.controller('scanCtrl', function ($scope, $rootScope, $routeParams, $timeout) { // Concerning the scan form + $rootScope.$broadcast("sendViaWs", JSON.stringify({"GET_SCAN_OPTIONS": null})); + if ($routeParams.param == null) { $scope.ip_range = ""; // la plage d'ip entree dans le champ } @@ -8,35 +10,23 @@ mumApp.controller('scanCtrl', function ($scope, $rootScope, $routeParams) { $scope.ip_range = $routeParams.param; } - $scope.state = ""; // l'etat general du scan en cours - $scope.ip_scanned = {}; - - $scope.ip_manual_field = ""; + $scope.nmap_options = {}; - $scope.show_opt = false; + $scope.selected_option = 'No scan'; - $scope.nmap_options = "-sU -sS -p U:161,T:1-65535 -A -Pn"; - - $scope.$on("success", function (event, args) { - $scope.state = "Success!"; - $scope.ip_scanned = args; - }); + $scope.nmap_options_input = ''; - $scope.$on("stateUpdate", function (event, args) { - $scope.state = args; + $scope.$on("resGetScanOptions", function (event, args) { + $timeout(function () { + $scope.nmap_options = args; + }, 0); }); - $scope.validated = false; // pour afficher ou non certaines parties de la page - $scope.scan_is_over = false; // pour afficher ou non certaines parties de la page - - $scope.post_val = function (){ //lace la detection apres remplissage du champ et validation du formulaire + $scope.run_detection = function (){ + $scope.ip_range = ""; var args = {}; args.ip_range = $scope.ip_range; - args.nmap_options = $scope.nmap_options; + args.nmap_options = $scope.nmap_options_input; $rootScope.$broadcast("sendViaWs", JSON.stringify({"NMAP_SCAN_DEMAND": args})); }; - - $scope.create_empty_host = function (){ - $rootScope.$broadcast("sendViaWs", JSON.stringify({"CREATE_EMPTY_HOST": $scope.ip_manual_field})); - } }); \ No newline at end of file diff --git a/views/scan.html b/views/scan.html index 6beb234..d10206a 100644 --- a/views/scan.html +++ b/views/scan.html @@ -1,29 +1,41 @@ <div class="col-md-offset-2 main"> - <h1 class="page-header">Scan for new machines</h1> - <div ng-show="!validated" class="ng-hide"> - <form class="form-inline" ng_submit="post_val()"> - <label for="input_ip_range">Enter a hostname, a single IP or an IP range to scan (example : 198.116.0.1-10)</label> - <input type="text" class="form-control" id="input_ip_range" ng-model="ip_range"/><br/> - <button type="button" - class="btn btn-danger" - ng-click="show_opt = !show_opt">Show nmap options (careful)</button> - <input type="text" class="form-control" ng-show="show_opt" ng-model="nmap_options"/> - <button type="submit" - class="btn btn-primary" - ng-click="validated = true" - ng-disabled="ip_range == ''">Scan now</button> - <p>If you have trouble scanning with nmap on your server, you can add here a host manually, by - indicating its IP address :</p> - <input type="text" class="form-control" ng-model="ip_manual_field"/> - <button type="button" - class="btn btn-primary" - ng-click="create_empty_host()" - ng-disabled="ip_manual_field == ''">Add a host without scan</button> - </form> - - </div> - <div ng-show="validated"> - <p>{{state}}</p> - <p>Scanned IP : {{ip_scanned}}</p> - </div> -</div> + + <h1 class="page-header">Scan for new machines</h1> + + <p>Enter a hostname, a single IP or an IP range to scan:</p> + + <div class="row"> + <div class="col-xs-3"> + <input type="text" class="form-control" ng-model="ip_range"/><br/> + </div> + </div> + + <p>Select or type the nmap options to use for the scan:</p> + + <div class="row"> + <div class="col-xs-2" + ng-repeat="(optname, opt) in nmap_options"> + <input type="radio" name="selected_option" value="{{optname}}" + ng-model="$parent.selected_option" + ng-change="$parent.nmap_options_input = opt"> + {{optname}} + </div> + </div> + + <div class="row"> + <div class="col-md-6"> + <input type="text" class="form-control" + ng-model="nmap_options_input" + ng-change="selected_option = 'custom'"/> + </div> + </div> + + + <div class="row"> + <div class="col-xs-3"> + <button class="btn btn-primary" + ng-click="run_detection()" + ng-disabled="ip_range == ''">Scan now!</button> + </div> + </div> +</div> \ No newline at end of file -- 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 1793e094f0f75b969752dc06391efc91db216249 Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Thu May 28 09:47:57 2015 +0200 bugfixes on new scan + total machines on header --- app/websocket_func.py | 1 + static/js/controllers/headCtrl.js | 13 +++++++------ static/js/controllers/scanCtrl.js | 2 +- views/index.html | 9 +++++---- 4 files changed, 14 insertions(+), 11 deletions(-) diff --git a/app/websocket_func.py b/app/websocket_func.py index 1eaafff..5602f39 100644 --- a/app/websocket_func.py +++ b/app/websocket_func.py @@ -46,6 +46,7 @@ def start_first_detection(args, ml, ws): def NMAP_SCAN_DEMAND(msg, ws, ml): if msg["NMAP_SCAN_DEMAND"]["nmap_options"] == '': ml.create_empty_host(msg["NMAP_SCAN_DEMAND"]["ip_range"], ws) + ws.send(json.dumps({"SUCCESS_MODULE": "New host successfully created"})) else: if os.getegid() != 0: print "Error: Cannot run nmap without root privileges." diff --git a/static/js/controllers/headCtrl.js b/static/js/controllers/headCtrl.js index 65415f8..7e363f0 100644 --- a/static/js/controllers/headCtrl.js +++ b/static/js/controllers/headCtrl.js @@ -138,22 +138,23 @@ mumApp.controller('headCtrl', function ($scope, $rootScope, toastr, $interval, $ }; /* - * Return a vector with the number of hosts with a status of : success, warning, danger, idling + * Return a vector with the number of hosts with a status of : total, success, warning, danger, idling */ $scope.stateNumber = function () { - var res = [0,0,0,0]; + var res = [0,0,0,0,0]; for (var i = 0; i<$scope.items.length; i++) { + res[0] = $scope.items.length; if ($scope.items[i].status === "success") { - res[0]++; + res[1]++; } if ($scope.items[i].status === "warning") { - res[1]++; + res[2]++; } if ($scope.items[i].status === "danger") { - res[2]++; + res[3]++; } if ($scope.items[i].status === "idling") { - res[3]++; + res[4]++; } } return res; diff --git a/static/js/controllers/scanCtrl.js b/static/js/controllers/scanCtrl.js index 49e259e..09830bd 100644 --- a/static/js/controllers/scanCtrl.js +++ b/static/js/controllers/scanCtrl.js @@ -23,10 +23,10 @@ mumApp.controller('scanCtrl', function ($scope, $rootScope, $routeParams, $timeo }); $scope.run_detection = function (){ - $scope.ip_range = ""; var args = {}; args.ip_range = $scope.ip_range; args.nmap_options = $scope.nmap_options_input; $rootScope.$broadcast("sendViaWs", JSON.stringify({"NMAP_SCAN_DEMAND": args})); + $scope.ip_range = ""; }; }); \ No newline at end of file diff --git a/views/index.html b/views/index.html index 08cebaf..6f03c58 100644 --- a/views/index.html +++ b/views/index.html @@ -60,10 +60,11 @@ <span class="icon-bar"></span> </button> <a class="navbar-brand" href="#dashboard.html">Mum</a> - <p class="navbar-text navbar-left"><a href="#dashboard/success" style="color:green">OK : {{stateNumber()[0]}}</a></p> - <p class="navbar-text navbar-left"><a href="#dashboard/warning" style="color:orange">Warning : {{stateNumber()[1]}}</a></p> - <p class="navbar-text navbar-left"><a href="#dashboard/danger" style="color:red">KO : {{stateNumber()[2]}}</a></p> - <p class="navbar-text navbar-left"><a href="#dashboard/idling" style="color:grey">Idling : {{stateNumber()[3]}}</a></p> + <p class="navbar-text navbar-left"><a href="#dashboard" style="color:grey">Total : {{stateNumber()[0]}}</a></p> + <p class="navbar-text navbar-left"><a href="#dashboard/success" style="color:green">OK : {{stateNumber()[1]}}</a></p> + <p class="navbar-text navbar-left"><a href="#dashboard/warning" style="color:orange">Warning : {{stateNumber()[2]}}</a></p> + <p class="navbar-text navbar-left"><a href="#dashboard/danger" style="color:red">KO : {{stateNumber()[3]}}</a></p> + <p class="navbar-text navbar-left"><a href="#dashboard/idling" style="color:grey">Idling : {{stateNumber()[4]}}</a></p> <p class="navbar-text navbar-left" style="colod:white" ng-show="task_list.length > 0" -- 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 0251b6b0d13e77c0c4fa5e3070a604953e599cee Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Thu May 28 13:57:45 2015 +0200 scan conf can contain informations about the options + changes on scanpage --- app/module_loader.py | 2 +- app/mum.py | 16 ++++++++++++---- mum.conf | 8 +++++++- views/scan.html | 14 ++++++++------ 4 files changed, 28 insertions(+), 12 deletions(-) diff --git a/app/module_loader.py b/app/module_loader.py index 03f5fbc..6a59bf5 100644 --- a/app/module_loader.py +++ b/app/module_loader.py @@ -55,7 +55,7 @@ class ModuleLoader: return self.wsc def get_scan_options(self): - return json.loads(self.conf['scan']) + return self.conf['scan'] """ def get_all_known_ports(self): diff --git a/app/mum.py b/app/mum.py index d369a3e..8ae4817 100755 --- a/app/mum.py +++ b/app/mum.py @@ -120,11 +120,10 @@ if __name__ == '__main__': parser.add_argument("--smtp_server", help="name of the SMTP server to send e-mail notifications") parser.add_argument("--smtp_port", help="port number of the SMTP server") parser.add_argument("--smtp_address", help="e-mail address of the sender for e-mail notifications") - parser.add_argument("--scan", help="nmap scan option in JSON format : {str_name_scan: str_scan_options}") args = parser.parse_args() # creating the default conf structure from the configuration file - conf = {} + conf = {'scan': []} files_to_read = [] @@ -146,8 +145,17 @@ if __name__ == '__main__': found_conf_file = True fconf = open(file_name, 'r') for line in fconf.read().splitlines(): - fields = line.split('=') - conf[fields[0]] = fields[1] + if len(line) > 0 and line[0] != '#': + fields = line.split('=') + if fields[0] == 'scan': + scan_fields = fields[1].split('|') + dict_scan = {'scan_name': scan_fields[0]} + dict_scan['scan_description'] = scan_fields[1] + dict_scan['scan_priority'] = int(scan_fields[2]) + dict_scan['scan_options'] = scan_fields[3] + conf['scan'].append(dict_scan) + else: + conf[fields[0]] = fields[1] fconf.close() if not found_conf_file: p = argparse.ArgumentParser() diff --git a/mum.conf b/mum.conf index df375cf..ffaef3a 100644 --- a/mum.conf +++ b/mum.conf @@ -6,4 +6,10 @@ keys_location= smtp_server= smtp_port= smtp_address= -scan={"Scan and detect": "-sU -sS -p U:161,T:1-65535 -A -Pn", "Scan only": "-sU -sS -p U:161,T:1-65535", "No scan": ""} \ No newline at end of file + +#scan=Scan name|Scan description|Priority|Scan options +scan=Complete scan and detection|This scan is the most complete but the longest one. Recommended for commom server monitoring. Time necessary: from a minute to several hours depending of the host.|1|-sU -sS -p U:161,T:1-65535 -A -Pn +scan=Scan only|This option is less intrusive without detection. It will only verify the open ports. Note that you will have to indicate manually the OS of the machine later. Recommended for specific machines like printers. Time necessary: several minutes.|2|-sU -sS -p U:161,T:1-65535 -Pn +scan=Quick scan and detection|This scan will verify only the 100 most common ports, and will try to detect the OS of the machine. Time necessary: several minutes.|3|-sU -sS -F -O -Pn +scan=Quick scan|This scan will only verify 100 the most common ports. Note that you will have to indicate manually the OS of the machine later. Time necessary: less than a minute.|4|-sU -sS -F -Pn +scan=No scan|This option will just create a new entry on the database. You must enter a valid IP address on the form! You will after have to indicate manually the OS of the machine and eventually the known open ports. Recommended if you cannot perform a nmap scan on your server. Time necessary: instant.|5| \ No newline at end of file diff --git a/views/scan.html b/views/scan.html index d10206a..5df58b7 100644 --- a/views/scan.html +++ b/views/scan.html @@ -1,7 +1,6 @@ <div class="col-md-offset-2 main"> <h1 class="page-header">Scan for new machines</h1> - <p>Enter a hostname, a single IP or an IP range to scan:</p> <div class="row"> @@ -10,15 +9,18 @@ </div> </div> - <p>Select or type the nmap options to use for the scan:</p> + <p>Select or type the nmap options to use for the scan (see the <a href="http://nmap.org/book/man-briefoptions.html">nmap documentation</a> for details about these command options):</p> <div class="row"> <div class="col-xs-2" - ng-repeat="(optname, opt) in nmap_options"> - <input type="radio" name="selected_option" value="{{optname}}" + ng-repeat="opt_obj in nmap_options | + orderBy:'scan_priority'"> + <input type="radio" name="selected_option" value="{{opt_obj.scan_name}}" ng-model="$parent.selected_option" - ng-change="$parent.nmap_options_input = opt"> - {{optname}} + ng-change="$parent.nmap_options_input = opt_obj.scan_options"> + {{opt_obj.scan_name}}<a popover-placement="bottom" + popover="{{opt_obj.scan_description}}" + popover-trigger="mouseenter"><sup>?</sup></a> </div> </div> -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
participants (1)
-
chorem.org scm