1
0
mirror of https://github.com/calebstewart/pwncat.git synced 2024-11-27 19:04:15 +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( "--raw,-r": Parameter(
Complete.NONE, action="store_true", help="Display raw results unformatted" 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( "module": Parameter(
Complete.CHOICES, Complete.CHOICES,
nargs="?", nargs="?",
@ -65,6 +68,9 @@ class Command(CommandDefinition):
result = pwncat.modules.run(args.module, **config_values) result = pwncat.modules.run(args.module, **config_values)
pwncat.victim.config.back() pwncat.victim.config.back()
except pwncat.modules.ModuleFailed as exc: except pwncat.modules.ModuleFailed as exc:
if args.traceback:
console.print_exception()
else:
console.log(f"[red]error[/red]: module failed: {exc}") console.log(f"[red]error[/red]: module failed: {exc}")
return return
except pwncat.modules.ModuleNotFound: except pwncat.modules.ModuleNotFound: