From 06515ff7f48df08a3912231393cb96159c90ecf8 Mon Sep 17 00:00:00 2001 From: Caleb Stewart Date: Sun, 4 Oct 2020 20:48:59 -0400 Subject: [PATCH] Added traceback option for run --- pwncat/commands/run.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pwncat/commands/run.py b/pwncat/commands/run.py index ff1a3f7..f80a2e1 100644 --- a/pwncat/commands/run.py +++ b/pwncat/commands/run.py @@ -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")