{"id":13578890,"url":"https://github.com/mrjackwills/havn","last_synced_at":"2025-04-06T03:08:28.230Z","repository":{"id":166966372,"uuid":"642515570","full_name":"mrjackwills/havn","owner":"mrjackwills","description":"A fast configurable port scanner with reasonable defaults","archived":false,"fork":false,"pushed_at":"2024-04-12T12:07:25.000Z","size":1690,"stargazers_count":135,"open_issues_count":3,"forks_count":3,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-04-12T19:38:49.930Z","etag":null,"topics":["async","docker","port","port-scanner","rust","scanner","tokio"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mrjackwills.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-05-18T18:41:17.000Z","updated_at":"2024-04-15T13:35:49.905Z","dependencies_parsed_at":"2024-01-16T20:29:12.564Z","dependency_job_id":"3564a99e-a42b-4720-baad-c7ed53e08888","html_url":"https://github.com/mrjackwills/havn","commit_stats":null,"previous_names":["mrjackwills/havn"],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrjackwills%2Fhavn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrjackwills%2Fhavn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrjackwills%2Fhavn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrjackwills%2Fhavn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mrjackwills","download_url":"https://codeload.github.com/mrjackwills/havn/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247427006,"owners_count":20937201,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["async","docker","port","port-scanner","rust","scanner","tokio"],"created_at":"2024-08-01T15:01:34.782Z","updated_at":"2025-04-06T03:08:28.200Z","avatar_url":"https://github.com/mrjackwills.png","language":"Rust","funding_links":[],"categories":["Rust","\u003ca name=\"networking\"\u003e\u003c/a\u003eNetworking"],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\r\n\t\u003cimg src='./.github/logo.svg' width='125px' /\u003e\r\n\t\u003ch1 align=\"center\"\u003ehavn\u003c/h1\u003e\r\n\t\u003cdiv align=\"center\"\u003eA fast configurable port scanner with reasonable defaults\u003c/div\u003e\r\n\u003c/p\u003e\r\n\r\n\u003cp align=\"center\"\u003e\r\n\t\u003ca href=\"https://raw.githubusercontent.com/mrjackwills/havn/main/.github/screen.webp\" target='_blank' rel='noopener noreferrer'\u003e\r\n\t\t\u003cimg src='.github/screen.webp' width='450px'/\u003e\r\n\t\u003c/a\u003e\r\n\u003c/p\u003e\r\n\r\n## Description\r\n`havn` - `ˈheɪvən` || `\"HAY\" + \"vuhn\"` - is a lightweight self-contained port scanning application written in \u003ca href='https://www.rust-lang.org/' target='_blank' rel='noopener noreferrer'\u003eRust\u003c/a\u003e,\r\nusing asynchronous \u003ca href='https://github.com/tokio-rs/tokio' target='_blank' rel='noopener noreferrer'\u003eTokio\u003c/a\u003e multithreading to deliver fast and reliable results.\r\nWith sensible defaults and configurable options, users are able customise the scanning process according to their needs.\r\nIt is designed and built to be compatible with multiple platforms, including Docker, and has a binary size of less than 1mb.\r\n\r\n\r\n## Download \u0026 install\r\n\r\n### Cargo\r\nPublished on \u003ca href='https://www.crates.io/crates/havn' target='_blank' rel='noopener noreferrer'\u003ecrates.io\u003c/a\u003e, so if you have cargo installed, simply run\r\n\r\n```shell\r\ncargo install havn\r\n```\r\n\r\n### Arch Linux\r\n\r\n`havn` is available in the [official repositories](https://archlinux.org/packages/extra/x86_64/havn). You can install it using:\r\n\r\n```shell\r\npacman -S havn\r\n```\r\n\r\n### Docker\r\n\r\nPublished on \u003ca href='https://hub.docker.com/r/mrjackwills/havn' target='_blank' rel='noopener noreferrer'\u003eDocker Hub\u003c/a\u003e and \u003ca href='https://ghcr.io/mrjackwills/havn' target='_blank' rel='noopener noreferrer'\u003eghcr.io\u003c/a\u003e,\r\nwith images built for `linux/amd64`, `linux/arm64`, and `linux/arm/v6`\r\n\r\n**via Docker Hub**\r\n```shell\r\ndocker run --rm -it mrjackwills/havn:latest #[options]\r\n```\r\n\r\n**via ghcr.io**\r\n\r\n```shell\r\ndocker run --rm -it ghcr.io/mrjackwills/havn:latest #[options]\r\n```\r\n\r\n❗Caution: To scan the Docker host itself, you must grant access by including the option:\r\n\r\n```shell\r\n--network=host\r\n```\r\n\r\n### Pre-Built\r\nSee the \u003ca href=\"https://github.com/mrjackwills/havn/releases/latest\" target='_blank' rel='noopener noreferrer'\u003epre-built binaries\u003c/a\u003e\r\n\r\nor, download \u0026 install (x86_64 one liner)\r\n\r\n```shell\r\nwget https://www.github.com/mrjackwills/havn/releases/latest/download/havn_linux_x86_64.tar.gz \u0026\u0026\r\ntar xzvf havn_linux_x86_64.tar.gz havn \u0026\u0026\r\ninstall -Dm 755 havn -t \"${HOME}/.local/bin\" \u0026\u0026\r\nrm havn_linux_x86_64.tar.gz havn\r\n```\r\n\r\nor, for automatic platform selection, download, and installation (to `$HOME/.local/bin`)\r\n\r\n*One should always verify \u003ca href='https://raw.githubusercontent.com/mrjackwills/havn/main/install.sh' target='_blank' rel='noopener noreferrer'\u003escript content\u003c/a\u003e before running in a shell*\r\n\r\n```shell\r\ncurl https://raw.githubusercontent.com/mrjackwills/havn/main/install.sh | bash\r\n```\r\n## Run\r\n\r\n```shell\r\nhavn #[options]\r\n```\r\nAvailable command line arguments\r\n| argument|result|\r\n|--|--|\r\n| ```[string]```\t\t\t| The address or IP to scan. [default: `127.0.0.1`] |\r\n|```-a```\t\t\t\t\t| Scan every port, from `1` to `65535`, conflicts with `-p` |\r\n|```-c [number]```\t\t\t| How many concurrent request should be made. [default: `1000`] |\r\n|```-m```\t\t\t\t\t| Monochrome mode - won't colourize the output [default: `false`] |\r\n|```-p [number / string]```\t| Inclusive port range to scan, accepts either a range: `-300`, `101-200`, or a single port `80`, conflicts with `-a` [default: `-1000`] |\r\n|```-r [number]```\t\t\t| Retry attempts per port. [default: `1`] |\r\n|```-t [number]```\t\t\t| Timeout for each request in milliseconds. [default: `2000`] |\r\n|```-6```\t\t\t\t\t| Scan the IPv6 address instead of IPv4, [default: `false`] |\r\n\r\n### Examples\r\n\r\n```shell\r\n# Scan github.com using the default settings\r\nhavn github.com\r\n\r\n# Scan default address [127.0.0.1], all ports [1-65535],\r\n# 2048 concurrent requests, 500ms timeout, 0 retries, IPv4\r\nhavn -a -c 2048 -t 500 -r 0\r\n\r\n# Scan www.google.com, ports 10-600,\r\n# 500 concurrent requests, 3000ms timeout, default retries [1], IPv4\r\nhavn www.google.com -p 10-600 -c 500 -t 3000 \r\n\r\n# Scan www.digitalocean.com, ports 1-100\r\n# default concurrent requests[1000], 1000ms timeout, and use IPv6 address\r\nhavn www.digitalocean.com -p -100 -t 1000 -6\r\n\r\n# Scan www.bbc.com, port 443 only\r\n# default concurrent requests[1000], default timeout[2000ms], 6 retries, IPv4\r\nhavn www.bbc.com -p 443 -r 6\r\n```\r\n\r\n### Todo\r\n\r\n- [ ] Scan UDP ports, currently only TCP\r\n- [ ] allow multiple addresses/IPs to be scanned\r\n- [ ] monitor response times to automatically modify request settings\r\n- [ ] configurable option to disable second-pass scan\r\n- [ ] debug option to display more verbose output\r\n- [ ] improve windows performance\r\n- [ ] publish to npm\r\n\r\n\r\n## Tests\r\n\r\nA number of tests will open port 80, this may cause issues if the port is already open on your system\r\n\r\n```shell\r\ncargo test -- --test-threads=1\r\n```\r\n\r\n## Build step\r\n\r\n### x86_64\r\n\r\n```shell\r\ncargo build --release\r\n```\r\n\r\n### Cross platform\r\n### Using Docker\r\nrequires \u003ca href='https://www.docker.com/' target='_blank' rel='noopener noreferrer'\u003eDocker\u003c/a\u003e \u0026 \u003ca href='https://github.com/cross-rs/cross' target='_blank' rel='noopener noreferrer'\u003ecross-rs\u003c/a\u003e\r\n\r\n\r\n#### 64bit arm (pi 4, pi zero w 2)\r\n\r\n```shell\r\ncross build --target aarch64-unknown-linux-musl --release\r\n```\r\n\r\n#### 32bit pi (pi zero w)\r\n\r\n```shell\r\ncross build --target arm-unknown-linux-musleabihf --release\r\n```\r\n\r\n#### Windows x86_64\r\n\r\n```shell\r\ncross build --target x86_64-pc-windows-gnu --release\r\n```\r\n\r\n### Without Docker\r\n#### 64bit arm (pi 4, pi zero w 2)\r\nedit `~/.cargo/config`\r\n```\r\n[target.aarch64-unknown-linux-musl]\r\nlinker = \"rust-lld\"\r\n```\r\n\r\n```shell\r\nrustup target add aarch64-unknown-linux-musl\r\ncargo build --target aarch64-unknown-linux-musl --release\r\n```\r\n#### 32bit pi (pi zero w)\r\n\r\nedit `~/.cargo/config`\r\n```\r\n[target.arm-unknown-linux-musleabihf]\r\nlinker = \"arm-linux-gnueabihf-ld\"\r\n```\r\n\r\n```shell\r\nsudo apt update \u0026\u0026 sudo apt install gcc-arm-linux-gnueabihf -y\r\nrustup target add arm-unknown-linux-musleabihf\r\ncargo build --target arm-unknown-linux-musleabihf --release\r\n```\r\n\r\n#### Windows (build on linux)\r\n\r\nedit `~/.cargo/config`\r\n```\r\n[target.x86_64-pc-windows-gnu]\r\nlinker = \"x86_64-w64-mingw32-gcc\"\r\nar = \"x86_64-w64-mingw32-gcc-ar\"\r\n```\r\n\r\n```shell\r\nsudo apt update \u0026\u0026 sudo apt install mingw-w64\r\nrustup target add x86_64-pc-windows-gnu\r\ncargo build --target x86_64-pc-windows-gnu --release\r\n```\r\n\r\n**Untested on other platforms**","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrjackwills%2Fhavn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmrjackwills%2Fhavn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrjackwills%2Fhavn/lists"}