Skip to content

Commit 93af516

Browse files
committed
Always print stack traces for errors during WEP attack
Should make troubleshooting #27 easier.
1 parent 697207f commit 93af516

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

Wifite.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,9 @@ def run(self):
131131
result = False
132132
try:
133133
result = attack.run()
134-
except Exception, e:
134+
except Exception as e:
135135
Color.pl("\n{!} {R}Error: {O}%s" % str(e))
136-
if Configuration.verbose > 0 or True:
136+
if Configuration.verbose > 0 or Configuration.print_stack_traces:
137137
Color.pl('\n{!} {O}Full stack trace below')
138138
from traceback import format_exc
139139
Color.p('\n{!} ')

py/AttackWEP.py

+10-1
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,16 @@ def run(self):
223223
self.success = False
224224
return self.success
225225
except Exception as e:
226-
Color.pl("\n{+} {R}Error: {O}%s{W}" % e)
226+
Color.pl("\n{!} {R}Error: {O}%s" % str(e))
227+
if Configuration.verbose > 0 or Configuration.print_stack_traces:
228+
Color.pl('\n{!} {O}Full stack trace below')
229+
from traceback import format_exc
230+
Color.p('\n{!} ')
231+
err = format_exc().strip()
232+
err = err.replace('\n', '\n{!} {C} ')
233+
err = err.replace(' File', '{W}File')
234+
err = err.replace(' Exception: ', '{R}Exception: {O}')
235+
Color.pl(err)
227236
continue
228237
# End of big try-catch
229238
# End of for-each-attack-type loop

py/Configuration.py

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ def initialize(load_interface=True):
2727
Configuration.initialized = True
2828

2929
Configuration.verbose = 0 # Verbosity level.
30+
Configuration.print_stack_traces = True
3031

3132
Configuration.kill_conflicting_processes = False
3233

0 commit comments

Comments
 (0)