From a78609f75e46b7f9c1892399074f1f7d6743c246 Mon Sep 17 00:00:00 2001 From: Ilya Terentyev Date: Sun, 19 Jun 2016 18:38:34 +0300 Subject: [PATCH] Force convert TX_POWER to string When running wifite with specified TX power under Python 2.7, the script would fail on the iwconfig call, supposedly because self.RUN_CONFIG.TX_POWER is interpreted as an integer. This commit tries to fix this issue by converting TX_POWER argument to a string. An example traceback with source lines left out (they are too wide to fit in a 50/72 commit message) is below: Traceback (most recent call last): File "/usr/local/bin/wifite", line 3525, in File "/usr/local/bin/wifite", line 1383, in Start File "/usr/local/bin/wifite", line 1032, in get_iface File "/usr/local/bin/wifite", line 898, in enable_monitor_mode File "/usr/lib/python2.7/subprocess.py", line 523, in call File "/usr/lib/python2.7/subprocess.py", line 711, in __init__ File "/usr/lib/python2.7/subprocess.py", line 1340, in _execute_child TypeError: execv() arg 2 must contain only strings --- wifite.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wifite.py b/wifite.py index 3fb72e8..62b431d 100755 --- a/wifite.py +++ b/wifite.py @@ -895,7 +895,7 @@ def enable_monitor_mode(self, iface): if self.RUN_CONFIG.TX_POWER > 0: print GR + ' [+]' + W + ' setting Tx power to %s%s%s...' % (G, self.RUN_CONFIG.TX_POWER, W), call(['iw', 'reg', 'set', 'BO'], stdout=OUTLOG, stderr=ERRLOG) - call(['iwconfig', iface, 'txpower', self.RUN_CONFIG.TX_POWER], stdout=OUTLOG, stderr=ERRLOG) + call(['iwconfig', iface, 'txpower', str(self.RUN_CONFIG.TX_POWER)], stdout=OUTLOG, stderr=ERRLOG) print 'done' return self.RUN_CONFIG.IFACE_TO_TAKE_DOWN