Nmap Development mailing list archives

[Rainmap] RFC: storing option descriptions (to be displayed in the UI)


From: alexandru <alex () hackd net>
Date: Fri, 18 Jun 2010 05:24:10 -0700

Hello all,

For the new/edit scan interface I plan to take an approach similar to Zenmap's, in that each option has some help text 
that appears when the user hovers over/edits the option. I plan to store these settings in a Python file, in the 
following form:

___
# Group options together by section. The code creating the user-facing form
# looks at this mapping. It only renders sections based on these
# components, so this is also a way to add or remove scan options.
SECTIONS = {
    'TARGET': [],
    'DISCOVERY': ['-sn', '-Pn'],
    'TECHNIQUES': [],
    'PORTS': [],
    'SERVICES': [],
    'NSE': [],
    'OS_DETECT': [],
    'TIMING': [],
    'EVASION': [],
    'OUTPUT': [],
    'MISC': [],
}

# Each feature's information is keyed by the shortopt form. This key is also
# how we map parameters to the values parsed by NmapOptions. Code displaying
# the form uses 'NAME' for the field label, and 'HELP' to show information to
# the user.
FEATURES = {
    '-sn': {
        'NAME': 'Ping Scan',
        'HELP': 'Disable Port Scanning.',
    },
    '-Pn': {
        'NAME': 'No Ping',
        'HELP': 'Treat all hosts as online.',
    },
    # ...
}
___


I'm open to suggestions on alternate ways to define and store these fields. Zenmap keeps its information in a 
profile_editor.xml file — which served as partial inspiration, though David mentioned there are some issues with the 
approach.

I should also note that the scan profile is stored in the database by name and the Nmap command to be run (again, like 
Zenmap). NmapOptions is used to parse that string, and then the code responsible for generating the forms uses the text 
in the FEATURES dict to provide descriptive text.


Thanks!

--
@

Attachment: PGP.sig
Description:

_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://seclists.org/nmap-dev/

Current thread: