pentestfunctions / BlueDucky

🚨 CVE-2023-45866 - BlueDucky Implementation (Using DuckyScript) 🔓 Unauthenticated Peering Leading to Code Execution (Using HID Keyboard)
953 stars 162 forks source link

I get the error No Compatible {blue}Bluetooth devices{reset} are connected. #49

Open Aggelos11 opened 1 month ago

Aggelos11 commented 1 month ago

Screenshot from 2024-05-18 10-53-19 Screenshot from 2024-05-18 10-53-57 Screenshot from 2024-05-18 10-55-13 Screenshot from 2024-05-18 10-55-41

Flynnlin commented 1 month ago

same

DG1FI commented 1 month ago

Same - with internal RPI4 BT Device and an Cambridge Stick.

YKTV8 commented 1 month ago

Confirmed. Same issue. RPI4 Asus BT adapter.

Aggelos11 commented 1 month ago

I don’t think it’s the adaptor problem . The developer modified the script some days before and probably he broke something . He needs to fix it asap

Lamentomori commented 1 month ago

I don’t think it’s the adaptor problem . The developer modified the script some days before and probably he broke something . He needs to fix it asap

Its a problem with your adapter. If you check BlueDucky.py, on Line: 640 We have a new Function Called "troubleshoot_bluetooth". The purpose of this function is to troubleshoot the adapters capability with bluetoothctl, if the adapter is not capatible with Bluetoothctl, or Bluetoothctl has been installed incorrectly you will be notified of whats preventing you from accessing the application. It is designed to keep people who are not capable of accessing the application later from accessing it initially..

Please Reference the code found in this function

 # Check if bluetoothctl is available
    try:
        subprocess.run(['bluetoothctl', '--version'], check=True, stdout=subprocess.PIPE)
    except subprocess.CalledProcessError:
        print("{reset}[{red}!{reset}] {red}CRITICAL{reset}: {blue}bluetoothctl {reset}is not installed or not working properly.")
        return False

    # Check for Bluetooth adapters
    result = subprocess.run(['bluetoothctl', 'list'], capture_output=True, text=True)
    if "Controller" not in result.stdout:
        print("{reset}[{red}!{reset}] {red}CRITICAL{reset}: No {blue}Bluetooth adapters{reset} have been detected.")
        return False

    # List devices to see if any are connected
    result = subprocess.run(['bluetoothctl', 'devices'], capture_output=True, text=True)
    if "Device" not in result.stdout:
        print("{reset}[{red}!{reset}] {red}CRITICAL{reset}: No Compatible {blue}Bluetooth devices{reset} are connected.")
        return False

    # if no issues are found then continue
    return True
Lamentomori commented 1 month ago

If you think this may be a mistake, please contact me via discord with anything that may help your problem if it does NOT concern your Bluetooth Adapter, If your Bluetooth adapter is not supported, Then it is NOT supported. You will need to use another device or purchase a new Adapter, and I will work with you to fix the problem | I apologize for any inconvenience. @youjsgotpwned

Aggelos11 commented 1 month ago

Well my Bluetooth adaptor is Asus USB-BT500 USB Bluetooth 5.0 . Do you know if I should install any drivers or something ? Because it recognised by Kali and I can scan for Bluetooth devices using the hcitool. Do you have any adaptor to suggest ?

Lamentomori commented 1 month ago

Screenshot from 2024-05-18 10-53-19 Screenshot from 2024-05-18 10-53-57 Screenshot from 2024-05-18 10-55-13 Screenshot from 2024-05-18 10-55-41

I do apologise, I did not see the screenshot.

Lamentomori commented 1 month ago

Well my Bluetooth adaptor is Asus USB-BT500 USB Bluetooth 5.0 . Do you know if I should install any drivers or something ? Because it recognised by Kali and I can scan for Bluetooth devices using the hcitool. Do you have any adaptor to suggest ?

