From acdcd8d31fb50ef46e3002cf530b63d53b2c52a9 Mon Sep 17 00:00:00 2001 From: antonioCoco Date: Sun, 19 Sep 2021 13:12:33 +0200 Subject: [PATCH] fixed bug in the argument parser --- SharPyShell.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/SharPyShell.py b/SharPyShell.py index e2bfc01..25ff9ae 100755 --- a/SharPyShell.py +++ b/SharPyShell.py @@ -153,11 +153,14 @@ if __name__ == '__main__': create_interact_parser(subparsers) args = parser.parse_args() - if args.mode == 'generate': - generate_obj = Generate(args.password, args.encryption, args.obfuscator, args.endian_type, args.output) - generate_obj.generate() + if args.__contains__('mode'): + if args.mode == 'generate': + generate_obj = Generate(args.password, args.encryption, args.obfuscator, args.endian_type, args.output) + generate_obj.generate() - if args.mode == 'interact': - prompt = SharPyShellPrompt(args.password, args.encryption, args.default_shell, args.url, - args.user_agent, args.cookies, args.custom_header, args.insecure, args.proxy) - prompt.cmdloop('\n') + if args.mode == 'interact': + prompt = SharPyShellPrompt(args.password, args.encryption, args.default_shell, args.url, + args.user_agent, args.cookies, args.custom_header, args.insecure, args.proxy) + prompt.cmdloop('\n') + else: + parser.print_help()