aboutsummaryrefslogtreecommitdiff

jns

jns is a high-performance network port scanner written in Java 25 using virtual threads. It scans single hosts or entire host lists (IPv4 and IPv6) with massive concurrency and minimal resource overhead.

Features

  • TCP & UDP scanning — TCP everywhere, plus raw-socket UDP probing on Linux
  • IPv4 and IPv6 support
  • Service detection — optional banner recognition identifies the service behind an open port
  • Massive concurrency — virtual threads with configurable limits for parallel hosts, sockets, and workers per host
  • Flexible targets — hosts as CLI arguments, from a file, or from stdin (-i -)
  • Rate limiting — configurable delay between connection attempts per host
  • Fine-grained control — per-connection timeout, port ranges, online check toggle
  • Clean reporting — quiet mode, optional filtered ports, progress feedback; partial results are preserved on Ctrl-C

Requirements

  • Java 25 or later
  • Maven (for building)
  • Linux (only required for UDP scanning)

Build

mvn package -DskipTests

This produces target/jns-1.0-SNAPSHOT.jar.

Usage

java -jar target/jns-1.0-SNAPSHOT.jar [OPTIONS] <host>...

Examples

# Scan a single host on the default port range (1-1024)
java -jar target/jns-1.0-SNAPSHOT.jar localhost

# Scan specific ports on an IPv6 host
java -jar target/jns-1.0-SNAPSHOT.jar fd00::1 -p 22,80,443

# Scan a host list from a file
java -jar target/jns-1.0-SNAPSHOT.jar -i hosts.txt -p 1-65535

# Read hosts from stdin
cat hosts.txt | java -jar target/jns-1.0-SNAPSHOT.jar -i - -p all

# UDP scan with service detection (Linux only)
java -jar target/jns-1.0-SNAPSHOT.jar 192.168.1.5 -uu -b -p 53,123

Options

Option Description Default
-p, --ports Ports to scan (e.g. 22,80,443 or 1-1024) 1-1024
-i, --input Read hosts from a file; - reads stdin –
-uu, --useUdp Use UDP instead of TCP (Linux only) false
-b, --bannerRecognition Recognize services from banners false
-t, --timeout Timeout in ms per connection attempt 3000
-d, --delay Delay in ms between connection attempts per host 0
-hl, --hostsLimit Max hosts scanned in parallel 100
-sl, --socketLimit Max sockets open in total 2048
-whl, --workersPerHostLimit Max worker threads per host unlimited
-do, --disableOnlineCheck Skip the host reachability check false
-sf, --showFilteredPorts Also show filtered ports false
-q, --quiet Suppress the progress output false

Run with --help for the full reference.

License

jns is licensed under the GNU General Public License v3.0 or later.

Copyright (C) 2026 Matthias Lucas Jaros

See LICENSE for details.