From 2b057f290b52353fa187b6cee708962502b4017e Mon Sep 17 00:00:00 2001 From: Austin Taylor Date: Wed, 3 Jan 2018 18:33:14 -0500 Subject: [PATCH] Remind user to select section if using a config --- bin/vuln_whisperer | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/bin/vuln_whisperer b/bin/vuln_whisperer index c131769..5c4645e 100644 --- a/bin/vuln_whisperer +++ b/bin/vuln_whisperer @@ -29,30 +29,27 @@ def main(): parser.add_argument('-p', '--password', dest='password', required=False, default=None, type=lambda x: x.strip(), help='The NESSUS password') args = parser.parse_args() - vw = vulnWhisperer(config=args.config, - profile=args.section, - verbose=args.verbose, - username=args.username, - password=args.password) - - vw.whisper_vulnerabilities() - ''' try: + if args.config and not args.section: + print('{red} ERROR: {error}{endc}'.format(red=bcolors.FAIL, + error='Please specify a section using -s. \ + \nExample vuln_whisperer -c config.ini -s nessus', + endc=bcolors.ENDC)) + else: + vw = vulnWhisperer(config=args.config, + profile=args.section, + verbose=args.verbose, + username=args.username, + password=args.password) - vw = vulnWhisperer(config=args.config, - profile=args.section, - verbose=args.verbose, - username=args.username, - password=args.password) - - vw.whisper_vulnerabilities() - sys.exit(1) + vw.whisper_vulnerabilities() + sys.exit(1) except Exception as e: if args.verbose: print('{red} ERROR: {error}{endc}'.format(red=bcolors.FAIL, error=e, endc=bcolors.ENDC)) sys.exit(2) - ''' + if __name__ == '__main__': main() \ No newline at end of file