Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
MR-Diamond opened this issue Dec 1, 2022 · 8 comments

Comments

@MR-Diamond
Copy link

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
Copy link

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
Copy link
Author

Done, but now I get a different error:

wifijammer_error

@davidm71
Copy link

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
Copy link
Author

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

Error_2

@davidm71
Copy link

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

@davidm71
Copy link

davidm71 commented Jan 6, 2023

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
Copy link
Owner

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

@davidm71
Copy link

davidm71 commented Jan 10, 2023

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants