Skip to content

Commit 354c68b

Browse files
author
Ryan Speers
authored
Merge pull request #153 from riverloopsec/release/2.7.1
Updated for 2.7.1 packaging.
2 parents cdee757 + 352e844 commit 354c68b

21 files changed

Lines changed: 666 additions & 383 deletions

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
*.pyc
2+
.vscode/
23
build/
34
dist/
5+
pdf/
46
.DS_Store
57
*.egg-info/
6-

FAQ.md

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
# Frequently Asked Questions
2+
3+
We often receive the same questions via email, and include this to answer some of the most common ones.
4+
5+
## Installation
6+
7+
#### Failed install due to Python.h missing
8+
9+
- Appears as:
10+
```bash
11+
...
12+
zigbee_crypt/zigbee_crypt.c:13:10: fatal error: Python.h: No such file or directory
13+
#include <Python.h>
14+
^~~~~~~~~~
15+
compilation terminated.
16+
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
17+
```
18+
19+
- Cause:
20+
The requirements were not installed per `README.md`, specifically the Python development package.
21+
22+
- Fix:
23+
Install the requirement, such as `sudo apt-get install -y python-dev` (or `python3-dev`).
24+
25+
#### Failed install due to gcrypt.h missing
26+
27+
- Appears as:
28+
```bash
29+
...
30+
zigbee_crypt/zigbee_crypt.c:15:10: fatal error: gcrypt.h: No such file or directory
31+
#include <gcrypt.h>
32+
^~~~~~~~~~
33+
compilation terminated.
34+
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
35+
```
36+
37+
- Cause:
38+
The requirements were not installed per `README.md`, specifically the gcrypt development package.
39+
40+
- Fix:
41+
Install the requirement, such as `sudo apt-get install -y libgcrypt-dev`.
42+
43+
## Device Usage
44+
45+
### Atmel RZUSBSTICK
46+
47+
#### Flashing
48+
49+
See `firmware/README.md` for details.
50+
51+
#### ValueError device has no langid
52+
53+
- Appears as:
54+
```bash
55+
zbid
56+
...
57+
Traceback (most recent call last):
58+
File "/usr/local/bin/zbid", line 23, in <module>
59+
show_dev(gps=arg_gpsdev, include=args.include)
60+
File "/usr/local/lib/python2.7/dist-packages/killerbee/__init__.py", line 46, in show_dev
61+
for dev in kbutils.devlist(vendor=vendor, product=product, gps=gps, include=include):
62+
File "/usr/local/lib/python2.7/dist-packages/killerbee/kbutils.py", line 285, in devlist
63+
devlist = devlist_usb_v1x(vendor, product)
64+
File "/usr/local/lib/python2.7/dist-packages/killerbee/kbutils.py", line 215, in devlist_usb_v1x
65+
usb.util.get_string(dev, dev.iProduct), \
66+
File "/usr/lib/python2.7/dist-packages/usb/util.py", line 314, in get_string
67+
raise ValueError("The device has no langid")
68+
ValueError: The device has no langid
69+
```
70+
71+
- Cause: USB permissions
72+
73+
- Fix: Run as sudo, or change the permissions to the USB device so your user can query it
74+
75+
### Apimote v4beta
76+
77+
#### Does not enumerate reliably
78+
79+
- Appears as:
80+
- Device doesn't show up in `zbid` sometimes
81+
- "Serial timeout" message printed to console during running commands
82+
83+
- Cause:
84+
As detailed on the page for this device, it is in beta due to instability observed with it establishing
85+
a serial sync with some hosts.
86+
87+
- Fix:
88+
- Help improve it, likely by working on the settings for the FTDI chip on the PCB
89+
- Specify the device using `-i` when you run commands, so enumeration doesn't need to be run each time
90+
- Unplug and replug the device as needed
91+
92+
#### Does not get frames received
93+
94+
- Appears as: Missing frames that you expect and see with other devices
95+
- Cause: Often we find that users are not attaching the antenna as required.
96+
- Fix: As detailed in the product documentation, you must either:
97+
- have an appropriate antenna attached to the RP-SMA port
98+
- or, move the component C501 on the PCB to select the internal antenna
99+
100+
#### Shows v2 when it enumerates
101+
102+
- Appears as: `zbid` lists the device as 'v2'
103+
- Cause: expected behavior, as from the software side only v1 is different than v2-v4, and thus it doesn't see a difference
104+
- Fix: N/A

