nscan 0.18.0

Cross-platform network scan tool for host and service discovery
nscan-0.18.0 is not a library.

nscan Crates.io License

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

Features

  • Port Scan
  • Host Scan
  • Service detection
  • OS detection

Installation

Releases

You can download archives of precompiled binaries from the releases .

Cargo Install

cargo install nscan

Basic Usage

USAGE:
    nscan [OPTIONS]

OPTIONS:
    -p, --port <target>                 Scan ports of the specified host.
                                        Use default port list if port range omitted.
                                        Examples:
                                        --port 192.168.1.8 -S -O
                                        --port 192.168.1.8:1-1000
                                        --port 192.168.1.8:22,80,8080
                                        --port 192.168.1.8 -l custom-list.txt
    -n, --host <target>                 Scan hosts in specified network or host-list.
                                        Examples:
                                        --host 192.168.1.0
                                        --host 192.168.1.0/24
                                        --host custom-list.txt
                                        --host 192.168.1.10,192.168.1.20,192.168.1.30
    -e, --interfaces                    List network interfaces
    -i, --interface <interface_name>    Specify the network interface
    -s, --source <ip_addr>              Specify the source IP address
    -P, --protocol <protocol>           Specify the protocol
    -T, --scantype <scantype>           Specify the scan-type
    -t, --timeout <duration>            Set timeout in ms - Example: -t 10000
    -w, --waittime <duration>           Set wait-time in ms (default:100ms) - Example: -w 200
    -r, --rate <duration>               Set send-rate in ms - Example: -r 1
    -R, --random                        Don't randomize targets. By default, nscan randomizes the
                                        order of targets.
    -c, --count <count>                 Set number of requests or pings to be sent
    -S, --service                       Enable service detection
    -A, --async                         Perform asynchronous scan
    -l, --list <file_path>              Use list - Example: -l custom-list.txt
    -W, --wellknown                     Use well-known ports
    -j, --json                          Displays results in JSON format.
    -o, --save <file_path>              Save scan result in json format - Example: -o result.json
        --acceptinvalidcerts            Accept invalid certs (This introduces significant
                                        vulnerabilities)
    -h, --help                          Print help information
    -V, --version                       Print version information

Supported platforms

  • Linux
  • macOS
  • Windows

Privileges

nscan uses a raw socket which require elevated privileges. Execute with administrator privileges.

Note for Windows Users

If you are using Windows, please consider the following points before building and running the application:

  • Npcap or WinPcap Installation:
    • Ensure that you have Npcap or WinPcap installed on your system.
    • If using Npcap, make sure to install it with the "Install Npcap in WinPcap API-compatible Mode" option.
  • Build Dependencies:
    • Place the Packet.lib file from the Npcap SDK or WinPcap Developers pack in a directory named lib at the root of this repository.
    • You can use any of the locations listed in the %LIB% or $Env:LIB environment variables.
    • For the 64-bit toolchain, the Packet.lib is located in /Lib/x64/Packet.lib.
    • For the 32-bit toolchain, the Packet.lib is located in /Lib/Packet.lib.

My related projects

This tool also serves as a test for my following projects.

  • default-net Cross-platform library for network interface and gateway
  • netscan Cross-platform network scan library
  • xenet Cross-platform networking library