epi052/feroxbuster · error

Could not connect to any target provided

Error message

Could not connect to any target provided

What it means

connectivity() tests each configured target by making a request and collecting only the URLs that respond successfully. If none of the provided targets can be reached, good_urls ends up empty and the function bails with this message. It means the scan cannot start because every target failed the connectivity probe.

Solutions

  1. Verify network reachability of each target (curl the URLs manually)
  2. If using --proxy, confirm the proxy is up and reachable
  3. Check DNS resolution for the hostnames and connect the VPN if required
  4. Remove or fix unreachable targets; keep at least one responding target

Example fix

// before
ferox --url https://down.example.com --url https://also-down.example.com
// after
ferox --url https://alive.example.com
Defensive patterns

Strategy: retry

Validate before calling

const ok = (await fetch(url, { method: 'HEAD' })).ok; if (!ok) console.warn(`${url} unreachable`);

Try / catch

match connectivity(config).await { Err(e) => { log::error!("no reachable targets: {e}"); // retry with backoff or fix network } ... }

Prevention

When it happens

Trigger: Calling connectivity (directly or at scan startup) when every configured target URL fails its connection test — DNS failure, connection refused, TLS errors, timeouts, or all targets blocked by proxy/VPN config.

Common situations: Scanning offline or behind a corporate proxy that blocks the targets, typo'd hostnames, targets that are actually down, a required VPN not connected, or ferox's proxy setting (-p) pointing at a dead proxy so every probe fails.

Understand the failure class

Background: ECONNREFUSED and "connection refused" / "could not connect to server" errors: what they mean and how to fix them — this error's family across 44 libraries.

Related errors


AI-assisted analysis of epi052/feroxbuster@1f595dab5c (2026-09-13). Data as JSON: /api/errors/11699d0c5fc483b9. Report an issue: GitHub.

Appendix: source

Thrown at src/heuristics.rs:161

                            let msg = format!("Could not connect to {target_url} due to {} errors (run with {} to ignore), skipping...\n  => {}\n",style("SSL").red(), style("--insecure").yellow().bright(), e.root_cause());
                            ferox_print(&msg, &PROGRESS_PRINTER);
                        } else {
                            ferox_print(
                                &format!(
                                    "Could not connect to {target_url}, skipping...\n  => {}\n",
                                    e.root_cause()
                                ),
                                &PROGRESS_PRINTER,
                            );
                        }
                    }
                    log::warn!("{e}");
                }
            }
        }

        if good_urls.is_empty() {
            bail!("Could not connect to any target provided");
        }

        log::trace!("exit: connectivity_test -> {good_urls:?}");
        Ok(good_urls)
    }

    /// heuristic designed to detect when a server has directory listing enabled
    pub async fn directory_listing(&self, target_url: &str) -> Result<Option<DirListingResult>> {
        log::trace!("enter: directory_listing({target_url})");

        let tgt = if !target_url.ends_with('/') {
            // if left unchanged, this function would be called against redirects that point to
            // valid directories for most, if not all, directories beyond the initial urls.
            // so, instead of `directory_listing("http://localhost") -> None` we get
            // `directory_listing("http://localhost/") -> Some(DirListingResult)` if there is
            // directory listing beyond the redirect
            format!("{target_url}/")
        } else {

View on GitHub (pinned to 1f595dab5c)