Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
@astrohaus/networkmanager-dbus
Advanced tools
A nodejs interface to communicate with NetworkManager via DBus
Forked from https://gitlab.com/dropworks-oss/networkmanager-dbus
This library powers the code that interacts with DBus.
Great tutorial on basic interaction with NetworkManager via DBus
NetworkManager is the program that manages network connections on Ubuntu and BalenaOS Systems (probably on some other Linux flavors too). It's super powerful; you can configure a connection to pretty much any kind of network including:
This library provides some basic wrapper functionality for NodeJS apps. It was developed to perform basic wifi provisioning from within an Electron app, but it'll work well with any NodeJS app.
Note: This has only been tested on Ubuntu Linux. It should work fine on other Linux distros with some setup, and it supposedly works on Mac as well.
npm install dbus-next networkmanager-dbus
import { NetworkManager } from 'network-manager-dbus';
let networkManager = await NetworkManager.init();
let wifiDevice = await networkManager.wifiDevice();
// Subscribe to discovered access points
wifiDevice.accessPoints$.subscribe((accessPoints) => {
console.log(`access points:`);
console.log(accessPoints);
});
// Requests a network scan
// Usually takes a few seconds to complete
// Access points will be updated
wifiDevice.requestScan();
import { NetworkManager, DeviceState } from 'network-manager-dbus';
let networkManager = await NetworkManager.init();
let wifiDevice = await networkManager.wifiDevice();
let connectionSettingsManager = await networkManager.connectionSettingsManager();
// Subscribe to WifiDevice properties
wifiDevice.properties$.subscribe((properties) => {
console.log(`WiFi Status:`);
console.log(`Connection state: ${DeviceState[properties.State.value]}`);
if (properties.ActiveAccessPoint.value) {
if (wifiDevice.accessPoints[properties.ActiveAccessPoint.value]) {
console.log(`Connected to access point:`);
console.log(wifiDevice.accessPoints[properties.ActiveAccessPoint.value]);
} else {
console.log(`Not connected to a discovered access point`);
}
} else {
console.log(`Not connected to an Access Point`);
}
});
let networkIsHidden = false;
let connectionProfilePath = await connectionSettingsManager.addWifiWpaConnection(
'MY_SSID',
networkIsHidden,
'MY_PASSWORD',
);
// After the connection is activated, the wifiDevice.properties$ observable will update with
// a new ActiveAccessPoint
await wifiDevice.activateConnection(connectionProfilePath);
import { NetworkManager } from 'network-manager-dbus';
let networkManager = await NetworkManager.init();
let ethernetDevice = await networkManager.ethernetDevice();
ethernetDevice.properties$.subscribe((properties) => {
if (properties.Carrier.value) {
console.log('Cable plugged in');
} else {
console.warn('Cable unplugged!');
}
});
This library was originally developed for use in an Electron app running on a BalenaOS device.
When in an electron app, you can only make calls to native/nodejs libraries in the main context (i.e. electron's main.js; not in your actual webapp). However, you may still want to utilize proper types when passing information gathered from this library (like a list of local access points) to your render context.
Types for objects can be accessed by importing them from networkmanager-dbus/lib/dbus-types
in your render context. This will not import any actual code,
just interfaces, enums, types, etc. Example:
import { DeviceState } from `networkmanager-dbus/lib/dbus-types`;
Contributions are welcome! Just submit a PR on Gitlab.
This library was developed at Dropworks. We make a pretty incredible digital droplet PCR machine. If your lab needs an afforable and highly accurate PCR machine, keep us in mind! Additionally, if you're a developer that's looking to work on interesting projects with a great team, please check out our job openings!
FAQs
A nodejs interface to communicate with NetworkManager via DBus
The npm package @astrohaus/networkmanager-dbus receives a total of 6 weekly downloads. As such, @astrohaus/networkmanager-dbus popularity was classified as not popular.
We found that @astrohaus/networkmanager-dbus demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
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
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.