rofl0r / rofl0r/proxychains-ng
How to set up proxy properly?
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 10.7k
- Forks
- 1.1k
- PR merge metrics
- No merged PRs in 30d
Description
Hi! Thank you for such useful project!
I work under corporate proxy, so I can connect to specific urls using curl like this:
just for example it is curl to Telegram Bot API:
curl --request GET 'https://api.telegram.org/bot_token/getMe' -x '192.168.155.148:9090' -U 'ProxyLogin:ProxyPassword'
It works as expected. Now I use proxychains4 to set proxy settings globally
My /etc/proxychains.conf:
strict_chain
proxy_dns
tcp_read_time_out 15000
tcp_connect_time_out 8000
[ProxyList]
http 192.168.155.148 9090 ProxyLogin ProxyPassword
And now I'm trying this:
proxychains4 curl --request GET 'https://api.telegram.org/bot_token/getMe' -v
Getting error:
[proxychains] config file found: /etc/proxychains.conf [proxychains] preloading /usr/lib/libproxychains4.so [proxychains] DLL init: proxychains-ng 4.16 Note: Unnecessary use of -X or --request, GET is already inferred.
* getaddrinfo() thread failed to start
* Could not resolve host: api.telegram.org
* Closing connection 0 curl: (6) getaddrinfo() thread failed to start
This is the same error as I use curl without -x and -U! So it looks like proxychains4 ignores proxy and password from config!
Can you help me to call proxychains4 correctly?
Logs for example:
Working example with curl:
curl --request GET 'https://api.telegram.org/bot_token/getMe' -x '192.168.155.148:9090' -U 'ProxyLogin:ProxyPassword' -v
Note: Unnecessary use of -X or --request, GET is already inferred.
* Trying 192.168.155.148:9090...
* Connected to 192.168.155.148 (192.168.155.148) port 9090 (#0)
* allocate connect buffer!
* Establish HTTP proxy tunnel to api.telegram.org:443
* Proxy auth using Basic with user 'T ProxyLogin'
> CONNECT api.telegram.org:443 HTTP/1.1
> Host: api.telegram.org:443
> Proxy-Authorization: Basic VGVjaF9Bc3lMw==
> User-Agent: curl/7.81.0
> Proxy-Connection: Keep-Alive
>
< HTTP/1.0 200 Connection established
<
* Proxy replied 200 to CONNECT request
* CONNECT phase completed!
* ALPN, offering h2
* ALPN, offering http/1.1
* CAfile: /etc/ssl/certs/ca-certificates.crt
* CApath: /etc/ssl/certs
* TLSv1.0 (OUT), TLS header, Certificate Status (22):
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS header, Certificate Status (22):
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS header, Finished (20):
* TLSv1.2 (IN), TLS header, Supplemental data (23):
* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
* TLSv1.2 (IN), TLS header, Supplemental data (23):
* TLSv1.3 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS header, Supplemental data (23):
* TLSv1.3 (IN), TLS handshake, CERT verify (15):
* TLSv1.2 (IN), TLS header, Supplemental data (23):
* TLSv1.3 (IN), TLS handshake, Finished (20):
* TLSv1.2 (OUT), TLS header, Finished (20):
* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.2 (OUT), TLS header, Supplemental data (23):
* TLSv1.3 (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384
* ALPN, server accepted to use h2
* Server certificate:
* subject: CN=api.telegram.org
* subjectAltName: host "api.telegram.org" matched cert's "api.telegram.org"
* SSL certificate verify ok.
* Using HTTP2, server supports multiplexing
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* TLSv1.2 (OUT), TLS header, Supplemental data (23):
* TLSv1.2 (OUT), TLS header, Supplemental data (23):
* TLSv1.2 (OUT), TLS header, Supplemental data (23):
* Using Stream ID: 1 (easy handle 0x55697fd63960)
* TLSv1.2 (OUT), TLS header, Supplemental data (23):
> GET /bot_token/getMe HTTP/2
> Host: api.telegram.org
> user-agent: curl/7.81.0
> accept: */*
>
* TLSv1.2 (IN), TLS header, Supplemental data (23):
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* TLSv1.2 (IN), TLS header, Supplemental data (23):
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* old SSL session ID is stale, removing
* TLSv1.2 (IN), TLS header, Supplemental data (23):
* TLSv1.2 (OUT), TLS header, Supplemental data (23):
* TLSv1.2 (IN), TLS header, Supplemental data (23):
* TLSv1.2 (IN), TLS header, Supplemental data (23):
* TLSv1.2 (IN), TLS header, Supplemental data (23):
* TLSv1.2 (OUT), TLS header, Supplemental data (23):
* TLSv1.2 (IN), TLS header, Supplemental data (23):
< HTTP/2 200
< date: Thu, 25 Aug 2022 09:25:50 GMT
< server: nginx/1.18.0
< content-type: application/json
< content-length: 195
< strict-transport-security: max-age=31536000; includeSubDomains; preload
< access-control-allow-origin: *
< access-control-allow-methods: GET, POST, OPTIONS
< access-control-expose-headers: Content-Length,Content-Type,Date,Server,Connection
<
* TLSv1.2 (IN), TLS header, Supplemental data (23):
* TLSv1.2 (IN), TLS header, Supplemental data (23):
* Connection #0 to host 192.168.156.48 left intact
{"ok":true,"result":{"id":5566378734,"is_bot":true,"first_name":"some-bot","username":"testbot","can_join_groups":true,"can_read_all_group_messages":false,"supports_inline_queries":false}}
Just curl:
curl --request GET 'https://api.telegram.org/bot_token/getMe' -v
Note: Unnecessary use of -X or --request, GET is already inferred.
* getaddrinfo() thread failed to start
* Could not resolve host: api.telegram.org
* Closing connection 0
curl: (6) getaddrinfo() thread failed to start
Same as using proxychains4
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue names /etc/proxychains.conf and a proxychains4 curl command, but no source file or test. Reproduce the working and failing commands, then trace configuration loading and DNS handling to determine whether the HTTP proxy credentials are applied. Done requires a documented correct invocation or a confirmed fix with a regression test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- cli, networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100