Don't fail on invalid scriptlet name

This commit is contained in:
Oleksii Shevchuk 2017-04-25 15:54:28 +03:00
parent 0790f66665
commit 91bc695888
1 changed files with 6 additions and 3 deletions

View File

@ -322,8 +322,11 @@ def parse_scriptlets(args_scriptlet, debug=False):
raise ValueError("usage: pupygen ... -s %s,arg1=value,arg2=value,..."%name)
if name not in scriptlets_dic:
print(colorize("[-] ","red")+"unknown scriptlet %s, valid choices are : %s"%(repr(name), [x for x in scriptlets_dic.iterkeys()]))
exit(1)
raise ValueError("unknown scriptlet %s, valid choices are : %s"%(
repr(name), [
x for x in scriptlets_dic.iterkeys()
]))
print colorize("[+] ","green")+"loading scriptlet %s with args %s"%(repr(name), sc_args)
try:
sp.add_scriptlet(scriptlets_dic[name](**sc_args))
@ -390,7 +393,7 @@ def get_parser(base_parser, config):
action='store_true', help="In case of autodetection prefer external IP")
parser.add_argument('--no-use-proxy', action='store_true', help="Don't use the target's proxy configuration even if it is used by target (for ps1_oneliner only for now)")
parser.add_argument('--randomize-hash', action='store_true', help="add a random string in the exe to make it's hash unknown")
parser.add_argument('--oneliner-listen-port', default=8080, type=int, help="Port used by oneliner listeners ps1,py (default: %(default)s)")
parser.add_argument('--oneliner-listen-port', default=8080, type=int, help="Port used by oneliner listeners ps1,py (default: %(default)s)")
parser.add_argument('--debug-scriptlets', action='store_true', help="don't catch scriptlets exceptions on the client for debug purposes")
parser.add_argument('--debug', action='store_true', help="build with the debug template (the payload open a console)")
parser.add_argument('--workdir', help='Set Workdir (Default = current workdir)')