https://github.com/nullstring1/nscan
Basic port scanner written in Rust. Supports SYN, Connect and FIN scans
https://github.com/nullstring1/nscan
portscanner rust tcp
Last synced: 10 months ago
JSON representation
Basic port scanner written in Rust. Supports SYN, Connect and FIN scans
- Host: GitHub
- URL: https://github.com/nullstring1/nscan
- Owner: NullString1
- Created: 2025-03-19T20:43:00.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2025-03-21T12:37:21.000Z (over 1 year ago)
- Last Synced: 2025-03-21T12:52:42.458Z (over 1 year ago)
- Topics: portscanner, rust, tcp
- Language: Rust
- Homepage:
- Size: 11.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
[![Contributors][contributors-shield]][contributors-url]
[![Forks][forks-shield]][forks-url]
[![Stargazers][stars-shield]][stars-url]
[![Issues][issues-shield]][issues-url]
### Table of Contents
## About The Project
NScan is a simple cross-platform IPv4 and IPv6 port scanner written in Rust, supporting SYN, FIN and Connect scans.
You can scan one address such as `example.com` or `1.1.1.1`, or a CIDR range such as `127.0.0.0/8`.
You can select just one port to scan `-p 20`, a selection of ports `-p 20,80`, a range of ports `-p 20-25` or any mix of the three `-p 20,80-90,25`.
## Usage
Download the lastest release or compile yourself with `cargo build --release`.
Run `NScan -h` to view the help message
```
Simple port scanner written in rust. Supports SYN, Connect, and FIN scans
Usage: NScan [OPTIONS] --host
Options:
-H, --host IP address, hostname, or CIDR range to scan
-p, --port-range Port to scan [default: 80]
-s, --scan-type Scan type [default: syn] [possible values: syn, connect, fin]
-t, --timeout Timeout in seconds (max 255) [default: 1]
-T, --threads Number of threads to use (4) [default: 4]
-h, --help Print help
```
Run `sudo NScan -H 127.0.0.1` to run a `SYN` scan on `127.0.0.1:80` (Ensure you use sudo or run as root on linux due to use of raw sockets)
```
NScan v1.0 - Network scanner
------------------------------
Scan configuration:
Target(s): 127.0.0.1 (1 addresses)
Port(s): 80 (1 ports)
Method: SYN
Timeout: 1 seconds
Threads: 4
Total scans: 1
------------------------------
Scan started at 12:21:03
Running...
Port 80 is closed (Received RST/ACK)
------------------------------
Scan completed in 0.00 seconds
Found 0 open ports
```
Run `sudo NScan -H ::1 -p 443` to run a `SYN` scan on `::1` (IPv6 loopback) port `443` (Ensure you use sudo or run as root on linux due to use of raw sockets)
```
NScan v1.0 - Network scanner
------------------------------
Scan configuration:
Target(s): ::1 (1 addresses)
Port(s): 443 (1 ports)
Method: SYN
Timeout: 1 seconds
Threads: 4
Total scans: 1
------------------------------
Scan started at 12:23:38
Running...
Port 443 is closed (Received RST/ACK)
------------------------------
Scan completed in 0.00 seconds
Found 0 open ports
```
Run `NScan -H 1.1.1.1 -p 80 -s connect` to run a `Connect` scan on `1.1.1.1` port 80. (No root required due to use of unpriviledged socket)
```
NScan v1.0 - Network scanner
------------------------------
Scan configuration:
Target(s): 1.1.1.1 (1 addresses)
Port(s): 80 (1 ports)
Method: Connect
Timeout: 1 seconds
Threads: 4
Total scans: 1
------------------------------
Scan started at 12:24:38
Running...
Port 80 is open
------------------------------
Scan completed in 0.02 seconds
Found 1 open ports
Open ports:
1.1.1.1:80 - OPEN
```
Run `sudo NScan -H ::1 -t 10` to run a `SYN` scan on `::1` port 80 with timeout set at `10 seconds` (Ensure you use sudo or run as root on linux due to use of raw sockets)
```
NScan v1.0 - Network scanner
------------------------------
Scan configuration:
Target(s): ::1 (1 addresses)
Port(s): 80 (1 ports)
Method: SYN
Timeout: 10 seconds
Threads: 4
Total scans: 1
------------------------------
Scan started at 12:28:56
Running...
Port 80 is closed (Received RST/ACK)
------------------------------
Scan completed in 0.00 seconds
Found 0 open ports
```
Run `sudo NScan -H 127.0.0.0/24 -p 22 -t 1 -s syn -T 8` to run a `SYN` scan on `127.0.0.0/24` port 22 with timeout `1 second` on `8 threads` (Ensure you use sudo or run as root on linux due to use of raw sockets)
```
NScan v1.0 - Network scanner
------------------------------
Scan configuration:
Target(s): 127.0.0.0/24 (256 addresses)
Port(s): 22 (1 ports)
Method: SYN
Timeout: 1 seconds
Threads: 2
Total scans: 256
------------------------------
Scan started at 12:32:21
Running...
Port 22 is closed (Received RST/ACK)
Port 22 is closed (Received RST/ACK)
Port 22 is closed (Received RST/ACK)
Port 22 is closed (Received RST/ACK)
Port 22 is closed (Received RST/ACK)
Port 22 is closed (Received RST/ACK)
Port 22 is closed (Received RST/ACK)
Port 22 is closed (Received RST/ACK)
...... (output trimmed)
```
## Contributing
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement".
Don't forget to give the project a star! Thanks again!
1. Fork the Project
2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)
4. Push to the Branch (`git push origin feature/AmazingFeature`)
5. Open a Pull Request
## Contact
Daniel Kern (NullString1) - [@nullstring1_](https://twitter.com/nullstring1_) - daniel@nullstring.one
Website: [https://nullstring.one](https://nullstring.one)
Project Link: [https://github.com/NullString1/NScan](https://github.com/NullString1/NScan)
[contributors-shield]: https://img.shields.io/github/contributors/NullString1/NScan.svg?style=for-the-badge
[contributors-url]: https://github.com/NullString1/NScan/graphs/contributors
[forks-shield]: https://img.shields.io/github/forks/NullString1/NScan.svg?style=for-the-badge
[forks-url]: https://github.com/NullString1/NScan/network/members
[stars-shield]: https://img.shields.io/github/stars/NullString1/NScan.svg?style=for-the-badge
[stars-url]: https://github.com/NullString1/NScan/stargazers
[issues-shield]: https://img.shields.io/github/issues/NullString1/NScan.svg?style=for-the-badge
[issues-url]: https://github.com/NullString1/NScan/issues
[license-shield]: https://img.shields.io/github/license/NullString1/NScan.svg?style=for-the-badge
[license-url]: https://github.com/NullString1/NScan/blob/master/LICENSE