Skip to content
프로젝트

소개

Build & leverage nmap as a node.js module, no need to install an nmap binary.

시스템 및 인프라

이 수치를 측정하는 방법

측정된 스타 증가

in 24h
0
in 7 days
0
in 15 days
0
in 1 month
기록 수집 중

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

libnmap

Build & leverage nmap as a node.js module, no need to install an nmap binary.

npm CI Downloads Known Vulnerabilities

install

npm install libnmap

To install npm install libnmap

The install gets the nmap and OpenSSL sources and compiles them. See build tools for details.

Some package managers (pnpm, yarn, bun, and npm with ignore-scripts) do not run install scripts unless you allow them. If a scan gives the error "the nmap module is not compiled", allow the install script of libnmap and run npm rebuild libnmap.

build tools

Example package requirements.

Debian, Ubuntu (apt)
sudo apt-get install build-essential perl python3 nodejs npm
Fedora, RHEL, CentOS, Rocky, AlmaLinux (dnf)
sudo dnf install gcc gcc-c++ make perl python3 diffutils tar nodejs npm
openSUSE (zypper)
sudo zypper install gcc gcc-c++ make perl python3 nodejs npm
Arch Linux, Manjaro (pacman)
sudo pacman -S --needed base-devel perl python nodejs npm
Gentoo (emerge)
sudo emerge --ask dev-lang/perl dev-lang/python net-libs/nodejs

The compiler and make are part of the base system.

Alpine (apk)
sudo apk add build-base linux-headers perl python3 nodejs npm
macOS
xcode-select --install
brew install node

The Xcode command line tools supply the compiler, make, perl and python3.

methods

  • scan Scans the ports of each host in the range
  • discover Finds the neighbors on the IPv4 network of each network interface

options

  • range {Array} Hostnames, IPv4/IPv6 addresses, CIDR or address ranges
  • ports {String} Ports to scan (default 1-1024)
  • timeout {Number} Number of seconds to wait for each host (default 120)
  • flags {Array} More nmap flags (default -T4)
  • udp {Boolean} Scan UDP ports (requires root)
  • json {Boolean} JSON object as output (default), false produces XML

examples

More examples are in the examples/ folder.

scan

scan report

const nmap = require('libnmap');
const opts = {
  range: [
    'scanme.nmap.org',
    '10.0.2.0/25',
    '192.168.10.80-120',
    'fe80::42:acff:fe11:fd4e/64'
  ],
  ports: '22,80,443'
};

nmap.scan(opts, function(err, report) {
  if (err) throw err;

  console.log(JSON.stringify(report, null, 2));
});

discover

discover report

const nmap = require('libnmap');

nmap.discover(function(err, report) {
  if (err) throw err;

  console.log(JSON.stringify(report, null, 2));
});

tests

To test npm test

license

This software is licensed under the Nmap Public Source License, the same license as nmap. See LICENSE.

Copyright Jason Gerfen, 2013.

관련 프로젝트 살펴보기

불러오는 중…