branch develop updated (996699e -> a680e7f)
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 996699e shelve: corrected config_mod_activation => activating a module for the 1st time adds an instruction for process_monitoring + hostpage: non activated module line on table is not shown new a680e7f scan: can now add a host without nmap scan (generating an empty nmap_result) + hostpage: table is now hidden if no hosts are in the db The 1 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 a680e7f2b4937f139d2b8ed8fe8eafb904b44e68 Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Tue Apr 7 16:38:12 2015 +0200 scan: can now add a host without nmap scan (generating an empty nmap_result) + hostpage: table is now hidden if no hosts are in the db Summary of changes: app/module_loader.py | 11 +++++++++++ app/mum.py | 3 +++ static/js/controllers/scanCtrl.js | 6 ++++++ views/dashboard.html | 6 +++++- views/scan.html | 17 +++++++++++++++-- 5 files changed, 40 insertions(+), 3 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 a680e7f2b4937f139d2b8ed8fe8eafb904b44e68 Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Tue Apr 7 16:38:12 2015 +0200 scan: can now add a host without nmap scan (generating an empty nmap_result) + hostpage: table is now hidden if no hosts are in the db --- app/module_loader.py | 11 +++++++++++ app/mum.py | 3 +++ static/js/controllers/scanCtrl.js | 6 ++++++ views/dashboard.html | 6 +++++- views/scan.html | 17 +++++++++++++++-- 5 files changed, 40 insertions(+), 3 deletions(-) diff --git a/app/module_loader.py b/app/module_loader.py index 2643b3f..7a5fe61 100644 --- a/app/module_loader.py +++ b/app/module_loader.py @@ -86,6 +86,17 @@ class ModuleLoader: ws.send(json.dumps({"ERROR": hnfe.__str__()})) return None + def create_empty_host(self, 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) + def create_connection(self, addr_host): avaliable_conn = self.db.get_conf_conn(addr_host) mod_inst = None diff --git a/app/mum.py b/app/mum.py index ef23aac..321373f 100755 --- a/app/mum.py +++ b/app/mum.py @@ -124,6 +124,9 @@ def receive(ws): for code in msg: if code == "NMAP_SCAN_DEMAND": # asked from scan page start_first_detection(msg["NMAP_SCAN_DEMAND"], ml, ws) + elif code == "CREATE_EMPTY_HOST": # asked from scan page + ml.create_empty_host(msg["CREATE_EMPTY_HOST"]) + ws.send(json.dumps({"SUCCESS_MODULE": "Creation of new host"})) elif code == "LAUNCH_FULL_DETECTION": # asked from hostpage ml.run_all_detection_modules(msg["LAUNCH_FULL_DETECTION"]) ws.send(json.dumps({"SUCCESS_MODULE": "Full detection"})) diff --git a/static/js/controllers/scanCtrl.js b/static/js/controllers/scanCtrl.js index 7c2b0ce..6b3e306 100644 --- a/static/js/controllers/scanCtrl.js +++ b/static/js/controllers/scanCtrl.js @@ -4,6 +4,8 @@ mumApp.controller('scanCtrl', function($scope, $rootScope) { $scope.state = ""; // l'etat general du scan en cours $scope.ip_scanned = {}; + $scope.ip_manual_field = ""; + $scope.show_opt = false; $scope.nmap_options = "-A -Pn --unprivileged"; @@ -26,4 +28,8 @@ mumApp.controller('scanCtrl', function($scope, $rootScope) { args.nmap_options = $scope.nmap_options; $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/dashboard.html b/views/dashboard.html index da8b789..79bde16 100644 --- a/views/dashboard.html +++ b/views/dashboard.html @@ -2,7 +2,8 @@ <div class="col-md-offset-2 main"> <h1 class="page-header">Dashboard</h1> <h2 class="sub-header">Hosts currently on monitoring</h2> - <div class="row"> + <div class="row" + ng-show="items.length > 0"> <div class="col-xs-3"> <label for="addr_f">Address filter</label> <input class="form-control" type="text" id="addr_f" ng-model="addr_filter"> @@ -76,5 +77,8 @@ </tbody> </table> </div> + <div ng-show="items.length == 0"> + <p>No hosts for the moment. <a href="#scan">Scan for new hosts now!</a></p> + </div> </div> diff --git a/views/scan.html b/views/scan.html index 1a94296..b47c2ec 100644 --- a/views/scan.html +++ b/views/scan.html @@ -5,10 +5,23 @@ <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> + <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">Scan now</button> + <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> -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
participants (1)
-
chorem.org scm