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>.