within BlueDucky.py the original developer Hardcoded Hci0 causing issues. I added this to make debugging easier, I will make a modification to check for another Bluetooth adapter as it defaults to hci0. For now Please open BlueDucky.py and 'Control + F' and find hci0 and replace it with hci1.

Lamentomori commented 1 month ago

Well my Bluetooth adaptor is Asus USB-BT500 USB Bluetooth 5.0 . Do you know if I should install any drivers or something ? Because it recognised by Kali and I can scan for Bluetooth devices using the hcitool. Do you have any adaptor to suggest ?

within BlueDucky.py the original developer Hardcoded Hci0 causing issues. I added this to make debugging easier, I will make a modification to check for another Bluetooth adapter as it defaults to hci0. For now Please open BlueDucky.py and 'Control + F' and find hci0 and replace it with hci1.

Doing what I described above, should resolve your issues. As right now its defaulting to an adapter that is DOWN or currently Not Available. Feel free to contact me via discord: @youjsgotpwned

Aggelos11 commented 1 month ago

Yes but as you can see in the screenshot I sent I already replaced hci0 with hci1 in the line 674 I think where it says default=… . Should I replace it to other points as well ?

Aggelos11 commented 1 month ago

Also can you check if my adaptor is supported pls or not ? Because as I told you it can scan for Bluetooth devices using the the hcitool which I think it’s a sign that it should work

alex8819 commented 1 month ago

On raspberry Pi 5 with ubuntu server i solved with this:

Restart the bluetooth sudo systemctl restart bluetooth

Start the process: bluetoothctl

execute command:

power on
agent on
default-agent
scan on

Exit from bluetoothctl exit

after that: sudo python3 BlueDucky.py will start.

Aggelos11 commented 1 month ago

Do I need to do this every time I wanna use it or only once ?

alex8819 commented 1 month ago

After BlueDucky.py crash, every time i need to make this command 2 times, after that BlueDucky.py start, but when it will crash i need to do it again. i mada a small script to speed up: sudo nano reset.sh

#!/bin/bash
# Script per ripristinare il Bluetooth dopo un crash di BlueDucky.py

echo "Ripristino del Bluetooth in corso..."
sudo systemctl restart bluetooth
bluetoothctl power on
bluetoothctl agent on
bluetoothctl default-agent
bluetoothctl scan on

Add permission: sudo chmod +x reset.sh

execute the script: ./reset.sh

Stop the script CTRL + C

Execute agin,stop again and start: sudo python3 BlueDucky.py

Aggelos11 commented 1 month ago

Which chipset does your wireless adaptor have ?

DG1FI commented 1 month ago

the commands are working. with "bluetoothctl scan on" it found many bluetooth devices, like mobile phones and bluetooth speatker. the blueducky script found only my lge tv. i've tried it many times and with different adapters...

without the commands above, the adapters are not working -> no compatible adapters found

DG1FI commented 1 month ago

# List devices to see if any are connected result = subprocess.run(['bluetoothctl', 'devices'], capture_output=True, text=True) if "Device" not in result.stdout: print("{reset}[{red}!{reset}] {red}CRITICAL{reset}: No Compatible {blue}Bluetooth devices{reset} are connected.") return False

i've try it out... the command "bluetoothctl devices" is here empty at startup... the command "scan on" initiates the scan and add devices to the list, like this:

Device 48:E1:5C:76:34:B2 48-E1-5C-76-34-B2 Device 3E:55:13:F2:A9:72 3E-55-13-F2-A9-72 Device 74:FF:8F:4C:5E:76 74-FF-8F-4C-5E-76 Device 61:76:CB:39:FD:7F 61-76-CB-39-FD-7F Device 18:58:80:51:30:89 [LG] webOS TV UQ70006LB Device C4:35:34:37:12:75 Govee_H6072_1275 Device C4:42:25:D7:3B:34 T-Echo DG1FI-11 [bluetooth]#

