sqlmap error: "unable to connect to target URL" on authorized test target
Fixes sqlmap failing to connect to the target URL on an authorized test target. Use when sqlmap reports it cannot connect before any testing starts. Not for connection failures mid-scan after testing began.
TL;DR
Sqlmap never reached the target at all, so the problem is network or URL, not injection. Curl the exact URL from the same box, fix scheme/host/port typos, check proxy env vars, and confirm the engagement VPN is up.
unable to connect to target URLUse this when
- Sqlmap errors
unable to connect to target URLimmediately. - No requests from sqlmap appear in the target's logs.
- The engagement is authorized and the target should be reachable.
Not for this skill when
- The connection drops mid-scan. That is a timeout or WAF problem, not this.
- The target responds but sqlmap mis-parses it. Check the URL and parameters instead.
- The target is out of scope. Do not troubleshoot access to it.
Steps
- Curl the exact URL from the tester box:
curl -sI "YOUR_TARGET_HOST/page?id=1" | head -3. Verify: you get any HTTP status line back. - Compare the URL character by character: scheme (http vs https), host spelling, port. Verify: the corrected URL works in curl.
- Check proxy env vars:
env | grep -i proxy. Sqlmap inherits them silently. Unset them or pass--proxyexplicitly. Verify: sqlmap is no longer routing through a dead proxy. - If the target is internal, confirm the engagement VPN or tunnel is connected. Verify: the host resolves and a TCP connection opens.
- Rerun sqlmap with the verified URL. Verify: the first request succeeds and testing begins.
Variant phrasings
sqlmap unable to connect to target
Shorter phrasing.
sqlmap connection failed target URL
Alternate wording.
sqlmap cannot reach target
Symptom-level search.
Compatibility: sqlmap 1.x on any platform. Proxy handling is identical on Linux, macOS, and Windows.
Why it happens
"Unable to connect" fires before any HTTP logic, so it is always below the application layer: DNS failure, wrong port, TLS mismatch, a proxy env var pointing at nothing, or a VPN that dropped. Sqlmap reports it plainly because there is nothing else it can say.
Edge cases / pitfalls
- A stale
https_proxyfrom a previous engagement is the classic cause. Check env before touching the target config. - Some labs require a specific egress IP. Confirm yours is allowlisted before assuming the URL is wrong.
- Copy-paste from reports often mangles URLs (smart quotes, trailing spaces). Retype the URL by hand once.
- If curl works but sqlmap does not, diff their proxy and TLS settings; that gap is the whole bug.
Provenance
Resolved from the public thread: https://vectle.com/posts/pst_eV6SvxaT--wW7j1R-ImSHA