DanMcInerney / wifijammer

Continuously jam all wifi clients/routers
3.95k stars 778 forks source link

'utf-8' codec can't decode byte 0x92 in position 14: invalid start byte #126

Open MR-Diamond opened 1 year ago

MR-Diamond commented 1 year ago

Hi, I attempt to run wifijammer in Termux; I have installed python, scapy and iwconfig. But as I execute tsudo python wifijammer I got:

Traceback (most recent call last):
  File "wifijammer", line 476, in <module>
    mon_iface = get_mon_iface(args)
  File "wifijammer", line 106, in get_mon_iface       monitors, interfaces = iwconfig()
  File "wifijammer", line 129, in iwconfig            for line in proc.communicate()[0].decode().split('\n'):
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x92 in position 14: invalid start byte

Am I miss something?

davidm71 commented 1 year ago

Change lines 199 +200 in the wifijammer source code to this: info = fcntl.ioctl(s.fileno(), 0x8927, struct.pack('256s', bytes(mon_iface).encode('utf-8')[:15])) mac = ':'.join('%02x' % ord(b) for b in info[18:24])

MR-Diamond commented 1 year ago

Done, but now I get a different error:

wifijammer_error

davidm71 commented 1 year ago

You must have made a mistake typing in the correction. Python follows strict indentation rules. Everything must line up as it was before. Start over.

MR-Diamond commented 1 year ago

Fixed, but I still get an error about utf-8:

Error_2

davidm71 commented 1 year ago

Idk. I got mine working on a Rasp Pi 2B with Python 2.71. Could be your version of Python is the issue.

davidm71 commented 1 year ago

Change line 317 to: print('['+T+''+W+'] '+O+ca[0]+W +' - '+O+ca[1]+ W+' - '+ca[2].ljust(2)+' - '+T+ca[3].decode("ascii")+W) Line 325 to: print('['+T+''+W+'] '+O+ap[0]+W+' - ' + ap[1].ljust(2)+' - '+T+ap[2].decode("ascii")+W)

And then manually install the latest version of Scapy: wget --trust-server-names https://github.com/secdev/scapy/archive/master.zip # or wget -O master.zip https://github.com/secdev/scapy/archive/master.zip unzip master.zip cd scapy sudo python setup.py install

DanMcInerney commented 1 year ago

@davidm71 or @MR-Diamond can you throw me a PR with that change.

davidm71 commented 1 year ago

@DanMcInerney Pull Request? Not sure how to do that though I have modified the code to work both on Raspberry Pi 2B-Raspbian/Python 2.7 and Raspberry Pi 2B - Kali/Python 3.10.9. All required were minor edits though each one different. Will share once I understand how to PR you.