-
Notifications
You must be signed in to change notification settings - Fork 1
Installation
There is a shell script provided that installs all dependencies, but it depends on apt
(used by Debian-based Linux operating systems) and an available Python2.7 distribution (which isn't supported in Debian >= 12). So if you have a running Linux System and it is Debian-based and < Debian 12, you can use the script without further installations. Otherwise you have to install another Linux distribution (e.g. kali-linux), get a VM or use the provided Dockerfile.
⚠️ Attention: When using Windows and your PC is routing all traffic through a Proxy/Firewall, trying to pass the USB devices to wsl (when running the tool directly or in a container in a Linux subsystem) can be an uphill battle, due to reasons like blocked TCP connections. In this case, it may be easier to use a VM and either run the container in there or run the install script in the VM. Whether on Linux or Windows, if your proxy requires a certificate, some additional work will be necessary.
Using the shell script in a (appropriate) Linux System
The shell script installs Python3.10 and Python2.7, creates virtual environments for both versions, and installs the required submodules and pip packages. After the installation, you should be able to activate the venv for Python3.10 and run the CLI tool. If using a Linux distribution that doesn't use `apt` (non-Debian systems) or lacks an available Python2.7 package, you will need to edit the script accordingly. Please avoid changing the name of `venv2`, or you'll have to adapt the variable `VENV2_PATH` in `sbleedyCLI/constants.py`.
⚠️ Attention (again): You may think "My main system is Windows, but I can install a Linux subsystem pretty easily with wsl". Ha! Sadly it's not that easy. The sbleedy CLI tool relies on connected USB hardware, and although it's possible to share devices with usbipd-win, Bluetooth support is missing in the default WSL kernel. So if you don't want to mess around with recompiling it with some additional drivers, I recommend using a VM.
git clone https://github.com/b0rdst31n/SbleedyGonzales.git --recurse submodules
cd SbleedyGonzales
-
helpers/sbleedy_installer.sh
or when behind a Proxy:helpers/sbleedy_installer.sh --http_proxy "http://whatever.net:0000/" --https_proxy "http://whatever.net:0000/" --no_proxy "localhost,etc.int" --pip_proxy "http://whatever.net:0000/" --pip_cert "$HOME/Desktop/my_cert.crt"
- Have some patience
- If everything got installed correctly, there should now be a venv2 and venv3 folder in Sbleedy Gonzales. Then you can activate the venv3, where the sbleedy CLI tool is installed in with
source venv3/bin/activate
- Test the installation with
sbleedy -h #should print usage info
- Test the connected hardware by running
sleedy -chw
confirm that your connected devices are found.
Using a container (without a VM)
❓Note: When running a tool inside a container that relies on hardware you have to be able to share the hardware with the container, including all services. That seems to be an especially fun challenge with a USB Bluetooth Dongle. When starting dbus and bluetooth (
service dbus start
andservice bluetooth start
) on your host and passing all rights to the container (e.g. withpodman run -it —privileged —net=host sbleedy_new
), the connected dongle can be found withhciconfig
, but commands likehciconfig hci0 up
throw an "Operation not permitted"-Error. So a Dockerfile will be provided, but if you are a container newbie, you may want to use the VM.
- Install a container tool of your choice (Docker, Podman, etc.)
- When behind a Proxy: You may have to add the certificate to the container machine. Please refer to the documentation of the tool you chose (e.g., this for Podman).
- Get the Dockerfile from helpers/. You don't need to clone the whole repository. When behind a Proxy, copy the necessary certificate to the same folder as the Dockerfile.
- Build the container: e.g.
podman build --build-arg http_proxy=http://whatever.net:0000 --build-arg https_proxy=http://whatever.net:0000 --build-arg no_proxy=localhost,whatever.int --build-arg PIP_PROXY=http://whatever.net:0000 --build-arg CERTIFICATE_NAME="My_certificate.crt" -t sbleedy_new . --squash
. The build arguments are for Proxy Settings. When not using a Proxy, just dopodman build -t sbleedy_new . --squash
without the args. - Run the container and pass the connected hardware (see Note).
- Activate the
venv3
(source venv3/bin/activate
). - Test the installation of the CLI tool by running
sbleedy -h #should print usage info
. - Test the connected hardware by running
sleedy -chw
confirm that your connected devices are found.
Using a VM
-
Setup the VM:
- Install a virtual machine of your choice (e.g., VirtualBox).
- Download a pre-built VM for your machine (e.g., Kali Linux) and start it.
- When behind a Proxy: Configure the VM to use the certificate by copying the certificate as root to
/usr/local/share/ca-certificates
, then update the settings withsudo update-ca-certificates --verbose
. - The VM may also require an extension to be able to use the hardware that is connected through USB (e.g. VirtualBox Extension Pack)
Choose one of the following methods to proceed:
Option 1: Run the Container | Option 2: Run the Shell Script |
---|---|
See "Using a container" for build and run instructions | See "Using the shell script" for install instructions |
-
Test the installation:
- Activate the
venv3
(source venv3/bin/activate
). - Test the installation of the CLI tool by running
sbleedy -h #should print usage info
. You may need to runpip install .
again after activating thevenv3
.- Test the connected hardware by running
sleedy -chw
confirm that your connected devices are found.
- Test the connected hardware by running
- Activate the
Manual Installation
- Install these packages:
tzdata software-properties-common build-essential libssl-dev zlib1g-dev libncurses5-dev \ libncursesw5-dev libreadline-dev libsqlite3-dev libgdbm-dev libbz2-dev libexpat1-dev liblzma-dev tk-dev libffi-dev \ curl python2.7 python2-dev gcc wget g++ make git bluez bluetooth usbutils libbluetooth-dev cmake libcairo2-dev golang-go \ pkg-config libgirepository1.0-dev libdbus-1-dev bluez-tools python3-cairo-dev rfkill meson patchelf bluez adb python-is-python3
- Get Python2.7 and Python3.10 with the corresponding pip and virtualenv packages
- Create a venv2 with Python2.7 and venv3 with Python3.10
- Install Sweyntooth in venv2:
source venv2/bin/activate && cd modules/sweyntooth && pip install -r requirements.txt && cd libs/smp_server/ && make all && make install && cd ../../ && deactivate
- Install PyBluez, Bluing and SbleedyGonzales in venv3:
source venv3/bin/activate && cd helpers/pybluez && pip install . && cd ../../helpers/bluing && env CFLAGS="-lm" LDFLAGS="-ldl -pthread -lutil" pip install . && cd ../../ && pip install .