Der One-Liner#
curl -x http://USER-cc-us:PASS@res.proxy-cyber.com:9000 https://api.ipify.org-x oder --proxy) übernimmt die Proxy-URL mit eingebetteten Anmeldeinformationen. cURL tunnelt HTTPS-Ziele automatisch mit CONNECT und fordert den Proxy auf, den Hostnamen aufzulösen.
Flaggen, die es wert sind, gekannt zu werden#
| Flagge | Zweck |
|---|---|
| -x, --proxy URL | Der Proxy: Schema, Host, Port, optionale Anmeldeinformationen |
| -U, --proxy-user user:pass | Anmeldeinformationen separat, nützlich, wenn das Passwort Sonderzeichen enthält |
| -Proxybasen | Einfache Proxy-Authentifizierung erzwingen (Standardeinstellung bei Angabe eines Passworts) |
| -v | Zeigt den CONNECT-Austausch, die Proxy-Statuscodes und die Antwortheader an |
| Noproxy "*" | Proxy-Umgebungsvariablen für diesen Aufruf ignorieren |
| -w '%{time total}\n' | Drucken Sie Timing zum Vergleichen von Exits |
SOCKS5 und Remote DNS#
# Hostname resolved at the exit (recommended)
curl -x socks5h://USER-cc-de:PASS@res.proxy-cyber.com:9001 https://api.ipify.org
# Hostname resolved locally, then the IP is sent to the proxy (leaks the lookup)
curl -x socks5://USER-cc-de:PASS@res.proxy-cyber.com:9001 https://api.ipify.orgUmweltvariablen#
Tools, die cURL und vielen anderen Ehre machen http_proxy, https_proxy und no_proxyExportieren Sie sie einmal für eine Arbeitssitzung.
export https_proxy="http://USER-cc-us:PASS@res.proxy-cyber.com:9000"
export http_proxy="$https_proxy"
export no_proxy="localhost,127.0.0.1"
curl https://api.ipify.org # proxied without -xLesen eines Fehlers#
curl -v -x http://USER:WRONG@res.proxy-cyber.com:9000 https://api.ipify.org 2>&1 | grep -E "CONNECT|HTTP/1.1 4|HTTP/1.1 5"
# < HTTP/1.1 407 Proxy Authentication Required -> credentials
# < HTTP/1.1 400 Bad Request -> a username parameter is wrong
# < HTTP/1.1 502 Bad Gateway -> no exit for that location; widen itEin Status auf der CONNECT-Leitung kommt vom Gateway; ein Status nach Connection established kommt vom Bestimmungsort. Fehlerseite Karten jeden Gateway-Code.
Rotierende Sessions in einer Schleife#
for i in $(seq 1 5); do
curl -s -x "http://USER-cc-us-sid-run$i-ttl-5m:PASS@res.proxy-cyber.com:9000" https://api.ipify.org
echo
done # five different United States exits, each reusable for five minutes under its idFragen, die Menschen stellen#
Benötigt cURL ein spezielles Flag für HTTPS über den Proxy?
Nein. Mit einer http://-Proxy-URL stellt cURL automatisch CONNECT für https://-Ziele aus. --proxytunnel ist nur wichtig, um einen Tunnel auf einfachem HTTP zu erzwingen.
Mein Passwort enthält @ or : und cURL schlägt fehl.
Übergeben Sie die Anmeldeinformationen mit -U user:pass, anstatt sie in die URL einzubetten, oder kodieren Sie die Sonderzeichen per URL.