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.
[npm-image]: https://img.shields.io/npm/v/js-macro.svg [npm-url]: https://npmjs.org/package/js-macro [downloads-image]: https://img.shields.io/npm/dm/js-macro.svg [downloads-url]: https://npmjs.org/package/js-macro
A npm package that lets you automate your windows desktop.
const { mouse } = require('js-macro')
mouse.position()
// { x: 679, y: 0 }
mouse.move(0, 0)
// cursor is now at the very left top of the screen
mouse.leftClick()
const { exec } = require('node:child_process')
const { Window, keyboard } = require('js-macro')
exec('notepad.exe')
setTimeout(async () => {
let notepad = await Window.fromProcess('notepad.exe')
if (!notepad) {
return console.error('error: cannot find notepad :(')
}
notepad.focus()
keyboard.type('Hello, World!')
}, 1000)
const { clipboard } = require('js-macro')
clipboard.copy('Hello, World!')
clipboard.paste()
// returns 'Hello, World!'
const { clicklogger } = require('js-macro')
// add a listener on every left click
// we support left, middle, and right clicks!
clicklogger.on('left', coord => console.log(coord))
// start logging!
clicklogger.start()
// do stuff here... then
// while not required, this is highly recommended
clicklogger.stop()
const { keylogger } = require('js-macro')
// add a listener on every word (after space is pressed)
// we support raw keys, characters, words, and lines!
// please note that this listens directly to your keyboard
// which means that it can't read things like keyboard shortcuts (e.g: clipboard)
// or shifted keys directly.
keylogger.on('word', text => console.log(text))
// start logging!
keylogger.start()
// do stuff here... then
// while not required, this is highly recommended
keylogger.stop()
const { Screenshot } = require('js-macro')
const screenshot = new Screenshot({
x: 0,
y: 0,
width: 150,
height: 150
})
// take screenshot and write it to a file
await screenshot.file('file.png')
const { Screenshot } = require('js-macro')
// providing no arguments will screenshot the current monitor/screen
const screenshot = new Screenshot()
// take screenshot and write it to a Buffer in a PNG format
// the format can be 'png' or 'jpeg'
const buf = await screenshot.buffer('png')
FAQs
[npm-image]: https://img.shields.io/npm/v/js-macro.svg [npm-url]: https://npmjs.org/package/js-macro [downloads-image]: https://img.shields.io/npm/dm/js-macro.svg [downloads-url]: https://npmjs.org/package/js-macro
We found that js-macro 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.