#network #security #scan #cli #cross-platform

app nscan

Cross-platform network scan tool for host and service discovery

6 releases

0.9.3 Apr 24, 2022
0.9.2 Feb 14, 2022
0.9.0 Jan 5, 2022
0.8.0 Nov 28, 2021
0.4.0 May 4, 2021

#1621 in Network programming

MIT license


nscan Crates.io License

Cross-platform network scan tool for host and service discovery.
Aim to be simple and fast.


  • Port Scan
  • Host Scan
  • Async Port Scan
  • Async Host Scan
  • Service detection (Experimental)
  • OS detection (Experimental)


Cargo Install

cargo install nscan

Basic Usage

    nscan [FLAGS] [OPTIONS]

    -s, --service               Enable service detection
    -A, --acceptinvalidcerts    Accept invalid certs (This introduces significant vulnerabilities)
    -a, --async                 Perform asynchronous scan
    -O, --OS                    Enable OS detection
    -h, --help                  Prints help information
    -V, --version               Prints version information

    -p, --port <ip_addr:port>        Scan ports of the specified host. 
                                     Use default port list if port range omitted. 
                                     -p -s -O 
                                     -p -l custom-list.txt
    -n, --network <ip_addr>          Scan hosts in specified network 
                                     Example: -n -O
    -H, --host <host_list>           Scan hosts in specified host-list 
                                     -H custom-list.txt -O 
                                     -H,, -O
    -t, --timeout <duration>         Set timeout in ms - Ex: -t 10000
    -w, --waittime <duration>        Set waittime in ms (default:100ms) - Ex: -w 200
    -r, --rate <duration>            Set sendrate in ms - Ex: -r 1
    -P, --portscantype <scantype>    Set port scan type (default:SYN) - SYN, CONNECT
    -i, --interface <name>           Specify network interface by IP address - Ex: -i
    -l, --list <file_path>           Use list - Ex: -l custom-list.txt
    -o, --output <file_path>         Save scan result in json format - Ex: -o result.json


Port scan with service version and OS detection

sudo nscan -p -s -O

Host scan with OS detection

sudo nscan -n -O  

-a(--async) flag for asynchronous scan
-o(--output) option for save json format data to file

Supported platforms

  • Linux
  • macOS (OS X)
  • Windows

Note for Windows users

To build libpnet on Windows, follow the instructions below.


  • You must use a version of Rust which uses the MSVC toolchain
  • You must have WinPcap or npcap installed (tested with version WinPcap 4.1.3) (If using npcap, make sure to install with the "Install Npcap in WinPcap API-compatible Mode")
  • You must place Packet.lib from the WinPcap Developers pack in a directory named lib, in the root of this repository. Alternatively, you can use any of the locations listed in the %LIB%/$Env:LIB environment variables. For the 64 bit toolchain it is in WpdPack/Lib/x64/Packet.lib, for the 32 bit toolchain, it is in WpdPack/Lib/Packet.lib.



~672K SLoC