branch develop updated (0c2dda0 -> 22b4a74)
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 0c2dda0 scan : les options de nmap peuvent être spécifiées avant le lancement new 173e6f2 scan : le nom du fichier xml pour l'output de nmap est généré new 22b4a74 problème de conflit au niveau des dépendances résolu (mais filtre sur les groupes ne passe plus) 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 22b4a74c1cbfe74fb0a158128072508e1ad15600 Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Thu Mar 5 17:00:14 2015 +0100 problème de conflit au niveau des dépendances résolu (mais filtre sur les groupes ne passe plus) commit 173e6f2740849a33b777ef22af74383cff6c553f Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Thu Mar 5 14:38:52 2015 +0100 scan : le nom du fichier xml pour l'output de nmap est généré Summary of changes: app/modules/detection_modules/nmap_detection.py | 11 +++-- bower.json | 5 +- static/js/controllers/dashboardCtrl.js | 2 - static/js/controllers/groupCtrl.js | 62 +++++++++++++++++++++++++ static/js/mumApp.js | 4 +- views/dashboard.html | 3 +- views/groups.html | 3 +- views/index.html | 4 +- views/scan.html | 2 +- 9 files changed, 80 insertions(+), 16 deletions(-) create mode 100644 static/js/controllers/groupCtrl.js -- 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 173e6f2740849a33b777ef22af74383cff6c553f Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Thu Mar 5 14:38:52 2015 +0100 scan : le nom du fichier xml pour l'output de nmap est généré --- app/modules/detection_modules/nmap_detection.py | 11 +++++++---- views/scan.html | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/app/modules/detection_modules/nmap_detection.py b/app/modules/detection_modules/nmap_detection.py index 78af18b..4e78d7e 100644 --- a/app/modules/detection_modules/nmap_detection.py +++ b/app/modules/detection_modules/nmap_detection.py @@ -3,6 +3,8 @@ __author__ = 'aguilbaud' from xml.dom import minidom import pexpect import json +from random import choice +from string import letters class nmap_detection: @@ -10,6 +12,7 @@ class nmap_detection: self.opt = opt self.db = db self.ws = ws + self.filename = "".join(choice(letters) for i in range(10)) + ".xml" # generating a filename for xml output self.scanned_ip = [] self.list_mod_conn = list_mod_conn self.dict_mod_monitoring = dict_mod_monitoring @@ -85,7 +88,7 @@ class nmap_detection: ip = str(byte_1) + '.' + str(byte_2) + '.' + str(byte_3) + '.' + str(byte_4) self.ws.send(json.dumps({"30": "Scanning ip : " + ip})) try: - child = pexpect.spawn('nmap ' + self.opt + ' ' + ip + ' -oX res.xml') + child = pexpect.spawn('nmap ' + self.opt + ' ' + ip + ' -oX ' + self.filename) while child.isalive(): child.expect('Completed', timeout=None) except pexpect.EOF: @@ -101,7 +104,7 @@ class nmap_detection: def launch_detection_with_hostname(self, hostname): self.ws.send(json.dumps({"30": "Scanning host : " + hostname})) try: - child = pexpect.spawn('nmap ' + self.opt + ' ' + hostname + ' -oX res.xml') + child = pexpect.spawn('nmap ' + self.opt + ' ' + hostname + ' -oX ' + self.filename) while child.isalive(): child.expect('Completed', timeout=None) except pexpect.EOF: @@ -119,7 +122,7 @@ class nmap_detection: # save directly it on the database def parse_res(self, ip): # opening the xml file with minidom parser - root = minidom.parse("res.xml") + root = minidom.parse(self.filename) collection = root.documentElement # get every <host> of the collection @@ -167,4 +170,4 @@ class nmap_detection: # the host have its IP for ID on the db self.db.add_host(dict_host['addr'], json.dumps(dict_host), self.list_mod_conn, self.dict_mod_monitoring) self.scanned_ip.append(dict_host['addr']) - pexpect.run("rm -f res.xml") \ No newline at end of file + pexpect.run("rm -f " + self.filename) \ No newline at end of file diff --git a/views/scan.html b/views/scan.html index 8ce7833..53e22f1 100644 --- a/views/scan.html +++ b/views/scan.html @@ -4,7 +4,7 @@ <div ng-show="validated == false" 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"/>{{ip_range}}<br/> + <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 == true" ng-model="nmap_options"/> <button type="submit" class="btn btn-primary" ng-click="validated = true">Scan now</button> -- 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 22b4a74c1cbfe74fb0a158128072508e1ad15600 Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Thu Mar 5 17:00:14 2015 +0100 problème de conflit au niveau des dépendances résolu (mais filtre sur les groupes ne passe plus) --- bower.json | 5 ++- static/js/controllers/dashboardCtrl.js | 2 -- static/js/controllers/groupCtrl.js | 62 ++++++++++++++++++++++++++++++++++ static/js/mumApp.js | 4 +-- views/dashboard.html | 3 +- views/groups.html | 3 +- views/index.html | 4 ++- 7 files changed, 72 insertions(+), 11 deletions(-) diff --git a/bower.json b/bower.json index 542acde..c470f26 100644 --- a/bower.json +++ b/bower.json @@ -3,10 +3,9 @@ "version": "0.0.1", "dependencies": { "bootstrap": "~3.2.0", - "angular-latest": "~1.3.9", - "angular": "~1.3.13", + "angular": "~1.2.28", "angular-toastr": "~0.5.2", - "angular-route": "~1.3.13", + "angular-route": "~1.2.28", "angular-bootstrap": "~0.12.1" } } diff --git a/static/js/controllers/dashboardCtrl.js b/static/js/controllers/dashboardCtrl.js index f09c76d..4b7a783 100644 --- a/static/js/controllers/dashboardCtrl.js +++ b/static/js/controllers/dashboardCtrl.js @@ -10,8 +10,6 @@ mumApp.controller('dashboardCtrl', function($scope, $filter, $routeParams, DataH $scope.items = DataHosts.Items; - - $scope.$on("hostsUpdate", function (event) { $scope.items = DataHosts.Items; }); diff --git a/static/js/controllers/groupCtrl.js b/static/js/controllers/groupCtrl.js new file mode 100644 index 0000000..f7419c2 --- /dev/null +++ b/static/js/controllers/groupCtrl.js @@ -0,0 +1,62 @@ +mumApp.controller('groupCtrl', function($scope, $filter, $routeParams, DataHosts){ + $scope.sort = { + sortingOrder : 'id', + reverse : false + }; + + $scope.items = DataHosts.Items; + + $scope.$on("hostsUpdate", function (event) { + $scope.items = DataHosts.Items; + }); + + $scope.group_filter = ''; + + $scope.selected = []; + + $scope.select = function(host){ + $scope.selected.append(host); + }; + + $scope.unselect = function(host){ + $scope.selected.remove(host); + }; + + $scope.status = ''; + + $scope.grp = "all"; + + $scope.getGroupsByAddr = function(addr) { + res = "" + for(var i = 0; i<$scope.items.length; i++){ + if($scope.items[i].addr === addr){ + for(var j = 0; j<$scope.items[i].group.length; j++){ + res += $scope.items[i].group[j].name + " "; + } + } + } + return res; + }; + + $scope.allGroups = function(){ + var res = [] + for(var i = 0; i<$scope.items.length; i++){ + for(var j = 0; j<$scope.items[i].group.length; j++){ + res.push($scope.items[i].group[j].name); + } + } + return res; + }; + + $scope.checkAll = function(){ + if($scope.selectedAll){ + $scope.selectedAll = true; + } + else{ + $scope.selectedAll = false; + } + angular.forEach($scope.items, function(item){ + item.Selected = $scope.selectedAll; + }); + }; +}); \ No newline at end of file diff --git a/static/js/mumApp.js b/static/js/mumApp.js index a3a0f4e..9a8f2e8 100644 --- a/static/js/mumApp.js +++ b/static/js/mumApp.js @@ -1,4 +1,4 @@ -var mumApp = angular.module('mumApp', ['ui.bootstrap', 'ngRoute', 'toastr']); +var mumApp = angular.module('mumApp', ['ngRoute', 'ui.bootstrap', 'toastr']); mumApp.factory('DataHosts', function(){ return {Items: []}; @@ -20,7 +20,7 @@ mumApp.config(function($routeProvider){ }) .when('/groups',{ templateUrl : 'groups.html', - controller : 'dashboardCtrl' + controller : 'groupCtrl' }) .when('/hostpage/:param',{ templateUrl : 'hostpage.html', diff --git a/views/dashboard.html b/views/dashboard.html index fc69e6a..1a66eb3 100644 --- a/views/dashboard.html +++ b/views/dashboard.html @@ -65,8 +65,7 @@ <tbody> <tr ng-repeat="item in items | orderBy:sort.sortingOrder:sort.reverse | - filter:{addr:addr_filter, name:name_filter, status:status_filter, - group:{name:group_filter}}" class={{item.status}}> + filter:{addr:addr_filter, name:name_filter, status:status_filter}" class={{item.status}}> <!-- group.name:group_filter --> <td><a href="#/hostpage/{{item.addr}}">{{item.addr}}</a></td> <td>{{item.name}}</td> <td>warning : {{item.warning}}<br/> diff --git a/views/groups.html b/views/groups.html index 70aa2cd..5d29ccd 100644 --- a/views/groups.html +++ b/views/groups.html @@ -1,6 +1,7 @@ <div class="col-md-offset-2 main"> <h1 class="page-header">Group manager</h1> + <button type="button" class="btn btn-primary" ng-click="toto()">ngf.</button> <div class="row"> <div class="col-xs-3"> <label for="grpoption">Your existing groups</label> @@ -27,7 +28,7 @@ </tr> </thead> <tbody> - <tr ng-repeat="item in items | filter:{group:{name:grp}, addr:addr_filter, name:name_filter}"> + <tr ng-repeat="item in items | filter:{addr:addr_filter, name:name_filter}"> <!-- group:{name:grp} --> <td>{{item.addr}}</td> <td>{{item.name}}</td> <td>{{getGroupsByAddr(item.addr)}}</td> diff --git a/views/index.html b/views/index.html index 706f22b..3eeeeaf 100644 --- a/views/index.html +++ b/views/index.html @@ -19,15 +19,17 @@ <!-- AngularJS --> <script src="bower_components/angular/angular.min.js"></script> + <script src="bower_components/angular-route/angular-route.min.js"></script> <script src="bower_components/angular-toastr/dist/angular-toastr.min.js"></script> <script src="bower_components/angular-bootstrap/ui-bootstrap-tpls.min.js"></script> - <script src="bower_components/angular-route/angular-route.min.js"></script> + <script src="static/js/mumApp.js"></script> <script src="static/js/controllers/dashboardCtrl.js"></script> <script src="static/js/controllers/headCtrl.js"></script> <script src="static/js/controllers/scanCtrl.js"></script> <script src="static/js/controllers/hostPageCtrl.js"></script> + <script src="static/js/controllers/groupCtrl.js"></script> <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries --> <!--[if lt IE 9]><!-- -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
participants (1)
-
chorem.org scm