Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 31 additions & 24 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[package]
name = "nrev"
version = "0.4.0"
edition = "2021"
authors = ["shellrow <shellrow@fortnium.com>"]
description = "Simple and Fast Network Revealer/Mapper."
version = "0.5.0"
edition = "2024"
authors = ["shellrow <shellrow@foctal.com>"]
description = "Cross-platform Network Mapper"
repository = "https://github.com/shellrow/nrev"
homepage = "https://github.com/shellrow/nrev"
documentation = "https://github.com/shellrow/nrev"
Expand All @@ -14,34 +14,41 @@ license = "MIT"

[dependencies]
anyhow = { version = "1" }
tracing = { version = "0.1" }
tracing-subscriber = { version = "0.3", features = ["time", "chrono"] }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
netdev = { version = "0.34", features = ["serde"] }
nex = { version = "0.19.1", features = ["serde"] }
bytes = "1"
netdev = { version = "0.37", features = ["serde"] }
nex = { version = "0.23", features = ["serde"] }
futures = {version = "0.3", features = ["executor", "thread-pool"]}
rustls = { version = "0.23", default-features = false, features = ["ring", "std"] }
rustls-native-certs = "0.7"
rustls-pemfile = "2.1"
rustls-pki-types = "1.8"
tokio = { version = "1" }
tokio-rustls = { version = "0.26", default-features = false, features = ["ring"]}
hickory-resolver = { version = "0.24" }
x509-parser = "0.17"
tokio = { version = "1", features = ["macros", "rt-multi-thread", "time", "net", "io-util", "sync"] }
tokio-rustls = { version = "0.26", default-features = false, features = ["ring"] }
hickory-proto = "0.25"
hickory-resolver = { version = "0.25" }
chrono = { version = "0.4", features = ["serde"] }
uuid = { version = "1.16", features = ["v4","v5","fast-rng","macro-diagnostics"] }
bincode = "1.3"
phf = { version = "0.11", features = ["macros"] }
uuid = { version = "1.3", features = ["v4","v5","fast-rng","macro-diagnostics"] }
rand = "0.8"
clap = { version = "4.5", features = ["cargo"] }
indicatif = "0.17"
inquire = "0.7"
clap = { version = "4.5", features = ["derive", "cargo"] }
indicatif = { version = "0.18" }
tracing-indicatif = "0.3"
inquire = "0.6"
ipnet = "2.11"
num_cpus = "1.16"
num_cpus = "1.17"
termtree = "0.5"

[target.'cfg(windows)'.dependencies]
winreg = "0.55"

# The profile that 'cargo dist' will build with
[profile.dist]
inherits = "release"
lto = "thin"
ndb-oui = { version = "0.3", features = ["bundled"] }
ndb-tcp-service = { version = "0.3", features = ["bundled"] }
ndb-udp-service = { version = "0.3", features = ["bundled"] }
home = "0.5"
base64 = "0.22"
regex = "1.11"
fastrand = "2.3"
quinn = "0.11"
h3 = "0.0.8"
h3-quinn = "0.0.10"
http = "1.3"
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2024 shellrow
Copyright (c) 2025 shellrow

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
90 changes: 43 additions & 47 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
[crates-url]: https://crates.io/crates/nrev

# nrev [![Crates.io][crates-badge]][crates-url]
Simple and Fast Network Revealer/Mapper. Written in Rust.
Designed to be used in network mapping, probe, and security tests.
Cross-platform Network Mapper.
Designed to be used in network scan, mapping and probes.

## Features
- Port Scan
Expand All @@ -12,7 +12,6 @@ Designed to be used in network mapping, probe, and security tests.
- Traceroute
- Neighbor Discovery
- Subdomain scan
- Show Network Interfaces

## Supported platforms
- Linux
Expand Down Expand Up @@ -47,64 +46,60 @@ cargo binstall nrev
```

## Basic Usage
### Default Port Scan
To scan the default 1000 ports on a target, simply specify the target
### Port Scan Example
To scan the default 1000 ports on a target, simply specify the target (-s for service detection, -o for OS detection)
```
nrev --target scanme.nmap.org
nrev port yourcorpone.com -s -o
nrev port 192.168.1.10 -s -o
```

Sub-commands and Options
### Sub-commands and Options
```
Usage: nrev [OPTIONS] [COMMAND]
Usage: nrev [OPTIONS] <COMMAND>

Commands:
port Scan port. nrev port --help for more information
host Scan host in specified network or host-list. nrev host --help for more information
ping Ping to specified host. nrev ping --help for more information
trace Traceroute to specified host. nrev trace --help for more information
subdomain Find subdomains. nrev subdomain --help for more information
nei Resolve IP address to MAC address
interfaces Show network interfaces
interface Show default network interface
check Check dependencies (Windows only)
help Print this message or the help of the given subcommand(s)
port Scan ports on the target(s) (TCP/QUIC)
host Discover alive hosts (ICMP/UDP/TCP etc.)
ping Simple ping (ICMP/UDP/TCP)
trace Traceroute (UDP)
nei Neighbor discovery (ARP/NDP)
domain Subdomain enumeration
interface Show network interface(s)
help Print this message or the help of the given subcommand(s)

