Skip to content

Commit

Permalink
changing filter + removing scanner
Browse files Browse the repository at this point in the history
  • Loading branch information
PidgeyL committed Dec 2, 2015
1 parent 1e5cd90 commit 2ff4f84
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 80 deletions.
35 changes: 4 additions & 31 deletions bin/Nmap2CVE-Search.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,50 +33,23 @@
cve-search core to get information about these cpes.'''

parser = argparse.ArgumentParser(description=description)
parser.add_argument('-j', metavar='json', type=str, help='Dump output to json file' )
parser.add_argument('-s', action='store_true', help='Silent mode (no GUI)' )
parser.add_argument('-t', action='store_true', help='Use terminal GUI')
parser.add_argument('-e', action='store_true', help='Show only CVEs with known exploitation scripts')
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('-jN', metavar='json', type=str, help='Read Json file in Nmap2CVE format' )
parser.add_argument('-sN', metavar='host', type=str, help='Host to run a full default NMap scan on' )
parser.add_argument('-xN', metavar='xml', type=str, help='Read NMap XML file' )
parser.add_argument('file',metavar='xml', type=str, help='NMap XML file' )
args = parser.parse_args()

if __name__ == '__main__':
# intakes
if not args.xN and not args.jN and not args.sN:
sys.exit("No input selected!")
if args.xN:
syslist=parseNMap(file=args.xN)
elif args.jN:
try:
syslist=json.loads(open(args.jN).read())
except:
sys.exit("Invalid JSon format!")
elif args.sN:
nm=NmapProcess(targets=args.sN, options="-O -A")
print("NMap scan started")
nm.run()
print(nm.summary)
syslist = parseNMap(string=nm.stdout)
#output
if args.j:
if os.path.exists(args.j):
os.remove(args.j)
with open(args.j, 'w') as dump:
json.dump(syslist, dump)

#CVE-Scan magic
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.e, filters, display)
visualize(syslist, args.fE, filters, display)
47 changes: 0 additions & 47 deletions bin/scanner.py

This file was deleted.

4 changes: 2 additions & 2 deletions bin/visualizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def visualize(data, exploitOnly=False, filters={}, display="web"):
description='''Visualizes the enhanced nmap results'''
parser = argparse.ArgumentParser(description=description)
parser.add_argument('-t', action='store_true', help='Use terminal GUI')
parser.add_argument('-e', action='store_true', help='Show only CVEs with known exploitation scripts')
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')
Expand All @@ -79,4 +79,4 @@ def visualize(data, exploitOnly=False, filters={}, display="web"):

filters = filtersFromArgs(args)
display = displayTypeFromArgs(args)
visualize(syslist, args.e, filters, display)
visualize(syslist, args.fE, filters, display)

0 comments on commit 2ff4f84

Please sign in to comment.