Skip to content

Instantly share code, notes, and snippets.

@andripwn
Created August 12, 2020 11:58
Show Gist options
  • Save andripwn/613178f0e913bcabde1088ed3bac6d4b to your computer and use it in GitHub Desktop.
Save andripwn/613178f0e913bcabde1088ed3bac6d4b to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3.3
# -*- coding: utf8 -*-
#
# Read input from NMap and use the information from cve-search and
# Toolswatch DPE (Default Password Enumeration) list to provide a list of
# possible ways a system might be misconfigured or vulnerable.
# Imports
import os
import sys
runpath=os.path.dirname(os.path.realpath(__file__))
sys.path.append(os.path.join(runpath, '..'))
import argparse
from lib.Config import Configuration
from bin.converter import parseNMap
from bin.analyzer import enhance
from bin.visualizer import filtersFromArgs, displayTypeFromArgs, visualize
description='''Read Nmap scans of services or systems and use the
cve-search core to get information about these cpes.'''
parser = argparse.ArgumentParser(description=description)
parser.add_argument('-t', action='store_true', help='Use terminal GUI')
parser.add_argument('-p', action='store_true', help='Print results to PDF')
parser.add_argument('-fE', action='store_true', help='Filter: Exploit scripts/frameworks available')
parser.add_argument('-fN', action='store_true', help='Filter: Exploitable via network')
parser.add_argument('-fL', action='store_true', help='Filter: Exploitable locally')
parser.add_argument('-fAN',action='store_true', help='Filter: Exploitable via adjecent network')
parser.add_argument('-fC', action='store_true', help='Filter: Impacts Confidentiality')
parser.add_argument('-fI', action='store_true', help='Filter: Impacts Integrity')
parser.add_argument('-fA', action='store_true', help='Filter: Impacts Availability')
parser.add_argument('file',metavar='xml', type=str, help='NMap XML file' )
args = parser.parse_args()
if __name__ == '__main__':
syslist=parseNMap(file=args.file)
try:
syslist=enhance(syslist)
except:
sys.exit("Could not connect to the CVE-Search API on %s:%s"%(Configuration.getCVESearch()))
filters=filtersFromArgs(args)
display=displayTypeFromArgs(args)
visualize(syslist, args.fE, filters, display)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment