
Research
npm Malware Targets Telegram Bot Developers with Persistent SSH Backdoors
Malicious npm packages posing as Telegram bot libraries install SSH backdoors and exfiltrate data from Linux developer machines.
accountdown-token
Advanced tools
Token authentication for accountdown
npm i accountdown-token --save
npm test
var Token = require('accountdown-token');
var accountdown = require('accountdown');
var level = require('level');
var db = level('tmp/users.db');
var users = accountdown(db, {
login: {
token: Token
}
});
users.create('doowb', { login: { username: 'doowb', token 'foobarbaz' }, value: { name: 'Brian' }}, function (err) {
if (err) return console.log('Error creating user', err);
users.verify('token', { username: 'doowb', token: 'foobarbaz' }, function (err, ok, id) {
if (err) return console.log('Error', err);
if (ok === false) return console.log('Invalid token for ' + id);
console.log('Valid token for ' + id);
}):
});
Verify that the token is correct and still valid (e.g. not expired)
creds
{Object}: Credentials object containing a username
and token
to validate.cb
{Function}: Callback that takes err, ok, id
login.verify({ username: 'doowb', token: 'XXXXXXXXXXXX' }, function (err, ok, id) {
if (err) return console.log('Error validating token');
if (ok === true) return console.log('valid token for ' + id);
console.log('Invalid token for ' + id);
});
Create a new user token for the given id and credentials.
id
{String}: Identifier of the account being created.creds
{Object}: Credentials object used for creating the token.returns
{Array}: Array of rows to be added to the [accountdown] databaselogin.create('doowb', { username: 'doowb' });
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue
Brian Woodward
Copyright (c) 2015 Brian Woodward
Released under the MIT license
This file was generated by verb on February 03, 2015.
FAQs
Token authentication for accountdown
The npm package accountdown-token receives a total of 6 weekly downloads. As such, accountdown-token popularity was classified as not popular.
We found that accountdown-token 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
Malicious npm packages posing as Telegram bot libraries install SSH backdoors and exfiltrate data from Linux developer machines.
Security News
pip, PDM, pip-audit, and the packaging library are already adding support for Python’s new lock file format.
Product
Socket's Go support is now generally available, bringing automatic scanning and deep code analysis to all users with Go projects.