Always print stack traces for errors during WEP attack

Should make troubleshooting #27 easier.
This commit is contained in:
derv82
2018-03-11 01:49:41 -05:00
parent 697207f11b
commit 93af516c45
3 changed files with 13 additions and 3 deletions

View File

@@ -131,9 +131,9 @@ class Wifite(object):
result = False result = False
try: try:
result = attack.run() result = attack.run()
except Exception, e: except Exception as e:
Color.pl("\n{!} {R}Error: {O}%s" % str(e)) Color.pl("\n{!} {R}Error: {O}%s" % str(e))
if Configuration.verbose > 0 or True: if Configuration.verbose > 0 or Configuration.print_stack_traces:
Color.pl('\n{!} {O}Full stack trace below') Color.pl('\n{!} {O}Full stack trace below')
from traceback import format_exc from traceback import format_exc
Color.p('\n{!} ') Color.p('\n{!} ')

View File

@@ -223,7 +223,16 @@ class AttackWEP(Attack):
self.success = False self.success = False
return self.success return self.success
except Exception as e: except Exception as e:
Color.pl("\n{+} {R}Error: {O}%s{W}" % e) Color.pl("\n{!} {R}Error: {O}%s" % str(e))
if Configuration.verbose > 0 or Configuration.print_stack_traces:
Color.pl('\n{!} {O}Full stack trace below')
from traceback import format_exc
Color.p('\n{!} ')
err = format_exc().strip()
err = err.replace('\n', '\n{!} {C} ')
err = err.replace(' File', '{W}File')
err = err.replace(' Exception: ', '{R}Exception: {O}')
Color.pl(err)
continue continue
# End of big try-catch # End of big try-catch
# End of for-each-attack-type loop # End of for-each-attack-type loop

View File

@@ -27,6 +27,7 @@ class Configuration(object):
Configuration.initialized = True Configuration.initialized = True
Configuration.verbose = 0 # Verbosity level. Configuration.verbose = 0 # Verbosity level.
Configuration.print_stack_traces = True
Configuration.kill_conflicting_processes = False Configuration.kill_conflicting_processes = False