GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - jas-/libnmap: Build & leverage nmap as a node.js module, no need to install an nmap binary.

BranchesTags
Open more actions menu

Latest commit

 

History

505 Commits
505 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
docs
docs
 
 
examples
examples
 
 
lib
lib
 
 
scripts
scripts
 
 
src
src
 
 
test
test
 
 
.gitignore
.gitignore
 
 
.gitmodules
.gitmodules
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
binding.gyp
binding.gyp
 
 
index.js
index.js
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 

Repository files navigation

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.

About

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

Topics

networknetwork-scannernetwork-securitynetworkingnmapnmap-scannmap-scriptsnodejs

Resources

Readme
License

Contributing

Contributing
Activity

Stars

255 stars

Watchers

12 watching

Forks

43 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.