havn
- ˈheɪvən
|| "HAY" + "vuhn"
- is a lightweight self-contained port scanning application written in Rust,
using asynchronous Tokio multithreading to deliver fast and reliable results.
With sensible defaults and configurable options, users are able customise the scanning process according to their needs.
It is designed and built to be compatible with multiple platforms, including Docker, and has a binary size of less than 1mb.
Published on crates.io, so if you have cargo installed, simply run
shell
cargo install havn
Published on Docker Hub and ghcr.io,
with images built for linux/amd64
, linux/arm64
, and linux/arm/v6
via Docker Hub
shell
docker run --rm -it mrjackwills/havn:latest #[options]
via ghcr.io
shell
docker run --rm -it ghcr.io/mrjackwills/havn:latest #[options]
❗Caution: To scan the Docker host itself, you must grant access by including the option:
shell
--network=host
See the pre-built binaries
or, download & install (x86_64 one liner)
shell
wget https://www.github.com/mrjackwills/havn/releases/latest/download/havn_linux_x86_64.tar.gz &&
tar xzvf havn_linux_x86_64.tar.gz havn &&
install -Dm 755 havn -t "${HOME}/.local/bin" &&
rm havn_linux_x86_64.tar.gz havn
or, for automatic platform selection, download, and installation (to $HOME/.local/bin
)
One should always verify script content before running in a shell
shell
curl https://raw.githubusercontent.com/mrjackwills/havn/main/install.sh | bash
shell
havn #[options]
Available command line arguments
| argument|result|
|--|--|
| [string]
| The address or IP to scan. [default: 127.0.0.1
] |
|-a
| Scan every port, from 1
to 65535
, conflicts with -p
|
|-c [number]
| How many concurrent request should be made. [default: 1000
] |
|-p [number / string]
| Inclusive port range to scan, accepts either a range: -300
, 101-200
, or a single port 80
, conflicts with -a
[default: -1000
] |
|-r [number]
| Retry attempts per port. [default: 1
] |
|-t [number]
| Timeout for each request in milliseconds. [default: 2000
] |
|-6
| Scan the IPv6 address instead of IPv4, [default: false
] |
```shell
havn github.com
havn -a -c 2048 -t 500 -r 0
havn www.google.com -p 10-600 -c 500 -t 3000
havn www.digitalocean.com -p -100 -t 1000 -6
havn www.bbc.com -p 443 -r 6 ```
A number of tests will open port 80, this may cause issues if the port is already open on your system
shell
cargo test -- --test-threads=1
shell
cargo build --release
shell
cross build --target aarch64-unknown-linux-musleabihf --release
shell
cross build --target arm-unknown-linux-musleabihf --release
edit ~/.cargo/config
[target.aarch64-unknown-linux-musl]
linker = "rust-lld"
shell
rustup target add aarch64-unknown-linux-musl
cargo build --target aarch64-unknown-linux-musl --release
edit ~/.cargo/config
[target.arm-unknown-linux-musleabihf]
linker = "arm-linux-gnueabihf-ld"
rust
sudo apt update && sudo apt install gcc-arm-linux-gnueabihf -y
rustup target add arm-unknown-linux-musleabihf
cargo build --target arm-unknown-linux-musleabihf --release
Untested on other platforms