diff --git a/pwnlib/commandline/shellcraft.py b/pwnlib/commandline/shellcraft.py index 7def3de55..1e8c57543 100644 --- a/pwnlib/commandline/shellcraft.py +++ b/pwnlib/commandline/shellcraft.py @@ -198,7 +198,9 @@ def main(args): common.parser.print_usage() exit() - if args.shellcode not in shellcraft.templates: + try: + template = get_template(args.shellcode) + except AttributeError: log.error("Unknown shellcraft template %r. Use --list to see available shellcodes." % args.shellcode) func = get_template(args.shellcode)