gscan

Crates.iogscan
lib.rsgscan
version0.1.8
created_at2026-01-08 13:01:13.465689+00
updated_at2026-01-09 23:35:32.336456+00
descriptionHigh-performance async network scanning library
homepage
repositoryhttps://github.com/evengarli/gscan
max_upload_size
id2030171
size13,997
Even Garli (evengarli)

documentation

README

gscan

Crates.io
License: MIT

gscan is a lightweight, async-powered network port scanning library written in Rust.

It uses an internal asynchronous engine (powered by Tokio) to perform fast TCP port scans, while exposing a simple, blocking API suitable for small tools, scripts, and experiments.


Features

  • Asynchronous core: Uses Tokio to scan many ports concurrently
  • Simple API: No async, await, or #[tokio::main] required by the caller
  • Bounded concurrency: Prevents resource exhaustion during large scans
  • Timeout-based scanning: Avoids hanging connections
  • Structured results: Returns parsed IP addresses and sorted port lists

Installation

Add this to your Cargo.toml:

[dependencies]
gscan = "0.1.5"

Example: Scanning a Local Range

The library exposes a single public scanning function:

pub fn scan(ip: &str, port_start: u16, port_end: u16) -> ScanResult

ScanResult Structure

pub struct ScanResult {
    pub ip: IpAddr,
    pub ports: Vec<u16>,
}

Example: Scanning a Local Port Range

use gscan;

fn main() {
    println!("Starting scan...");

    let result = gscan::scan("127.0.0.1", 1, 1000);

    println!("Scan complete for IP: {}", result.ip);
    println!("Open ports found: {:?}", result.ports);
}

License

Distributed under the MIT License.


Commit count: 0

cargo fmt