
Security News
Feross on the 10 Minutes or Less Podcast: Nobody Reads the Code
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.
node-nmap-hosts
Advanced tools
This Node.js module provides a simple interface to run detailed nmap scans on a given IP range or specific IP and returns structured host information.
npm install node-nmap-hosts
yarn add node-nmap-hosts
import { runNmapScan } from "./runNmap";
import { writeFileSync } from 'fs';
runNmapScan('192.168.1.1/24', [22, 80, 443, 8080])
.then(data => {
console.log("Nmap Scan Data:", data);
})
.catch(error => {
console.error("Error during Nmap Scan:", error);
});
runNmapScan(target: string, ports: number[]): Promise<HostInfo[]>
Runs a detailed nmap scan on a given IP range or specific IP and returns structured host information.
target: The target IP range or specific IP for the nmap scan.
ports: Array of ports to scan.
Returns a Promise that resolves with a detailed list of host information.
HostInfo
The HostInfo interface represents the structured information about a host.
interface HostInfo {
ip: string;
mac?: string;
vendor?: string;
hostname?: string;
ports: {
port: number;
state: string;
serviceName?: string;
serviceProduct?: string;
}[];
os?: string;
}
This module requires nmap to be installed on the system where it's being used. You can download nmap from here: https://nmap.org/download.html.
This module depends on the following packages:
child_process: Used to execute the nmap command.
xml2js: Used to parse the XML output of the nmap command.
License - Apache 2.0
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
FAQs
Unknown package
We found that node-nmap-hosts 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.

Security News
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.

Research
/Security News
Campaign of 108 extensions harvests identities, steals sessions, and adds backdoors to browsers, all tied to the same C2 infrastructure.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.