From fcd938b75aa49fc870d773aae41f6df8cff519ef Mon Sep 17 00:00:00 2001 From: Shaun McCullough Date: Fri, 8 Dec 2017 00:25:15 -0500 Subject: [PATCH] Put in a check to make sure that the config file exists. FIXES austin-taylor/VulnWhisperer#4 --- bin/vuln_whisperer | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/bin/vuln_whisperer b/bin/vuln_whisperer index 9f72115..d39ec66 100644 --- a/bin/vuln_whisperer +++ b/bin/vuln_whisperer @@ -6,16 +6,22 @@ from vulnwhisp.vulnwhisp import vulnWhisperer from vulnwhisp.utils.cli import bcolors - +import os import argparse import sys +def isFileValid(parser, arg): + if not os.path.exists(arg): + parser.error("The file %s does not exist!" % arg) + else: + return arg + def main(): parser = argparse.ArgumentParser(description=""" VulnWhisperer is designed to create actionable data from\ your vulnerability scans through aggregation of historical scans.""") parser.add_argument('-c', '--config', dest='config', required=False, default='frameworks.ini', - help='Path of config file') + help='Path of config file', type=lambda x: isFileValid(parser, x)) parser.add_argument('-v', '--verbose', dest='verbose', action='store_true', default=True, help='Prints status out to screen (defaults to True)') parser.add_argument('-u', '--username', dest='username', required=False, default=None, help='The NESSUS username')