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

UnicodeDecodeError in logger.info(delimiter.join(fields)) #5

Open
LaurentLacheny opened this issue Apr 10, 2017 · 1 comment
Open

Comments

@LaurentLacheny
Copy link

I have this exception :
Traceback (most recent call last):
File "probemon.py", line 94, in
main()
File "probemon.py", line 91, in main
sniff(iface=args.interface, prn=built_packet_cb, store=0)
File "/home/llacheny/.local/lib/python2.7/site-packages/scapy/sendrecv.py", line 620, in sniff
r = prn(p)
File "probemon.py", line 57, in packet_callback
logger.info(delimiter.join(fields))
UnicodeDecodeError: 'ascii' codec can't decode byte 0xb6 in position 28: ordinal not in range(128)

It occurs with SSIDs using non ascii characters.
The following change corrects the issue :
logger.info(delimiter.join([f.decode("utf-8") for f in fields]))

@AshwinKrishn
Copy link

@LaurentLacheny You have not enabled the monitor mode to your wifi chip.
if you see this

$iwconfig wlan0 -> "mode : managed"

run these

$sudo ifconfig wlan0 down
$sudo iwconfig wlan0 mode monitor
$sudo ifconfig wlan0 up
Optional 👍 if you run $iwconfig wlan0 you will see "mode : monitor"
now run the program.

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

2 participants