StalkerMap
A comprehensive Rust library for building CLI network scanner applications with robust input validation, terminal interaction, and URL parsing capabilities.
Features
- For advanced users: see docs for dns::resolver::agnostic and dns::compressor::agnostic
Currently Available
(All feature versions)
- Input Sanitization & Validation - Type-safe input validation with composable filters
- Interactive Terminal Interface - User-friendly CLI input with validation loops
- URL Parsing - Comprehensive HTTP/HTTPS URL parsing with host validation
("std" feature)
- DNS Resolver — Blocking DNS queries supporting multiple record types (A, MX, TXT, SOA, PTR, WKS, etc.)
("tokio-dep" feature)
- DNS Resolver - Async DNS queries with support for multiple record types (A, MX, TXT, SOA, PTR, WKS, etc.)
- Asynchronous Scanner Engine -
- concurrent TCP scanning
- modular per-connection Actions
- real-time log streaming
- bounded concurrency
- idle detection & graceful shutdown
- customizable log formatter
- customizable actions
("Agnostic" feature)
- DNS message structure — With encoder helpers (RFC1035 compliant)
- DNS message compressor — For hostnames (RFC1035 compliant)
Planned Features
- Directory Enumeration - Web directory and file discovery
- Report Generation - Export scan results to various formats
Feature Variants
-
Agnostic version
- Only parsing, encoding/decoding of DNS messages and helpers.
- No executor or transport included — user chooses their own.
- Lightweight and easy to integrate.
- Includes access to low-level DNS structures and helpers.
-
Default (
std) version- Blocking TCP/UDP transport using
std::net. - Fully functional DNS resolver for blocking queries.
- Blocking TCP/UDP transport using
-
Tokio (
async) version- Replaces blocking transport with
tokio::netfor async TCP/UDP. - Supports non-blocking behaviors inspired by RFCs (TCP fallback, EDNS, retries, etc.). (Planned)
- Replaces blocking transport with
Quick Start
Add this to your Cargo.toml:
[]
= { = "0.1.50", = ["std"]}
= { = "0.1.50", = ["tokio-dep"]}
= { = "0.1.50", = false, = ["agnostic"]}
Usage Examples
Scanner Engine (tokio-dep)
use *;
use actions;
use UrlParser;
use StreamExt;
async
DNS Resolver Example (std)
use ;
let a_records = resolve_ipv4.unwrap;
let mx_records = resolve_mx.unwrap;
println!;
println!;
Basic Input & Range Validation
use ;
// Get validated user input with range checking
let threads = ask;
println!;
URL Parsing and Validation
use UrlParser;
// Parse and validate URLs
match new
Complex Input Validation
use ;
// Multiple validation rules
let choice = ask;
Complete Interactive URL Input Example
This example demonstrates the complete workflow of getting user input, validating it, and parsing URLs - perfect for network scanner applications:
use ;
"Agnostic" Only Feature DNS Compressor Example
Users can either build a DNS message manually using their own structures
or use the DnsMessage struct provided by this library. Example with a raw buffer:
use HashMap;
use MessageCompressor;
let mut message = Vecnew;
let mut pointer_map = new;
// Compress a domain name
compress.unwrap;
// Reusing the same domain (or suffix) inserts a pointer instead of repeating bytes
compress.unwrap;
"Agnostic" Only Feature DNS Message Query Builder Example
use ;
// Build a query for example.com A record
let msg = new_query;
// Encode into raw bytes, ready to send via UDP/TCP
let bytes = msg.encode_query;
assert!; // includes header + question
Architecture
The library is designed with modularity and composability in mind:
utils- Core utilities for input handling and URL parsingdns- DNS resolution and query utilitiesscanner- Port scanning and network discoveryreporter- Report generation and export (planned)
Supported URL Formats
- HTTP/HTTPS schemes
- IPv4 and IPv6 addresses
- DNS hostnames
- Custom ports
- Paths and query strings
Error Handling
All operations return Result<T, E> types for safe error handling:
use ;
match new
CLI Application
This repository also includes a CLI application demonstrating the library usage:
# Clone and run
Contributing
License
This project is licensed under the MIT License - see the LICENSE file for details.
Changelog
See CHANGELOG.md for a list of changes and version history.