Thanks to visit codestin.com
Credit goes to github.com

Skip to content

SuperScan-UV is an experimental project designed to explore high-performance network scanning using modern C and asynchronous I/O. It is built to be a fast, flexible, and powerful tool for network reconnaissance, capable of managing thousands of concurrent connections efficiently.

Notifications You must be signed in to change notification settings

matthewlzb/superscan

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

SuperScan-UV

A high-performance, cross-platform, and feature-rich port scanner written in C, powered by libuv.

SuperScan-UV is an experimental project designed to explore high-performance network scanning using modern C and asynchronous I/O. It is built to be a fast, flexible, and powerful tool for network reconnaissance, capable of managing thousands of concurrent connections efficiently.

💡 Design & Acknowledgements

This is an experimental project created to implement a modern, high-performance port scanner in C. The feature set, command-line arguments, and overall user experience were heavily inspired by the excellent RustScan project. SuperScan-UV aims to serve as a C-language counterpart to RustScan's design philosophy, leveraging the power of libuv for its asynchronous core.


✨ Features

  • Asynchronous Core: Built on libuv, allowing for high-throughput, non-blocking I/O to manage thousands of concurrent connections with minimal resource usage.
  • Cross-Platform: Compiles and runs on both POSIX-compliant systems (Linux, macOS) and Windows.
  • Flexible Target Specification: Scan multiple targets at once, with support for:
    • Hostnames (example.com)
    • IPv4/IPv6 addresses (8.8.8.8, 2606:4700:4700::1111)
    • CIDR ranges (192.168.0.0/24)
    • IP ranges (10.0.0.1-10.0.0.100)
    • Comma-separated lists of any of the above.
  • Advanced Port Selection:
    • Scan specific ports and ranges (-p 80,443,1000-2000).
    • Scan the top 1000 most common ports (--top-ports).
    • Exclude specific ports from a scan (-e 8080).
  • Multi-Core Scaling: Automatically utilizes all CPU cores for scanning large target lists with multi-processing (--processes 0).
  • Advanced Scan Tuning:
    • Manually set concurrency (-b), timeout (-t), and file descriptor limits (-u).
    • Auto-Tuning (--auto-tune): Enable dynamic timeout adjustment and a TCP-like congestion window to automatically optimize for network conditions.
  • Service & Version Detection:
    • Banner grabbing to identify service versions (-sV).
    • UDP scanning with protocol-specific payloads to elicit responses (--udp).
  • Powerful Scripting Engine: Pipe scan results directly to other tools like nmap for further analysis.
    • superscan -a example.com -p 22,80 -- nmap -sV -A {{ip}} -p {{ports}}
  • Multiple Output Formats:
    • Human-readable (default).
    • Greppable format for easy parsing (-g).
    • CSV file output (--output-csv).

🛠️ Building

SuperScan-UV depends on libuv. You must have it installed to compile the project.

On Linux (Debian/Ubuntu)

# Install dependencies
sudo apt-get update
sudo apt-get install -y libuv1-dev build-essential

# Compile
gcc -O2 superscan.c -o superscan -luv

On macOS

# Install dependencies
brew install libuv

# Compile
gcc -O2 superscan.c -o superscan -luv

On Windows (with Mingw-w64)

You will need to download the pre-compiled libuv binaries or build it from source. Ensure uv.h is in your include path and uv.lib is in your library path.

gcc superscan.c -o superscan.exe -luv -lws2_32 -liphlpapi -lwsock32 -luserenv

On Windows (with Mingw-w64 static)

gcc superscan.c -o superscan.exe -static -luv -lws2_32 -liphlpapi -lwsock32 -luserenv -ldbghelp -lole32

On Windows (with VS)

# Compile using Developer Command Prompt for VS
cl.exe superscan.c /O2 /link /OUT:superscan.exe uv.lib ws2_32.lib Iphlpapi.lib Userenv.lib Bcrypt.lib

usage

Usage: superscan -a <targets> [options] [-- <script_command>]
<targets> can be a comma-separated list of hostnames, IPs, or CIDR ranges (IPv4 only).

Primary Options:
  -a, --addresses <targets>  The target(s) to scan.
  -x, --exclude <targets>    Exclude targets from the scan (IP, CIDR, host).
  -p <ports>               Ports to scan (e.g., 80,443,1000-2000).
  --top-ports              Scan the top 1000 most common ports.
  -e <ports>               Exclude ports from the scan (e.g., 80,443).

Scan Tuning:
  --random-scan            Randomize the order of ports scanned.
  -b <number>              Concurrency (default: 5192).
  -t <ms>                  Connect timeout (default: 1000).
  -u <number>              Set file descriptor limit (Unix-like only).
  --processes <number>     Enable multi-process mode (default: 1, 0=CPU cores).
  --auto-tune              Enable dynamic timeout and congestion control.
  -sV                      Enable banner grabbing.
  --udp                    Enable UDP scan mode.

Output:
  -g, --greppable          Output in a machine-readable format.
  --output-csv <path>      Save results to a CSV file.
  -h, --help               Show this help message.

Scripting Engine:
  -- <command>             Execute an external command after each scan.
                           Placeholders: {{ip}} and {{ports}}.
Example: superscan -a scanme.nmap.org,192.168.0.0/24 -p 22,80 -- nmap -sV -p {{ports}} {{ip}}

Basic Examples

Scan a single host for common web ports:

./superscan -a example.com -p 80,443,8000,8080,8443

Scan a whole subnet for the top 1000 TCP ports:

./superscan -a 192.168.1.0/24 --top-ports

Scan a list of hosts from a file (using xargs):

cat host_list.txt | xargs -I {} ./superscan -a {} -p 22,80

Advanced Examples

High-performance scan using all CPU cores and auto-tuning: This command scans a large IP range for all ports, automatically distributing the work across all available CPU cores and dynamically adjusting timeouts.

./superscan -a 10.0.0.0/16 -p 1-65535 --processes 0 --auto-tune

Banner grabbing with high concurrency:

./superscan -a example.com -p 1-1000 -b 2000 -sV

Piping results to Nmap for deep analysis: Find open ports with SuperScan quickly, then pass only the open ports to Nmap for OS detection, version scanning, and script execution.

./superscan -a scanme.nmap.org -p 1-1000 --top-ports -- \
  nmap -sV -sC -O -p {{ports}} {{ip}}

UDP Scan for common services:

./superscan -a 8.8.8.8 --udp -p 53,123,161

Save results to a CSV file:

./superscan -a 192.168.0.0/24 -p 21,22,25,80,443 --output-csv results.csv

About

SuperScan-UV is an experimental project designed to explore high-performance network scanning using modern C and asynchronous I/O. It is built to be a fast, flexible, and powerful tool for network reconnaissance, capable of managing thousands of concurrent connections efficiently.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages