Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
bluemix-iot-client
Advanced tools
client that reads device data from the standard input and uploads it to bluemix iot cloud
sudo npm install -g bluemix-iot-client
bluemix-iot-client -h
This is a client that represent generic IoT device which sends data to Bluemix.
It reads the standard input and sends it to the Bluemix cloud.
The data is expected to be in JSON format. For example "{\"temperature\": 31.59, \"airFlow\": 0}"
The client has 2 modes:
1. send the data as is.
2. checksum the data. In this case the data expected to be in the following format: JSON_STRING|CHECKSUM
. In this mode, the data is being checked with the checksum and only the data part (JSON_STRING) is being sent to the cloud (exactly as in the first mode).
The checksum algorithm (in javascript):
function checksum (s) {
var i, cs = 0;
for (i = 0; i < s.length; i++) {
cs += (s.charCodeAt(i) * (i + 1));
}
return cs;
}
-p
or --path
- config file path (required) - absolute path to config file of the device. check the format here-i
or --interval
- interval in milliseconds between event publishes. the default is 1000.-c
or --checksum
- checksum - mode 1 or 2 as explained above. if exists then use checksum.There are two main usages that this module can be helpful:
Reading device data from serial port and uploading it to the Bluemix cloud. For example, Arduino client that reads sensor data and writes it as JSON to the serial port (in this case the client should send the data with the checksum). In addition, there in a need to use the serialport module:
sudo npm install -g serialport
serialportlist
- lists the serial ports. Look for the the Arduino one.serialportterm -h
serialportterm -p /dev/cu.usbmodemfa131 --baud 115200 | bluemix-iot-client -p /Users/demo/Desktop/config/device.cfg --checksum
for some reason global install of serialport doesn't work for me, so I install it locally npm install serialport
and then run it like this:
./node_modules/serialport/bin/serialportList.js
./node_modules/serialport/bin/serialportTerminal.js -p /dev/cu.usbmodemfa131 --baud 115200 | bluemix-iot-client -p /Users/demo/Desktop/config/device.cfg --checksum
Reading data from the standard output of another program running on the same computer. For example, device which connects to Raspberry Pi 2 and has special libraries in different language (e.g. python). In order not to implement the same client again in another laguange, its possible to output the device data in JSON format to the standard output.
In this example, node should be installed on the Raspberry Pi 2 and the bluemix-iot-client can read the data and send to Bluemix cloud (no need in checksum):
read_sensor_data_and_send_it_as_JSON_to_standard_output_script.py | bluemix-iot-client -p /Users/demo/Desktop/config/device.cfg
FAQs
client that reads device data from the standard input and uploads it to bluemix iot cloud
The npm package bluemix-iot-client receives a total of 0 weekly downloads. As such, bluemix-iot-client popularity was classified as not popular.
We found that bluemix-iot-client demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.