README.md

Lines changed: 13 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ All Rights Reserved.
1111

1212
The main toolkit was/is authored by:
1313
+ 2009, Joshua Wright <jwright@willhackforsushi.com>
14-
+ 2010-2017, Ryan Speers <ryan@riverloopsecurity.com>
14+
+ 2010-2019, Ryan Speers <ryan@riverloopsecurity.com>
1515
+ 2010-2011, Ricky Melgares <ricky@riverloopsecurity.com>
1616

1717
We appreciate the many contributers to the framework, including the following who have contributed capabilities:
@@ -28,6 +28,7 @@ We appreciate the many contributers to the framework, including the following wh
2828
+ Jeff Spielberg
2929
+ Scytmo (bug fixes and CC2530/1 EMK board support)
3030
+ Adam Laurie/rfidiot (APS crypto implementation, firmware, DFU & BOOTLOADER, SubGHZ, SiLabs NodeTest)
31+
+ Steve Martin
3132

3233
REQUIREMENTS
3334
================
@@ -36,14 +37,8 @@ KillerBee is developed and tested on Linux systems.
3637
MacOS usage is possible but not supported.
3738

3839
We have striven to use a minimum number of software dependencies, however, it
39-
is necessary to install the following Python modules before installation:
40-
41-
+ serial
42-
+ usb
43-
+ crypto (for some functions)
44-
+ pygtk (for use of tools that have GUIs)
45-
+ cairo (for use of tools that have GUIs)
46-
+ scapy (for some tools which utilize 802.15.4 Scapy extensions)
40+
is necessary to install the following Python modules before installation.
41+
The install will detect and prompt you for what is needed.
4742

4843
On Ubuntu systems, you can install the needed dependencies with the following
4944
commands:
@@ -98,8 +93,7 @@ You must enable these to be searched for in `killerbee/config.py` and then reins
9893

9994
ApiMote v4beta (and v3):
10095
----------------
101-
The devices typically come preloaded and do not need to be reflashed for basic
102-
use.
96+
The devices typically come preloaded and do not need to be reflashed for basic use.
10397

10498
The hardware is open-source at https://github.com/riverloopsec/apimote.
10599
It is available assembled by contacting team at riverloopsecurity dot com.
@@ -174,8 +168,6 @@ networks, built using the KillerBee framework. Each tool has its own usage
174168
instructions documented by running the tool with the "-h" argument, and
175169
summarized below.
176170

177-
178-
+ kbbootloader - Switches device into DFU/BOOTLOADER mode (if device is capable)
179171
+ zbid - Identifies available interfaces that can be used by KillerBee
180172
and associated tools.
181173
+ zbwireshark - Similar to zbdump but exposes a named pipe for real-time
@@ -218,17 +210,15 @@ summarized below.
218210
+ zbdsniff - Captures ZigBee traffic, looking for NWK frames and over-the-air
219211
key provisioning. When a key is found, zbdsniff prints the
220212
key to stdout. The sample packet capture
221-
sample/zigbee-network-key-ota.dcf can be used to demonstrate
213+
`sample/zigbee-network-key-ota.dcf` can be used to demonstrate
222214
this functionality.
223215
+ zbfind - A GTK GUI application for tracking the location of an IEEE
224-
802.15.4 transmitter by measuring RSSI. Zbfind can be passive
216+
802.15.4 transmitter by measuring RSSI. zbfind can be passive
225217
in discovery (only listen for packets) or it can be active by
226218
sending Beacon Request frames and recording the responses from
227219
ZigBee routers and coordinators.
228220
If you get a bunch of errors after starting this tool, make
229-
sure your DISPLAY variable is set properly. If you know how
230-
to catch these errors to display a reasonable error message,
231-
please drop me a note.
221+
sure your `DISPLAY` variable is set properly.
232222
+ zbgoodfind - Implements a key search function using an encrypted packet
233223
capture and memory dump from a legitimate ZigBee or IEEE
234224
802.15.4 device. This tool accompanies Travis Goodspeed's
@@ -245,6 +235,7 @@ summarized below.
245235
installed to run this.
246236
+ zbscapy - Provides an interactive Scapy shell for interacting via a
247237
KillerBee interface. Scapy must be installed to run this.
238+
+ kbbootloader - Switches device into DFU/BOOTLOADER mode (if device is capable)
248239