Options:
-t, --target <target> Specify the target host. IP address or Hostname
-i, --interface <interface_name> Specify the network interface
--noping Disable initial ping
-F, --full Scan all ports (1-65535)
-j, --json Displays results in JSON format.
-o, --save <file_path> Save scan result in JSON format - Example: -o result.json
-h, --help Print help
-V, --version Print version
--log-level <LOG_LEVEL> Global log level [default: info] [possible values: error, warn, info, debug, trace]
--log-file Log to file (in addition to stdout)
--log-file-path <FILE> Log file path (default: ~/.nrev/logs/nrev.log)
--quiet Suppress all log output (only errors are shown)
-o, --output <FILE> Save output to file (JSON format)
--no-stdout Suppress stdout console output (only save to file if -o is set)
-h, --help Print help
-V, --version Print version
```

See `nrev <sub-command> -h` for more detail.

## Examples
### Port scan
Scan default 1000 ports
Scan default 1000 ports and enable service and OS detection for open ports
```
nrev port scanme.nmap.org
nrev port yourcorpone.com -s -o
```

Specify the ports
```
nrev port scanme.nmap.org --ports 22,80,443,5000,8080
nrev port yourcorpone.com --ports 22,80,443,5000,8080
```

Specify the range
```
nrev port scanme.nmap.org --range 20-100
```

Scan well-known ports
```
nrev port scanme.nmap.org --wellknown
nrev port yourcorpone.com --ports 20-100
```

#### Settings
By default, nrev determines the waiting time until packet reception (before concluding the scan task) based on the results of the initial PING.
The initial PING is executed in the order of ICMP Ping, UDP Ping, TCP Ping (on port 80), and if successful, proceeds to the next scan task.
By default, nrev determines the connection timeout or waiting time until packet reception (before concluding the scan task) based on the results of the initial PING.
The initial PING is executed in the order of ICMP Ping, UDP Ping, TCP Ping, and if successful, proceeds to the next scan task.
If all PING attempts fail, nrev exits before executing the scan. This step can be skipped by setting the `--noping` flag.
For other settings, please refer to `nrev port -h` for details.

Expand All @@ -113,45 +108,46 @@ ICMP Host scan
```
nrev host 192.168.1.0/24
```

```
nrev host <path-to-host-list>
nrev host /path/to/list/hostlist.txt
```

TCP Host scan
```
nrev host 192.168.1.0/24 -P TCP --port 80
nrev host 192.168.1.0/24 --proto tcp --ports 80
```

### Ping
Default ICMP Ping
```
nrev ping 1.1.1.1
nrev ping 1.1.1.1 -c 4
```

UDP Ping
```
nrev ping 1.1.1.1 -P UDP
nrev ping 1.1.1.1 --proto udp
```

TCP Ping
```
nrev ping 1.1.1.1:443 -P TCP
nrev ping 1.1.1.1 --proto tcp --port 80
```

### Traceroute
TCP Ping
UDP Trace
```
nrev trace 8.8.8.8
```

You can specify the interval in milliseconds for faster trace.
```
nrev trace 8.8.8.8 --rate 500
nrev trace 8.8.8.8 --interval-ms 500
```

### Subdomain scan
```
nrev subdomain google.com
nrev subdomain yourcorpone.com --wordlist /path/to/wordlist/top-1000.txt
```

### Neighbor (ARP/NDP)
Expand All @@ -161,7 +157,7 @@ nrev nei 192.168.1.1

### Specify the network interface
```
nrev -i tun0 port 10.10.11.14
nrev port 10.10.11.14 --interface tun0
```

## Privileges
Expand Down Expand Up @@ -227,4 +223,4 @@ sudo chmod-bpf install
- Place the Packet.lib file from the [Npcap SDK](https://npcap.com/#download) 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 <SDK>/Lib/x64/Packet.lib.
- For the 32-bit toolchain, the Packet.lib is located in <SDK>/Lib/Packet.lib.
- For the 32-bit toolchain, the Packet.lib is located in <SDK>/Lib/Packet.lib.
Binary file removed resources/ndb-default-ports.bin
Binary file not shown.
Binary file removed resources/ndb-http-ports.bin
Binary file not shown.
Binary file removed resources/ndb-https-ports.bin
Binary file not shown.
Binary file removed resources/ndb-os-family-fingerprint.bin
Binary file not shown.
Binary file removed resources/ndb-os-family.bin
Binary file not shown.
Binary file removed resources/ndb-os-ttl.bin
Binary file not shown.
Binary file removed resources/ndb-oui-vm.bin
Binary file not shown.
Binary file removed resources/ndb-oui.bin
Binary file not shown.
Binary file removed resources/ndb-subdomain.bin
Binary file not shown.
Binary file removed resources/ndb-tcp-service.bin
Binary file not shown.
Binary file removed resources/ndb-wellknown-ports.bin
Binary file not shown.
Loading