Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
github.com/fermuch/go-bluetooth
Go bluetooth API for Linux-based Bluez DBus interface.
The library is a wrapper to the Bluez DBus API and some high level API to ease the interaction.
High level features supported:
rfkill
, btmgmt
, hciconfig
, hcitool
hci
socket basic API (inspired by go-ble/ble)Examples are available in _examples
folder.
cd _examples
go run main.go
# print available example commands
# Example discovery
go run main.go discovery
git clone https://github.com/muka/go-bluetooth.git
make bluez/init bluez/checkout gen/clean gen/run
The code structure follow this pattern:
./api
contains wrappers for the DBus Api./bluez
contains the actual implementation, generated from the bluez
documentationUse make gen
to re-generate go sources. There is also a commodity bluez JSON file available in the root folder for reference.
Generated code has gen_
prefix. If an API file exists with the same filename but without the prefix, generation will be skipped for that API.
In order to interact with DBus, propert configurations must be installed in the system. For a development setup, the repository provides example configurations.
cd <go-bluetooth path>
# install dbus permissions configuration, may require a system restart
make dev/dbus/install
# Add bluetooth group to own the DBus service
sudo addgroup bluetooth || true
sudo adduser `id -nu` bluetooth
The library is tested with
1.14.1
v5.50
, v5.54
Inspect a service ObjectManager
Retrieve char properties
dbus-send --system --print-reply --dest=go.bluetooth /hci0/apps/0/service000003e8/char0 org.freedesktop.DBus.Properties.GetAll string:org.bluez.GattCharacteristic1
Give access to hciconfig
to any user and avoid sudo
(may have security implications)
sudo setcap 'cap_net_raw,cap_net_admin+eip' `which hciconfig`
Monitor Bluetooth activity
sudo btmon
Monitor DBus activity
sudo dbus-monitor --system "type=error"
Start bluetoothd
with experimental features and verbose debug messages make bluetoothd
Enable LE advertisement (on a single pc ensure to use at least 2x bluetooth adapter)
sudo btmgmt -i 0 power off
sudo btmgmt -i 0 name "my go app"
sudo btmgmt -i 0 le on
sudo btmgmt -i 0 connectable on
sudo btmgmt -i 0 advertising on
sudo btmgmt -i 0 power on
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.