1
0
mirror of https://github.com/calebstewart/pwncat.git synced 2024-11-24 01:25:37 +01:00

Added traceback option for run

This commit is contained in:
Caleb Stewart 2020-10-04 20:48:59 -04:00
parent 0d8e634cab
commit 06515ff7f4

View File

@ -30,6 +30,9 @@ class Command(CommandDefinition):
"--raw,-r": Parameter(
Complete.NONE, action="store_true", help="Display raw results unformatted"
),
"--traceback,-t": Parameter(
Complete.NONE, action="store_true", help="Show traceback for module errors"
)
"module": Parameter(
Complete.CHOICES,
nargs="?",
@ -65,7 +68,10 @@ class Command(CommandDefinition):
result = pwncat.modules.run(args.module, **config_values)
pwncat.victim.config.back()
except pwncat.modules.ModuleFailed as exc:
console.log(f"[red]error[/red]: module failed: {exc}")
if args.traceback:
console.print_exception()
else:
console.log(f"[red]error[/red]: module failed: {exc}")
return
except pwncat.modules.ModuleNotFound:
console.log(f"[red]error[/red]: {args.module}: not found")