but if i run blueducky, only my lge tv is listed- the other devices not.

Aggelos11 commented 1 month ago

Same for me … I also contacted the developer on Discoed but he does not respond as he has said ..

Flynnlin commented 1 month ago

在带有 ubuntu 服务器的树莓派 5 上,我解决了这个问题:

重新启动蓝牙 sudo systemctl restart bluetooth

启动进程: bluetoothctl

执行命令:

power on
agent on
default-agent
scan on

退出bluetoothctl exit

之后: sudo python3 BlueDucky.py将开始。

worked. my device is Pi ZERO 2W

Aggelos11 commented 1 month ago

It worked for me once but I need to repeat this process each time I want to run the script . Also most times it does not work ( does not find Bluetooth devices )

Christiancoding commented 1 month ago

I had the same issue: {reset}[{red}!{reset}] {red}CRITICAL{reset}: No Compatible {blue}Bluetooth devices{reset} are connected.

I fixed it by connecting it to a Bluetooth device. After that, it worked just fine.

Aggelos11 commented 1 month ago

And how exactly did you do that ?

mohamedmajid91 commented 1 month ago

!/bin/bash

Script to unblock and restore Bluetooth after a crash of BlueDucky.py

echo "Restoring Bluetooth..." Unblock the Bluetooth device

if ! sudo rfkill unblock bluetooth; then echo "Failed to unblock Bluetooth device." exit 1 fi Bring up the Bluetooth interface

if ! sudo hciconfig hci1 up; then echo "Failed to bring up Bluetooth interface." exit 1 fi Restart the Bluetooth service

if ! sudo systemctl restart bluetooth; then echo "Failed to restart Bluetooth service." exit 1 fi Wait for the service to restart

sleep 5 Use bluetoothctl to configure Bluetooth

{ echo "power on" sleep 1 echo "agent off" sleep 1 echo "agent on" sleep 1 echo "default-agent" sleep 1 echo "scan on" sleep 5 } | bluetoothctl

echo "Bluetooth restored successfully." Delay before running the Python script

sleep 5 Run the Python script

if ! sudo python3 BlueDucky.py; then echo "Failed to run BlueDucky.py." exit 1 fi

exit 0

sudo nano restore_bluetooth.sh

sudo chmod +x restore_bluetooth.sh

ABC00012345 commented 4 weeks ago

or just remove the return False in the script, it is working for me

Aggelos11 commented 4 weeks ago

Can you explain it a bit more please ? Exactly what I need to do in which line etc?

or just remove the return False in the script, it is working for me

ABC00012345 commented 4 weeks ago

Can you explain it a bit more please ? Exactly what I need to do in which line etc?

or just remove the return False in the script, it is working for me

Here, I think it's near to line 640, the last return False, where it says before no compltatible bluetooth devices connected. Or you can also remove the complete if condition:

Check if bluetoothctl is available try: subprocess.run(['bluetoothctl', '--version'], check=True, stdout=subprocess.PIPE) except subprocess.CalledProcessError: print("{reset}[{red}!{reset}] {red}CRITICAL{reset}: {blue}bluetoothctl {reset}is not installed or not working properly.") return False

# Check for Bluetooth adapters
result = subprocess.run(['bluetoothctl', 'list'], capture_output=True, text=True)
if "Controller" not in result.stdout:
    print("{reset}[{red}!{reset}] {red}CRITICAL{reset}: No {blue}Bluetooth adapters{reset} have been detected.")
    return False

# List devices to see if any are connected
result = subprocess.run(['bluetoothctl', 'devices'], capture_output=True, text=True)
if "Device" not in result.stdout:
    print("{reset}[{red}!{reset}] {red}CRITICAL{reset}: No Compatible {blue}Bluetooth devices{reset} are connected.")
    return False # HERE ....................... Remove this

# if no issues are found then continue
return True