rofl0r / microsocks

tiny, portable SOCKS5 server with very moderate resource usage
Other
1.48k stars 266 forks source link

Any reason why using microsocks with proxychains would leak DNS? #41

Closed uu01 closed 3 years ago

uu01 commented 3 years ago

I'm trying to setup a local proxy where I can configure a chain of proxies on it with proxychains. Let's say I configure proxychains to use tor and then start microsocks like this:

proxychains ./microsocks -i 127.0.0.1 -p 1080

Everything works, except that it leaks DNS.

rofl0r commented 3 years ago

if microsocks get passed a hostname it has naturally to do a DNS lookup. it does so using getaddrinfo(). if proxychains (i'm hoping you use proxychains-ng) is properly configured, it hooks that function call and forwards it to the next proxy. the app that uses microsocks as socks5 proxy can also leak DNS if it doesn't pass the DNS name to the proxy but rather looks it up itself (firefox e.g. has a checkbox in proxy config to enable dns lookup on proxy, but it's defaulting to off).

uu01 commented 3 years ago

That was it. I had to set the firefox DNS lookup to proxy option. Thanks for the reply.