1073 Commits
Author SHA1 Message Date
QianEricandQianEric b46f982b9b scripts: report a missing script program before scanning (#965)
Scripts are run through `sh -c`, so when the program a `call_format`
starts with is missing, the only feedback is whatever the shell prints
once the scan has already finished:

    Open 127.0.0.1:18080
    [~] Starting Script(s)
    [!] Error No such file or directory (os error 2)

which neither names the program nor arrives before a long scan has been
wasted.

Check the first word of every selected script format against PATH while
the scripts are initialised, and fail there with the program named. Name
resolution follows what the shell would do: PATH entries in order, plus
PATHEXT on Windows.

Formats that do not start with a bare program name are left alone, since
their first word is not something PATH can answer for:

- `FOO=bar cmd ...` (leading assignment)
- `/opt/custom/nmap ...` (explicit path)
- `{{script}} ...` (placeholder filled in at run time)

With nmap absent, on the same scan:

    before: scans, then "[!] Error No such file or directory (os error 2)"
    after:  "[!] Initiating scripts failed!
             The script `default` runs `nmap`, which is not installed or
             not in PATH. Install it, or skip scripts with `--scripts none`."

With nmap present the scan and the script phase run as before.

Implemented with std/target-specific helpers rather than a new
dependency: `which` pulls in a newer windows-sys and rewrites ~110 lines
of Cargo.lock for a 15-line check.

Refs #691

Co-authored-by: QianEric <[email protected]>
2026-11-04 09:29:26 +00:00
Rudy Mizrahi Celekli 521f8bf720 fix(config): accept documented lowercase script modes (#964) 2026-11-04 09:29:20 +00:00
Rudy Mizrahi Celekli ab1e69f1af fix(scripts): preserve literal hashes in metadata (#962) 2026-11-04 09:29:08 +00:00
demrom 29d85a77df fix(main): print the no-open-ports hint once, only when nothing was found (#960)
A subnet sweep for one port printed the batch-size hint for every host without that port. When any host answered with an open port, or a closed one under --closed, replies got through at this batch size and timeout, so batch size and timeout are unlikely to be the cause and the hint is skipped. When nothing was found it is printed once for all targets.

Fixes #795
2026-11-04 09:29:01 +00:00
dependabot[bot] a79a471111 build(deps): bump actions-rust-lang/setup-rust-toolchain (#953)
Bumps [actions-rust-lang/setup-rust-toolchain](https://github.com/actions-rust-lang/setup-rust-toolchain) from 1.17.0 to 2.0.0.
- [Release notes](https://github.com/actions-rust-lang/setup-rust-toolchain/releases)
- [Changelog](https://github.com/actions-rust-lang/setup-rust-toolchain/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions-rust-lang/setup-rust-toolchain/compare/166cdcfd11aee3cb47222f9ddb555ce30ddb9659...ecabd13d1c56bd1345c230e542e9144811ad706f)

---
updated-dependencies:
- dependency-name: actions-rust-lang/setup-rust-toolchain
  dependency-version: 2.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-11-04 09:28:55 +00:00
dependabot[bot] f4192fd367 build(deps): bump windows-sys from 0.59.0 to 0.61.2 (#956)
Bumps [windows-sys](https://github.com/microsoft/windows-rs) from 0.59.0 to 0.61.2.
- [Release notes](https://github.com/microsoft/windows-rs/releases)
- [Commits](https://github.com/microsoft/windows-rs/commits)

---
updated-dependencies:
- dependency-name: windows-sys
  dependency-version: 0.61.2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-11-04 09:28:48 +00:00
dependabot[bot] e9a4972e1f build(deps): bump toml from 1.1.6+spec-1.1.0 to 1.1.8+spec-1.1.0 (#957)
Bumps [toml](https://github.com/toml-rs/toml) from 1.1.6+spec-1.1.0 to 1.1.8+spec-1.1.0.
- [Commits](https://github.com/toml-rs/toml/compare/toml-v1.1.6...toml-v1.1.8)

---
updated-dependencies:
- dependency-name: toml
  dependency-version: 1.1.8+spec-1.1.0
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-11-04 09:28:42 +00:00
dependabot[bot] 2f81acf45b build(deps): bump libc from 0.2.181 to 0.2.191 (#959)
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.181 to 0.2.191.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Changelog](https://github.com/rust-lang/libc/blob/0.2.191/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.181...0.2.191)

---
updated-dependencies:
- dependency-name: libc
  dependency-version: 0.2.191
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-11-04 09:28:35 +00:00
dependabot[bot] 8f8a51adf2 build(deps): bump log from 0.4.34 to 0.4.35 (#966)
Bumps [log](https://github.com/rust-lang/log) from 0.4.34 to 0.4.35.
- [Release notes](https://github.com/rust-lang/log/releases)
- [Changelog](https://github.com/rust-lang/log/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/log/compare/0.4.34...v0.4.35)

---
updated-dependencies:
- dependency-name: log
  dependency-version: 0.4.35
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-11-04 09:28:28 +00:00
Autumn (Bee)andbee-san 1dda392d1c ci: Dependabot monthly instead of daily (cost) (#958)
Co-authored-by: bee-san <[email protected]>
2026-11-04 09:28:21 +00:00
Autumn (Bee)andAutumn Skerritt 937903340a Avoid formatting discarded scan errors (#950)
* perf(scanner): defer TCP error diagnostics

* bench(scanner): check open-only TCP and UDP paths

* fix(scanner): Import HashSet in tests after main merge

---------

Co-authored-by: Autumn Skerritt <[email protected]>
2026-10-05 19:17:26 +09:00
dependabot[bot] f33752812c build(deps): bump tokio from 1.44.2 to 1.50.0 (#952)
Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.44.2 to 1.50.0.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.44.2...tokio-1.50.0)

---
updated-dependencies:
- dependency-name: tokio
  dependency-version: 1.50.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-10-05 18:39:29 +09:00
Autumn (Bee) 9b48f03ecd fix(config): let command-line options override the config file (#947)
`Opts::merge` copied every value present in the config file over the
parsed command line, so e.g. `-r 8600-8650` was silently replaced by the
config's `range` and the requested ports were never scanned (`-p` only
survived because `PortStrategy::pick` prefers `ports` over `range`).
The same happened to `-a`, `-b`, `-t`, `--tries`, `-g`, `--scripts`,
`--scan-order`, the trailing nmap command and every other merged option.
This contradicts the documented behaviour: "Any arguments passed
directly to the binary will override the default provided in this
config file".

`Opts::parse()` cannot tell a value typed by the user from a clap
default, so `Opts::read()` now parses through `ArgMatches` and records
the ids of the arguments whose `value_source` is `CommandLine` in a new
skipped `cli_args` field. `merge_required`/`merge_optional` leave those
fields alone; options not given on the command line are still filled in
from the config file. `--top` and `--no-config` behave as before.

Add pure parsing tests (no sockets) covering both directions.

Fixes #722
2026-10-03 06:41:48 +01:00
Autumn (Bee) 32d7d2cb17 Defer fallback DNS initialization for literal targets (#949)
* Initialize the fallback DNS resolver only when needed

* Record lazy DNS startup benchmark results

* docs(perf): remeasure lazy DNS against merged Tokio master

* docs(perf): verify lazy DNS on current master
2026-10-02 20:45:12 +09:00
Autumn (Bee) 67c08a3310 Speed up port exclusions and avoid redundant port copies (#954)
* test(scanner): preserve port filtering order and boundaries

* perf(scanner): reuse port lists and index large exclusions

* perf(scanner): use bitmap for dense exclusions

* bench(scanner): document production port preparation speedups

* ci(bench): diagnose repeated macOS listener misses

* ci(bench): capture socket errors immediately after listener misses

* perf(scanner): keep bitmap storage out of repeated async polls

* ci(bench): provision macOS TCP memory for repeated scans
2026-10-02 20:14:56 +09:00
Autumn (Bee)andVrtgs b7119f7f3e Port to tokio (supersedes #856, closes #944) (#951)
* refactor(scanner): run the scanner on tokio instead of async-std

async-std is discontinued upstream (RUSTSEC-2025-0052). tokio is already in
the dependency tree through hickory-resolver, so switching adds no crate and
removes 28 from Cargo.lock (async-std, async-io, polling,
async-global-executor, blocking, futures-executor, ...).

This is a like-for-like port. The scanner keeps its architecture and the
library API keeps its signatures:

- a single `FuturesUnordered` keeps at most `batch_size` sockets in flight
  from one future; nothing is spawned per socket;
- connect and UDP receive timeouts use `tokio::time::timeout` and report the
  same `TimedOut` error that async-std's `io::timeout` did;
- open TCP sockets are still shut down in both directions before they are
  closed (through `into_std()`, because tokio only has a write-side shutdown);
- `--interval` sleeps with `tokio::time::sleep`.

The binary runs the scan on a current-thread runtime that exists only for
the scan. Address resolution (blocking DNS lookups and file reads) runs
before the runtime is created and scripts run after it is dropped, so neither
can stall the scan, and hickory's internal runtime is never nested in ours.

Library users now have to poll the scan futures from a tokio runtime with the
I/O and time drivers enabled. The crate and `Scanner` docs say so, and the
crate example shows how.

Builds on the earlier port in #856 by @vrtgs.

Co-authored-by: Vrtgs <[email protected]>

* perf(scanner): opt the scan out of tokio's cooperative budget

The scan polls every in-flight socket from one future through a
`FuturesUnordered`. tokio's cooperative scheduling gives that future a budget
of 128 units per poll. Once it is spent, every tokio resource returns
`Pending` and defers its wake-up, but `FuturesUnordered` still polls all the
other ready sockets in that same poll. When thousands of connections finish
together (a burst of refusals, or a batch of timeouts firing at once), the
scan keeps re-polling sockets only to park them again, roughly 128 at a time.

async-std had no budget. `tokio::task::unconstrained` restores that
behaviour: one poll handles every ready socket. The future still returns
`Pending`, and so lets the runtime poll I/O and timers, as soon as no socket
is ready.

* perf(scanner): send UDP probes before registering the socket with tokio

tokio's socket I/O is readiness based: `UdpSocket::send` and `recv` first
wait until the reactor has reported the socket ready and only then make the
system call. async-io, which async-std used, made the call first and only
waited after `WouldBlock`.

With a straight port, every UDP probe therefore made an extra trip through
the event loop before its send. Probes to closed ports on the local host
also no longer finished in their first poll: there the ICMP "port
unreachable" is usually queued before `send` returns, so async-std's first
`recv` already saw the refusal.

Bind a non-blocking std socket instead, send the probe and try the first
receive straight away. The socket is only handed to tokio, and registered
with its reactor, when there is really something to wait for. Errors and
timeouts are reported exactly as before.

* ci: add an opt-in scan benchmark comparing a change with its base

The test suite deliberately never opens sockets (see #942), so nothing in CI
showed whether a change to the scanner makes RustScan slower, hungrier or
wrong. The tokio port (#944) needs exactly that evidence.

The "Scan benchmark" workflow runs for pull requests that touch the scanner,
its runtime or its dependencies, and on demand. It builds the change and its
base in release mode on Linux x64/arm64, macOS and Windows runners. It then
runs .github/scan-benchmark/scan_bench.py, which:

- opens 315 TCP listeners and 32 UDP responders on 127.0.0.1 inside the
  runner. Nothing outside the runner is scanned. Ports stay out of the
  ephemeral range, so a scan can never connect a socket to itself;
- scans them with both builds, alternating the build order between runs:
  full TCP sweeps with batch sizes 500/4500/10000, 8 loopback hosts, one
  port, a UDP sweep, and on Linux ports that iptables drops (filtered TCP and
  UDP, and a mixed sweep), so timeouts are measured too;
- fails unless every run finds every listener and no build reports ports the
  base never found, or misses ports the base always found;
- reports medians of throughput (from RustScan's own scan timer), wall time,
  time to the first open port, peak RSS, CPU time, and sampled peak
  descriptors and threads. The table goes to the job summary, the raw data
  to an artifact;
- fails if the change's median throughput or wall time is more than 15%
  worse, or its peak RSS more than 25% worse, in any scenario.

contributing.md documents the workflow as the place where scanning is
measured, next to the rule that tests must not scan.

* ci(scan-benchmark): temporarily compare the port's intermediate builds (to be reverted)

* Revert "ci(scan-benchmark): temporarily compare the port's intermediate builds (to be reverted)"

This reverts commit 30ac107c55.

* fix(scanner): let the runtime poll I/O while a batch is started

The scan drives every socket from one future on a current-thread runtime,
so the runtime only polls for I/O and fires timers between two polls of
that future. A poll only ended once no socket was ready, which could take
a long time:

- starting a whole batch at once: 8,191 sockets took longer than a 500 ms
  timeout on the Windows runner, so connections that had succeeded during
  the fill were only seen after their timers fired. The benchmark found no
  open port at all with `-b 10000 -t 500` there;
- UDP probes to closed ports on the local host finish straight away, so a
  whole sweep ran in one poll, and the replies from open ports waited until
  the end: the first open UDP port was reported 2.6x later than with
  async-std.

`scan_sockets` now starts and finishes sockets in rounds of at most 128
(`WORK_PER_TURN`, both counted together) and calls `yield_now()` between
rounds, which defers its wake-up until the runtime has polled the OS
selector without blocking. Each round still keeps up to `batch_size`
sockets in flight; the batch now fills over several rounds instead of in
one go. The cost is one extra non-blocking `epoll_wait` (or equivalent)
per 128 sockets.

* fix(scanner): see ICMP errors on UDP sockets that wait in tokio

A UDP probe that gets no answer straight away is handed to tokio to wait for
the reply. On Linux, an ICMP "port unreachable" that arrives later only
raises EPOLLERR on the socket. tokio does not count that as readable, so
`UdpSocket::recv` slept until the timeout instead of returning the refusal.
async-io treated EPOLLERR as readable.

The straight port (before the eager probe) showed the effect: the UDP sweep
of the local host took 4.1 s instead of 1.0 s, because every closed port
waited for the 500 ms timeout. With the eager probe it only hit closed ports
whose ICMP arrived after the first receive. That is rare on the local host
but the common case for any remote host, where it turned every closed port
into a timeout.

`recv_or_error` waits for `READABLE | ERROR` readiness and hands out the
queued error (`take_error`), so a refused probe ends as soon as the ICMP
arrives, as before.

* ci(scan-benchmark): add a delayed host, fit Windows, compare misses

What the first runs showed:

- Only answers that arrive while the probe is still being sent were
  measured: on the loopback interface, refusals and ICMP errors are queued
  before connect()/send() returns. A remote host answers a round trip
  later, which is the path where tokio's UDP receive missed ICMP errors.
  On Linux the workflow now also sets up a host 5 ms away (a network
  namespace behind a netem-delayed veth pair, with ICMP rate limiting off,
  running its own listeners), and the benchmark sweeps it over TCP and UDP.
- Windows retries a refused connection for about a second. With
  `-t 500`, 8,191 concurrent attempts made even the base miss listeners.
  Windows now uses the default timeout and sweeps 8,191 ports (2,047 for
  the 500-socket batch).
- A build now fails the check only if it misses more listeners than the
  base does (any miss at all if the base misses none). Misses by the base
  are reported as a warning in the summary.
- The macOS runner has no `net.inet.icmp.icmplim`, which failed the
  "describe" step, and caps descriptors at 10240, so the 65536 limit
  could not be set. The describe step can no longer fail the job, and
  10240 is tried as well.

* docs(address): say that parse_addresses must not run inside async code

hickory's synchronous resolver runs its own tokio runtime, and tokio panics
when a runtime is dropped inside an asynchronous context. That was already
true before, but library users now have to run the scanner on tokio, so
they are more likely to call `parse_addresses` from async code. Document
the two safe ways: call it before starting the runtime (as the binary does)
or through `spawn_blocking`.

---------

Co-authored-by: Vrtgs <[email protected]>
2026-10-02 17:45:31 +09:00
Syed Ghufran HassanandAutumn Skerritt cfb8645901 Refactor SocketIterator for allocation-free performance (#945)
* Refactor SocketIterator for allocation-free performance

Refactor SocketIterator to eliminate boxing and improve memory efficiency. Update documentation and tests to reflect changes.

* fix(socket_iterator): fix clone test off-by-one and skip private doc example

- clone_resumes_independently expected None after 3 of 4 sockets; assert
  the exact remaining sequence for both the original and the clone.
- The struct doc example referenced a placeholder crate and a private
  module, so it could never compile as a doctest; mark it ignore.
- Add a test for empty IP/port inputs covering size_hint and the
  FusedIterator promise.

---------

Co-authored-by: Autumn Skerritt <[email protected]>
2026-10-01 22:03:40 +09:00
ReacherandAutumn Skerritt d7cdad29c6 refactor(main): avoid per-IP script list clones and safer ulimit fallback (#905)
Small cleanups in main.rs:

- Iterate over the parsed scripts by reference and clone only the script being run, instead of cloning the whole list for every IP.
- Use `or_default()` for the per-IP port map.
- If the soft file-descriptor limit does not fit in a `usize` (32-bit targets), fall back to `DEFAULT_FILE_DESCRIPTORS_LIMIT` instead of `usize::MAX`, which bypassed all batch-size adjustments.
- Fix a typo.

The effective-batch-size warning fix originally proposed here landed via #921.

Co-authored-by: Autumn Skerritt <[email protected]>
2026-10-01 20:24:16 +09:00
dependabot[bot] ea9e6f0736 build(deps): bump toml from 1.1.5+spec-1.1.0 to 1.1.6+spec-1.1.0 (#931)
Bumps [toml](https://github.com/toml-rs/toml) from 1.1.5+spec-1.1.0 to 1.1.6+spec-1.1.0.
- [Commits](https://github.com/toml-rs/toml/compare/toml-v1.1.5...toml-v1.1.6)

---
updated-dependencies:
- dependency-name: toml
  dependency-version: 1.1.6+spec-1.1.0
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-10-01 20:23:25 +09:00
dependabot[bot] 2c854eb551 build(deps): bump clap from 4.6.2 to 4.6.7 (#934)
Bumps [clap](https://github.com/clap-rs/clap) from 4.6.2 to 4.6.7.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/main/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.6.2...clap_complete-v4.6.7)

---
updated-dependencies:
- dependency-name: clap
  dependency-version: 4.6.7
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-10-01 20:23:10 +09:00
dependabot[bot] 1c3fd8c378 build(deps): bump rand from 0.10.2 to 0.10.3 (#936)
Bumps [rand](https://github.com/rust-random/rand) from 0.10.2 to 0.10.3.
- [Release notes](https://github.com/rust-random/rand/releases)
- [Changelog](https://github.com/rust-random/rand/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-random/rand/compare/0.10.2...0.10.3)

---
updated-dependencies:
- dependency-name: rand
  dependency-version: 0.10.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-10-01 20:22:54 +09:00
onsaliandAutumn Skerritt 4e64b5f00a feat: optional interval between scanned ports (#713)
New opt-in `--interval <MS>` option (also `interval` in the config file): after a port has been scanned on every address, wait that many milliseconds before scanning the next port, for slow, low-noise scans. Within a port `--batch-size` still limits concurrency; with the default of 0 scanning behaviour is unchanged.

Library: `Scanner::with_interval(Duration)` is added; `Scanner::new()` is unchanged.

Co-authored-by: Autumn Skerritt <[email protected]>
2026-10-01 20:19:49 +09:00
fabianbeesandAutumn Skerritt faa21b7d14 feat: option to also list closed ports (#736)
New `--closed` option (also `closed = true` in the config file) that additionally lists TCP ports that actively refused the connection: printed live as `Closed ip:port` and summarised under `closed ports:` at the end (also in greppable mode). Scripts are never run against closed ports, and without `--closed` scanning behaviour is unchanged.

Library: `Scanner::with_closed_ports()` and `Scanner::run_with_status() -> Vec<PortStatus>` are added; `Scanner::new()` and `run()` are unchanged.

Co-authored-by: Autumn Skerritt <[email protected]>
2026-10-01 20:14:48 +09:00
satyanand choudharyandAutumn Skerritt bf74950995 feat: support comma-separated multi-range port input (#852)
`-r/--range` now accepts several comma-separated ranges, e.g. `-r 1-100,200-300,5000-5100`. Overlapping/adjacent ranges are merged; random order uses the existing LCG walk extended over the merged ranges (every port visited exactly once), serial order follows the input order and skips duplicates. Reversed ranges (`300-200`) are now rejected instead of underflowing.

`range` in the config file keeps accepting the old `{ start = 1, end = 1000 }` table and additionally accepts `"1-500,1000-2500"` or `[[1, 500], [1000, 2500]]`.

Library API: `input::PortRange { start, end }` is replaced by `input::PortRanges(Vec<(u16, u16)>)`; `PortStrategy::pick` keeps its signature otherwise.

Fixes #835.

Co-authored-by: Autumn Skerritt <[email protected]>
2026-10-01 20:09:16 +09:00
Niklas Saari c027ebc7da test(address): cover CIDR notation with host bits set (#899)
Add regression tests for CIDR inputs whose host bits are set (e.g. `192.168.1.13/29` -> 192.168.1.8–15, `192.168.1.5/23`, `10.0.0.7/30`). The parsing itself was already fixed on master by 3bdac9c (IpInet accepts host bits), so the proposed normalize_cidr helper was dropped as unreachable.
2026-10-01 19:59:17 +09:00
DanDrewManand0xxreacher 183eafd22e fix: honor configured batch size on Windows and reject unsupported --ulimit (#921)
On native Windows, use the configured `-b/--batch-size` instead of a hard-coded 3000, and report the effective batch size (not the raw CLI value) in the "no open ports" hint on all platforms. `--ulimit` is hidden from Windows help and rejected on Windows (exit code 2), including when it comes from the config file. Unix batch-size/ulimit inference is unchanged.

Effective-batch-size reporting fix originally identified by @0xxreacher in #905.

Co-authored-by: 0xxreacher <[email protected]>
2026-10-01 19:57:28 +09:00
ChrisJr404 e497adf530 fix(config): use canonical XDG path for default config (#904)
Look for the config file at the XDG-style `$XDG_CONFIG_HOME/rustscan/config.toml` first (via `dirs::config_dir()`, so the platform equivalent on macOS/Windows), then fall back to the previous `$XDG_CONFIG_HOME/.rustscan.toml` and `~/.rustscan.toml` locations so existing configs keep working.

Fixes #741.
2026-10-01 19:55:08 +09:00
Chase Dustin 9ef667caed perf(scanner): precompute UDP payload lookup (#886)
Build a port -> payload lookup once per UDP scan instead of cloning the whole nmap payload BTreeMap into every scanned socket and scanning it linearly. Payload selection keeps the previous "last match wins" semantics.

Adds a socket-free micro-benchmark (benches/benchmark_helpers.rs) and lookup tests (tests/udp_payload_lookup.rs).
2026-10-01 19:54:38 +09:00
Andrew Barnes 002f736073 fix: keep library scans quiet by default (#916)
`Scanner` no longer prints each open socket to stdout by default, so library users can embed it and use the returned sockets without unsolicited output. The CLI opts in via the new `Scanner::with_open_port_output()` builder. The UDP socket bind error is now logged at debug level instead of printed.

Fixes #706.
2026-10-01 19:52:04 +09:00
kyd 1c2a982320 fix(build): decode literal text in UDP payload probes (#938)
Rewrite the nmap-payloads decoder in build.rs to follow Nmap's C-style escape format: `\xNN` and single-character escapes are decoded, all other characters are kept literally, and multi-line quoted segments are concatenated. Literal protocol text (e.g. the SNMP `public` community string, NetBIOS names, SSDP headers) was previously dropped, producing malformed probes. Also strip CR line endings when reading nmap-payloads.

Adds regression tests pinning the SNMP (161) and SSDP (1900) probe bytes.

Fixes #933.
2026-10-01 19:48:04 +09:00
jk 9644b3a2cd fix: exit quietly on closed stdout and survive missing SystemRoot (#941)
Route all user-facing stdout writes through tui::println_safe, which exits 0 on BrokenPipe (e.g. `rustscan -g ... | head`) instead of panicking (fatal under panic = "abort"). On Windows, skip hickory-resolver's system configuration and hosts file when SystemRoot is unset, falling back to the existing cloudflare_tls resolver.

Fixes #939, fixes #940.
2026-10-01 19:43:53 +09:00
herbenderblerandAutumn Skerritt a21bbb31bb ci: run the test suite on arm64 Linux runners (#868)
Add the GitHub-hosted ubuntu-24.04-arm runner to the test matrix so the suite runs natively on arm64 Linux (macos-latest already covers arm64 macOS; build.yml already cross-builds armv7/aarch64 Linux binaries), and document ARM support in docs/arm-support.md.

Fixes #683.

Co-authored-by: Autumn Skerritt <[email protected]>
2026-10-01 19:42:49 +09:00
Brad CowieandAutumn Skerritt 8b143f8ad7 ci: upload build artifacts to GitHub releases (#858)
Build release archives with houseabsolute/actions-rust-release and publish them (plus the .deb and checksums) to the GitHub release when a tag is pushed. CD now runs on pushes to master and tags only.

Also: read-only default workflow token (publish job gets contents: write), third-party actions pinned to release SHAs, fail on unmatched release assets, and the disabled trigger-less dependabot auto-merge workflow is removed.

Fixes #700, fixes #801.

Co-authored-by: Autumn Skerritt <[email protected]>
2026-10-01 19:41:56 +09:00
Sujyot KambleandAutumn Skerritt 111316f446 ci: replace deprecated actions-rs toolchain in test workflow (#853)
Replace the deprecated actions-rs/toolchain action with actions-rust-lang/setup-rust-toolchain (pinned to v1.17.0, clippy + rustfmt components, built-in cache and default RUSTFLAGS disabled) and restrict the workflow token to contents: read.

Co-authored-by: Autumn Skerritt <[email protected]>
2026-10-01 19:32:38 +09:00
Autumn (Bee) 8be97b841d test: clean obsolete executable fixtures and CI hooks (#943) 2026-10-01 18:05:37 +09:00
Autumn (Bee) 7446a42e56 test: remove network scans and external script execution (#942) 2026-10-01 17:44:10 +09:00
Autumn (Bee) e9ba3fa547 Merge pull request #935 from rezamqds/master
Fixes a typo in the Scriptfile parser comment (Sriptfile → Scriptfile) and improves the wording for clarity.
2026-09-21 19:26:33 +09:00
rezamqds 9a45d26e99 Fix typo in Scriptfile comment
Fix typo in comment about Scriptfile parser
2026-09-20 17:28:35 +03:30
rezamqds 6cb99747e1 Fix typo in Scriptfile comment
Clarify comment on scriptfile parser behavior
2026-09-20 17:28:31 +03:30
rezamqds bc80fbbad4 Fix typo in Scriptfile comment
Fix comment for clarity in test_script.py
2026-09-20 17:27:10 +03:30
rezamqds 3168580b86 Fix typo in Scriptfile comment
Fix comment for clarity in test_script.pl
2026-09-20 17:24:58 +03:30
Autumn (Bee) 2e78c22644 Merge pull request #930 from bee-san/fix/dependabot-clippy
chore: merge Dependabot updates and restore stable Clippy checks
2026-09-16 15:31:58 +09:00
Autumn Skerritt 996f818b5e Merge remote-tracking branch 'origin/dependabot/cargo/log-0.4.34' into fix/dependabot-clippy 2026-09-16 06:13:58 +00:00
Autumn Skerritt 90c5c1766b Merge commit '55c9f2a1c87b63f23363f6626954b871bbf4ab8e' into fix/dependabot-clippy 2026-09-16 06:13:37 +00:00
Autumn Skerritt f570d9ff8e Merge commit 'ce880ebe8c83be476d217f96ca26c2f90e6261c3' into fix/dependabot-clippy 2026-09-16 06:13:36 +00:00
Autumn Skerritt 42a3c87c83 Merge commit '64f60a97eddd7a0445be732175f272960ae1bd08' into fix/dependabot-clippy
# Conflicts:
#	Cargo.toml
2026-09-16 06:13:36 +00:00
Autumn Skerritt 1e93f44d8b Merge commit 'a084c1b3b9d6831074ff1929316a14a510e32430' into fix/dependabot-clippy 2026-09-16 06:12:26 +00:00
Autumn Skerritt bf290d7c7f Merge commit 'c668636a619ca96906be7d0b2aaf4ed0356560e3' into fix/dependabot-clippy 2026-09-16 06:12:26 +00:00
Autumn Skerritt 160dc7a3a2 Merge commit '730f709fd631955582993bc03d2aab5f580aa63c' into fix/dependabot-clippy 2026-09-16 06:12:26 +00:00
Autumn Skerritt 2d52f239ca Merge commit '827acd9cb00255662954cc36b5a90f6dbe5ba54f' into fix/dependabot-clippy 2026-09-16 06:12:26 +00:00