{"record":{"id":"11699d0c5fc483b9","repo":"epi052/feroxbuster","slug":"could-not-connect-to-any-target-provided","errorCode":null,"errorMessage":"Could not connect to any target provided","messagePattern":"Could not connect to any target provided","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/heuristics.rs","lineNumber":161,"sourceCode":"                            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());\n                            ferox_print(&msg, &PROGRESS_PRINTER);\n                        } else {\n                            ferox_print(\n                                &format!(\n                                    \"Could not connect to {target_url}, skipping...\\n  => {}\\n\",\n                                    e.root_cause()\n                                ),\n                                &PROGRESS_PRINTER,\n                            );\n                        }\n                    }\n                    log::warn!(\"{e}\");\n                }\n            }\n        }\n\n        if good_urls.is_empty() {\n            bail!(\"Could not connect to any target provided\");\n        }\n\n        log::trace!(\"exit: connectivity_test -> {good_urls:?}\");\n        Ok(good_urls)\n    }\n\n    /// heuristic designed to detect when a server has directory listing enabled\n    pub async fn directory_listing(&self, target_url: &str) -> Result<Option<DirListingResult>> {\n        log::trace!(\"enter: directory_listing({target_url})\");\n\n        let tgt = if !target_url.ends_with('/') {\n            // if left unchanged, this function would be called against redirects that point to\n            // valid directories for most, if not all, directories beyond the initial urls.\n            // so, instead of `directory_listing(\"http://localhost\") -> None` we get\n            // `directory_listing(\"http://localhost/\") -> Some(DirListingResult)` if there is\n            // directory listing beyond the redirect\n            format!(\"{target_url}/\")\n        } else {","sourceCodeStart":143,"sourceCodeEnd":179,"githubUrl":"https://github.com/epi052/feroxbuster/blob/1f595dab5c76858d5a14fbc47dabf2563d729c62/src/heuristics.rs#L143-L179","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Verify network reachability of each target (curl the URLs manually)","If using --proxy, confirm the proxy is up and reachable","Check DNS resolution for the hostnames and connect the VPN if required","Remove or fix unreachable targets; keep at least one responding target"],"exampleFix":"// before\nferox --url https://down.example.com --url https://also-down.example.com\n// after\nferox --url https://alive.example.com","handlingStrategy":"retry","validationCode":"const ok = (await fetch(url, { method: 'HEAD' })).ok; if (!ok) console.warn(`${url} unreachable`);","typeGuard":null,"tryCatchPattern":"match connectivity(config).await { Err(e) => { log::error!(\"no reachable targets: {e}\"); // retry with backoff or fix network } ... }","preventionTips":["Curl each target before launching a scan","Verify proxy/VPN settings (--proxy) are correct and the proxy is up","Check DNS resolution for all hostnames"],"tags":["network","connectivity","scan-startup","rust"],"backgroundTag":"connection-refused","analyzedSha":"1f595dab5c76858d5a14fbc47dabf2563d729c62","analyzedAt":"2026-09-13T19:33:06.208Z","contentChangedAt":"2026-09-13T19:33:06.208Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}