forked from riverloopsec/killerbee
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
99 lines (82 loc) · 3.64 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# NOTE: See the README file for a list of dependencies to install.
from __future__ import print_function
import sys
try:
from setuptools import setup, Extension
except ImportError:
print("No setuptools found, attempting to use distutils instead.")
from distutils.core import setup, Extension
err = []
warn = []
apt_get_pkgs = []
pip_pkgs = []
# We have made gtk, cairo, scapy-com into optional libraries
try:
import gtk
except ImportError:
warn.append("gtk")
apt_get_pkgs.append("python-gtk2")
try:
import cairo
except ImportError:
warn.append("cairo")
apt_get_pkgs.append("python-cairo")
# Ensure we have either pyUSB 0.x or pyUSB 1.x, but we now
# prefer pyUSB 1.x moving forward. Support for 0.x may be deprecated.
try:
import usb
except ImportError:
err.append("usb")
apt_get_pkgs.append("python-usb")
try:
import usb.core
#print("Warning: You are using pyUSB 1.x, support is in beta.")
except ImportError:
warn.append("You are using pyUSB 0.x. Consider upgrading to pyUSB 1.x.")
# TODO: Ideally we would detect missing python-dev and libgcrypt-dev to give better errors.
# Dot15d4 is a dep of some of the newer tools
try:
from scapy.all import Dot15d4
except ImportError:
warn.append("Scapy 802.15.4 (see README.md)")
pip_pkgs.append("git+https://github.com/secdev/scapy.git#egg=scapy")
if len(err) > 0:
print("""
Library requirements not met. Install the following libraries, then re-run the setup script.
{}\n""".format('\n'.join(err)), file=sys.stderr)
if len(warn) > 0:
print("""
Library recommendations not met. For full support, install the following libraries, then re-run the setup script.
{}\n""".format('\n'.join(warn)), file=sys.stderr)
if len(apt_get_pkgs) > 0 or len(pip_pkgs) > 0:
print("The following commands should install these dependencies on Ubuntu, and can be adapted for other OSs:", file=sys.stderr)
if len(apt_get_pkgs) > 0:
print("\tsudo apt-get install -y {}".format(' '.join(apt_get_pkgs)), file=sys.stderr)
if len(pip_pkgs) > 0:
print("\tpip install {}".format(' '.join(pip_pkgs)), file=sys.stderr)
if len(err) > 0:
sys.exit(1)
zigbee_crypt = Extension('zigbee_crypt',
sources = ['zigbee_crypt/zigbee_crypt.c'],
libraries = ['gcrypt'],
include_dirs = ['/usr/local/include', '/usr/include', '/sw/include/', 'zigbee_crypt'],
library_dirs = ['/usr/local/lib', '/usr/lib','/sw/var/lib/']
)
setup(name = 'killerbee',
version = '2.7.1',
description = 'ZigBee and IEEE 802.15.4 Attack Framework and Tools',
author = 'Joshua Wright, Ryan Speers',
author_email = '[email protected], [email protected]',
license = 'LICENSE.txt',
packages = ['killerbee', 'killerbee.openear', 'killerbee.zbwardrive'],
scripts = ['tools/zbdump', 'tools/zbgoodfind', 'tools/zbid', 'tools/zbreplay',
'tools/zbconvert', 'tools/zbdsniff', 'tools/zbstumbler', 'tools/zbassocflood',
'tools/zbfind', 'tools/zbscapy', 'tools/zbwireshark', 'tools/zbkey',
'tools/zbwardrive', 'tools/zbopenear', 'tools/zbfakebeacon',
'tools/zborphannotify', 'tools/zbpanidconflictflood', 'tools/zbrealign', 'tools/zbcat',
'tools/zbjammer', 'tools/kbbootloader'],
install_requires=['pyserial>=2.0', 'pyusb', 'pycrypto', 'rangeparser'],
#'git+https://github.com/secdev/scapy.git#egg=scapy'],
# NOTE: pygtk doesn't install via distutils on non-Windows hosts
ext_modules = [zigbee_crypt],
)