riverloopsec / killerbee

IEEE 802.15.4/ZigBee Security Research Toolkit
http://www.riverloopsecurity.com
Other
742 stars 215 forks source link

Ubuntu 22.04 and errors accessing multiple devices simultaneously #264

Open yg-ht opened 1 year ago

yg-ht commented 1 year ago

I was recently working on a task that required me to capture ZigBee traffic, but, a) I didn't know which channel the traffic was going to be on, and b) the traffic would only ever happen once. (Boring, complex and not particularly exciting reasons why).

As a previous user of zbopenear, I thought "that will be easy". Ahem...

It seems that there is something "not happy" with KillerBee, the Python3 version of zbopenear (see pull requests: https://github.com/riverloopsec/killerbee/pull/263 and https://github.com/rmspeers/zigbee-security/pull/3), Python3 itself, and Ubuntu 22.04.

The error message is pretty simple, "errno 16, resource busy".

I spent a while trying to debug this and I got to the point where I ran out of time and ended up spinning up 16 VMs and each of those had a single zbwireshark instance running.

I spent quite a bit of time in the code adding debug output trying to see if for some reason the code was passing the wrong device ID but I couldn't find anything obvious. I then tried to run two instances of zbwireshark but each with a command arg of a different device and noticed that I got the same error here.

I did some digging online and frankly not a lot of use came up. What I did see was references to people experiencing locks when Python3 attempts to set the configuration of a USB device. I compared this with my dmesg output and there could be something in this but nothing conclusive. Nothing else jumped out at me as the answer and then I ran out of time.

Happy to help diagnose etc, but, I am getting to the limits of my lower-level USB knowledge.

yg-ht commented 1 year ago

Just to clairfy a bit further.

I was attempting to use zbopenear and during execution I would get error traces which boil down to the above error. The script still runs but it only ever writes output data for one channel.