Skip to content

dadevel/nmapj

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nmapj

A wrapper around nmap that prints JSONL output.

Setup

Install the Python package.

a) With pipx.

pipx install git+https://github.com/dadevel/nmapjson.git@main

b) With pip.

pip install --user git+https://github.com/dadevel/nmapjson.git@main

Optional: Give unprivileged nmap processes access to raw sockets.

sudo setcap CAP_NET_RAW=ep "$(which nmap)"

Usage

Discover web servers and scan them with nuclei.

nmapj -A 192.168.1.0/24 | \
  tee ./nmap.json | \
  jq -r 'select(.application=="http")|"\(.address):\(.port)"' | \
  nuclei -silent -automatic-scan

Tips

Balance scanning of large networks over multiple nmap processes. The example runs 16 processes in parallel with 128 IPs per process.

echo 192.168.0.0/16 | \
  mapcidr -silent | \
  parallel --progress --pipe --ungroup --jobs 16 -N 128 -- nmapj --privileged -iL - -n -Pn -T4 --top-ports 100 -sS -sV --version-intensity 0 | \
  tee ./nmap.json

Packages

No packages published

Languages