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.
cross-port-killer
Advanced tools
Kill the process running on a given TCP port on Windows, Linux and Mac
Kill the process running on a given TCP port on Windows, Linux and Mac
$ npm install cross-port-killer -D
import { kill, killer } from 'cross-port-killer';
kill(9090).then(pids => {
console.log(pids)
})
// you could also kill pids manually if you know them... this would save you bringing up another lib, you are welcome.
killer.killByPid(12345).then(() => console.log('done'))
killer.killByPids([12345, 54321]).then(() => console.log('done'))
This lib also comes with a CLI
.
To kill any process occupying the port 9090 you can run:
$ npx cross-port-killer 9090
or
$ npm install cross-port-killer -g
$ kill-port 9090
On Linux/Mac this library depends on lsof
in case you don't have it installed (perhaps you are using docker?) run:
$ apt-get install lsof
On Mac, It comes with the OS by default so nothing to worries.
FAQs
Kill the process running on a given TCP port on Windows, Linux and Mac
The npm package cross-port-killer receives a total of 12,763 weekly downloads. As such, cross-port-killer popularity was classified as popular.
We found that cross-port-killer 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.