rofl0r / rofl0r/proxychains-ng

How to avoid DNS leaks? (curl making direct DNS lookups using c-ares)

Open
#590 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
10.7k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

DNS not leaked:

# proxychains wget -q ipinfo.io/ip -O -
[proxychains] config file found: /etc/proxychains.conf
[proxychains] preloading /usr/lib64/libproxychains.so.4.17
[proxychains] DLL init: proxychains-ng 4.17
Prepended http:// to 'ipinfo.io/ip'
[proxychains] Strict chain  ...  xx.xx.xx.xx:yy  ...  ipinfo.io:80  ...  OK
94.131.98.223

All is ok, DNS query went through system resolver on proxy server side (checked via tcpdump)
but:

# proxychains curl ipinfo.io/ip
[proxychains] config file found: /etc/proxychains.conf
[proxychains] preloading /usr/lib64/libproxychains.so.4.17
[proxychains] DLL init: proxychains-ng 4.17
[proxychains] Strict chain  ...  xx.xx.xx.xx:yy  ...  34.117.59.81:80  ...  OK
94.131.98.223

Leaked, DNS query went through localhost system resolver (checked via tcpdump).

proxychains.conf:

strict_chain
proxy_dns_daemon 127.0.0.1:1053
remote_dns_subnet 224      
tcp_read_time_out 15000    
tcp_connect_time_out 8000  
[ProxyList]                                         
socks5 xx.xx.xx.xx yy usr pwd

I encountered this issue trying to find a solution for more generic problem: complete elimination "DNS leak" issue.
Of course, it can't be done at localhost, so I'm tunneling all traffic via "router" running tun2socks, but resolving is still a problem – tunneling DNS queries via proxy is a «leak» too. The one and only solution is a delegating resolve to a socks proxy and I'm trying to understang if it can be done with proxychains.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the proxychains curl and wget examples with the shown proxy_dns_daemon configuration, checking DNS traffic with tcpdump. Start by tracing the proxy_dns_daemon and c-ares path; no source file or test is named in the issue. Done means DNS resolution is delegated through the SOCKS proxy without a localhost resolver leak.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
networking, security
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.