rofl0r / proxychains-ng

proxychains ng (new generation) - a preloader which hooks calls to sockets in dynamically linked programs and redirects it through one or more socks/http proxies. continuation of the unmaintained proxychains project. the sf.net page is currently not updated, use releases from github release page instead.
http://sourceforge.net/projects/proxychains-ng/files
GNU General Public License v2.0
9.82k stars 1.08k forks source link

How to exclude ::1:5037 #284

Open moeworld opened 5 years ago

moeworld commented 5 years ago

When I use proxychains-ng with android studio, adb is not working. Then I execute "proxychains4 ./adb devices", terminal outputs:

[proxychains] Strict chain ... 127.0.0.1:1080 ... ::1:5037 ... OK adb: failed to check server version: protocol fault (couldn't read status): Success

How can I exclude ::1:5037 in configuration file?

zhangjunphy commented 4 years ago

Same problem here. It seems proxychains does not understand ipv6 address in localnet options. I am working on an implementation though https://github.com/zhangjunphy/proxychains-ng/tree/localnet_ipv6.

rofl0r commented 4 years ago

until @zhangjunphy's branch is ready for primetime, the following small patch should be able to workaround the ::1 issue

--- a/src/libproxychains.c
+++ b/src/libproxychains.c
@@ -589,6 +589,9 @@ int connect(int sock, const struct sockaddr *addr, unsigned int len) {
        PDEBUG("target: %s\n", inet_ntop(v6 ? AF_INET6 : AF_INET, v6 ? (void*)p_addr_in6 : (void*)p_addr_in, str, sizeof(str)));
        PDEBUG("port: %d\n", port);

+       if(v6 && !memcmp(p_addr_in6->s6_addr, "\0\0\0\0" "\0\0\0\0" "\0\0\0\0" "\0\0\0\1", 16))
+               return true_connect(sock, addr, len);
+
        // check if connect called from proxydns
         remote_dns_connect = !v6 && (ntohl(p_addr_in->s_addr) >> 24 == remote_dns_subnet);

also available here for the time being: http://ix.io/2B9s