249240
Additional tools, that are for special cases or are not stable, are stored in
250241
the Api-Do project repository: http://code.google.com/p/zigbee-security/
@@ -285,8 +276,8 @@ QUESTIONS/COMMENTS/CONCERNS
285276
==============
286277
Please use the ticketing system at https://github.com/riverloopsec/killerbee/issues.
287278

288-
The original version was written by: jwright@willhackforsushi.com
289-
The current version, fixes, etc are handled by: ryan@riverloopsecurity.com
290-
Additional Tools/Fixes by: bryanhalf@gmail.com
279+
The original version was written by: jwright@willhackforsushi.com.
280+
The current version, fixes, etc are handled by: ryan@riverloopsecurity.com.
281+
(See the list above for all contributors/credits.)
291282

292-
For contributors/developers, see DEVELOPMENT.md for details and guidance.
283+
For contributors/developers, see `DEVELOPMENT.md` for details and guidance.

killerbee/__init__.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def getKillerBee(channel, page= 0):
2424
raise Exception("Failed to create a KillerBee instance.")
2525
try:
2626
kb.set_channel(channel, page)
27-
except Exception, e:
27+
except Exception as e:
2828
raise Exception('Error: Failed to set channel to %d/%d' % (channel, page), e)
2929
return kb
3030

@@ -53,14 +53,15 @@ def __init__(self, device=None, datasource=None, gps=None):
5353
Instantiates the KillerBee class.
5454
5555
@type device: String
56-
@param device: Device identifier, either USB vendor:product, serial device node, or IP address
56+
@param device: Device identifier, which is either USB `<BusNumber>:<DeviceNumber>`,
57+
serial device path (e.g., `/dev/ttyUSB0`), or IP address.
58+
The format needed depends on the device's firmware and connectivity to the host system.
5759
@type datasource: String
58-
@param datasource: A known datasource type that is used
59-
by dblog to record how the data was captured.
60+
@param datasource: A known data-source type that is used by dblog to record how the data was captured.
6061
@type gps: String
61-
@param gps: Optional serial device identifier for an attached GPS
62-
unit. If provided, or if global variable has previously been set,
63-
KillerBee skips that device in initalization process.
62+
@param gps: Optional serial device identifier for an attached GPS unit.
63+
If provided, or if global variable has previously been set,
64+
KillerBee skips that device in initialization process.
6465
@return: None
6566
@rtype: None
6667
'''
@@ -80,7 +81,7 @@ def __init__(self, device=None, datasource=None, gps=None):
8081
from dev_sewio import isSewio
8182
if isSewio(device):
8283
from dev_sewio import SEWIO
83-
self.driver = SEWIO(dev=device) #give it the ip address
84+
self.driver = SEWIO(dev=device) # give it the ip address
8485
else: del isSewio
8586

8687
# Figure out a device is one is not set, trying USB devices next
@@ -222,7 +223,7 @@ def check_capability(self, capab):
222223
'''
223224
return self.driver.capabilities.check(capab)
224225

225-
def is_valid_channel(self, channel, page):
226+
def is_valid_channel(self, channel, page=0):
226227
'''
227228
Use the driver's capabilities class to determine if a requested channel number
228229
is within the capabilities of that device.
@@ -314,7 +315,7 @@ def page(self):
314315
# Driver must have this variable name set in its set_channel function
315316
return self.driver._page
316317

317-
def set_channel(self, channel, page= 0):
318+
def set_channel(self, channel, page=0):
318319
'''
319320
Sets the radio interface to the specifid channel & page (subghz)
320321
@type channel: Integer

0 commit comments

Comments
 (0)