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.
little-printer-claim-code
Advanced tools
helper utility to generate (and process) claim codes for a Berg Little Printer
Claim code encoding for Little Printer devices.
Ported from this Python implementation.
Mostly I expect this to be used to encode devices into generating a claim code (via encode
), but it also supports unpacking a claim code into parameters (unpack
), and decoding a device key from a claim code (decode
);
encode
Turn device parameters into a claim code:
// generate a device address - from MAC address, or randomly, whatever
const deviceAddress = bigInt('46dbd1efebe85023', 16);
const xor = hardwareXorFromDeviceAddress(deviceAddress);
// secret only known to printer and claim code, randomly generated
const secret = bigInt('bd38b46918', 16);
console.log(encode(xor, secret));
// → '3ddc-tf5n-e4d4-2r7k'
unpack
Extract values within a claim code:
const claimCode = 'c1zp-g2ec-sqqh-28t5';
console.log(unpack(claimCode));
// → {
// deviceXor: 74565n,
// secret: 444691369455n,
// crc: 22655n,
// value: 417918447673048574272325n
// }
decode
Decode a claim code to extract the key:
const claimCode = 'c1zp-g2ec-sqqh-28t5';
console.log(decode(claimCode));
// → {
// deviceXor: 74565n,
// key: <Buffer d5 0b 90 4f 43 7c 1d 2e 87 c3 10 57 49 40 9e 3d>
// }
If all you really want to do is create a claim code with this library, then there's a script to help with that:
./bin/generate-printer.sh
// →
// address: 5f297a46f118187
// secret: da156dc11d
// xor: 11541520
// claim code: 7p6x-n5ce-r4fv-070h
Publishing works via GitHub actions, so. Create a new version (+tag, etc), which should get pushed to GitHub automatically.
yarn version
Then open GitHub, and create (+ publish) a new release. This will trigger everything else that needs doing.
FAQs
helper utility to generate (and process) claim codes for a Berg Little Printer
The npm package little-printer-claim-code receives a total of 1 weekly downloads. As such, little-printer-claim-code popularity was classified as not popular.
We found that little-printer-claim-code 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.