mirror of
https://github.com/rofl0r/proxychains-ng
synced 2026-05-15 01:52:34 +08:00
Compare commits
10 Commits
@@ -263,6 +263,15 @@ Known Problems:
|
|||||||
there are unconfirmed reports that it works as root though.
|
there are unconfirmed reports that it works as root though.
|
||||||
musl libc is unaffected from the bug.
|
musl libc is unaffected from the bug.
|
||||||
|
|
||||||
|
Useful links
|
||||||
|
------------
|
||||||
|
the following sites may prove useful to check for leaks:
|
||||||
|
https://ipfighter.com/
|
||||||
|
https://browserleaks.com/webrtc
|
||||||
|
https://dnsleaktest.com
|
||||||
|
http://check.torproject.org - tor specific
|
||||||
|
http://ifconfig.me - can be used via curl
|
||||||
|
http://ifconfig.io/
|
||||||
|
|
||||||
Community:
|
Community:
|
||||||
----------
|
----------
|
||||||
|
|||||||
@@ -87,6 +87,7 @@ usage() {
|
|||||||
echo " to preload from current dir (possibly insecure, but handy)"
|
echo " to preload from current dir (possibly insecure, but handy)"
|
||||||
echo "--fat-binary : build for both i386 and x86_64 architectures on 64-bit Macs"
|
echo "--fat-binary : build for both i386 and x86_64 architectures on 64-bit Macs"
|
||||||
echo "--fat-binary-m1 : build for both arm64e and x86_64 architectures on M1 Macs"
|
echo "--fat-binary-m1 : build for both arm64e and x86_64 architectures on M1 Macs"
|
||||||
|
echo "--fat-binary-m2 : build for arm64, arm64e and x86_64 architectures on M2+ Macs"
|
||||||
echo "--hookmethod=dlsym|dyld hook method for osx. default: auto"
|
echo "--hookmethod=dlsym|dyld hook method for osx. default: auto"
|
||||||
echo " if OSX >= 12 is detected, dyld method will be used if auto."
|
echo " if OSX >= 12 is detected, dyld method will be used if auto."
|
||||||
echo "--help : show this text"
|
echo "--help : show this text"
|
||||||
@@ -102,6 +103,7 @@ spliteq() {
|
|||||||
|
|
||||||
fat_binary=
|
fat_binary=
|
||||||
fat_binary_m1=
|
fat_binary_m1=
|
||||||
|
fat_binary_m2=
|
||||||
ignore_cve=no
|
ignore_cve=no
|
||||||
hookmethod=auto
|
hookmethod=auto
|
||||||
|
|
||||||
@@ -118,6 +120,7 @@ parsearg() {
|
|||||||
--hookmethod=*) hookmethod=`spliteq $1`;;
|
--hookmethod=*) hookmethod=`spliteq $1`;;
|
||||||
--fat-binary) fat_binary=1;;
|
--fat-binary) fat_binary=1;;
|
||||||
--fat-binary-m1) fat_binary_m1=1;;
|
--fat-binary-m1) fat_binary_m1=1;;
|
||||||
|
--fat-binary-m2) fat_binary_m2=1;;
|
||||||
--help) usage;;
|
--help) usage;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
@@ -179,6 +182,7 @@ ishaiku() {
|
|||||||
check_compile 'whether C compiler works' '' 'int main() {return 0;}' || fail 'error: install a C compiler and library'
|
check_compile 'whether C compiler works' '' 'int main() {return 0;}' || fail 'error: install a C compiler and library'
|
||||||
check_compile 'whether libc headers are complete' '' '#include <netdb.h>\nint main() {return 0;}' || fail 'error: necessary libc headers are not installed'
|
check_compile 'whether libc headers are complete' '' '#include <netdb.h>\nint main() {return 0;}' || fail 'error: necessary libc headers are not installed'
|
||||||
check_compile 'whether C compiler understands -Wno-unknown-pragmas' '-Wno-unknown-pragmas' 'int main() {return 0;}'
|
check_compile 'whether C compiler understands -Wno-unknown-pragmas' '-Wno-unknown-pragmas' 'int main() {return 0;}'
|
||||||
|
check_compile 'whether C compiler understands -Werror=implicit-function-declaration' '-Werror=implicit-function-declaration' 'int main() {return 0;}'
|
||||||
|
|
||||||
if ! check_compile 'whether getnameinfo() servlen argument is POSIX compliant (socklen_t)' "-DGN_NODELEN_T=socklen_t -DGN_SERVLEN_T=socklen_t -DGN_FLAGS_T=int" \
|
if ! check_compile 'whether getnameinfo() servlen argument is POSIX compliant (socklen_t)' "-DGN_NODELEN_T=socklen_t -DGN_SERVLEN_T=socklen_t -DGN_FLAGS_T=int" \
|
||||||
'#define _GNU_SOURCE\n#include <netdb.h>\nint getnameinfo(const struct sockaddr *, socklen_t, char *, socklen_t, char *, socklen_t, int);int main() {\nreturn 0;}' ; then
|
'#define _GNU_SOURCE\n#include <netdb.h>\nint getnameinfo(const struct sockaddr *, socklen_t, char *, socklen_t, char *, socklen_t, int);int main() {\nreturn 0;}' ; then
|
||||||
@@ -217,6 +221,7 @@ check_define __APPLE__ && {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
check_define __FreeBSD__ && bsd_detected=true
|
check_define __FreeBSD__ && bsd_detected=true
|
||||||
|
check_define __NetBSD__ && bsd_detected=true
|
||||||
check_define __OpenBSD__ && {
|
check_define __OpenBSD__ && {
|
||||||
bsd_detected=true
|
bsd_detected=true
|
||||||
echo "CFLAGS+=-DIS_OPENBSD">>config.mak
|
echo "CFLAGS+=-DIS_OPENBSD">>config.mak
|
||||||
@@ -246,7 +251,7 @@ check_link "whether we can use -Wl,--no-as-needed" "-Wl,--no-as-needed" \
|
|||||||
LD_SONAME_FLAG=
|
LD_SONAME_FLAG=
|
||||||
printf "checking what's the option to use in linker to set library name ... "
|
printf "checking what's the option to use in linker to set library name ... "
|
||||||
for o in --soname -h -soname -install_name; do
|
for o in --soname -h -soname -install_name; do
|
||||||
check_link_silent "-shared -Wl,$o,libconftest.so" "void test_func(int a) {}" && LD_SONAME_FLAG=$o && break
|
check_link_silent "-shared -Wl,$o,libconftest.so" "void test_func(void) {}" && LD_SONAME_FLAG=$o && break
|
||||||
done
|
done
|
||||||
if [ -z "$LD_SONAME_FLAG" ]; then
|
if [ -z "$LD_SONAME_FLAG" ]; then
|
||||||
printf '\ncannot find an option to set library name\n'
|
printf '\ncannot find an option to set library name\n'
|
||||||
@@ -289,6 +294,12 @@ if ismac ; then
|
|||||||
echo "FAT_LDFLAGS=-arch arm64 -arch arm64e -arch x86_64">>config.mak
|
echo "FAT_LDFLAGS=-arch arm64 -arch arm64e -arch x86_64">>config.mak
|
||||||
echo "FAT_BIN_LDFLAGS=-arch arm64 -arch x86_64">>config.mak
|
echo "FAT_BIN_LDFLAGS=-arch arm64 -arch x86_64">>config.mak
|
||||||
fi
|
fi
|
||||||
|
if [ "$fat_binary_m2" = 1 ] ; then
|
||||||
|
echo "Configuring a fat binary for arm64[e] and x86_64"
|
||||||
|
echo "MAC_CFLAGS+=-arch arm64 -arch arm64e -arch x86_64">>config.mak
|
||||||
|
echo "FAT_LDFLAGS=-arch arm64 -arch arm64e -arch x86_64">>config.mak
|
||||||
|
echo "FAT_BIN_LDFLAGS=-arch arm64 -arch arm64e -arch x86_64">>config.mak
|
||||||
|
fi
|
||||||
elif isbsd ; then
|
elif isbsd ; then
|
||||||
echo LIBDL=>>config.mak
|
echo LIBDL=>>config.mak
|
||||||
echo "CFLAGS+=-DIS_BSD">>config.mak
|
echo "CFLAGS+=-DIS_BSD">>config.mak
|
||||||
@@ -302,3 +313,6 @@ elif ishaiku ; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Done, now run $make_cmd && $make_cmd install"
|
echo "Done, now run $make_cmd && $make_cmd install"
|
||||||
|
if [ "$fat_binary_m2" = 1 ] ; then
|
||||||
|
echo "Don't forget to run csrutil disable and sudo nvram boot-args=-arm64e_preview_abi"
|
||||||
|
fi
|
||||||
|
|||||||
+1
-1
@@ -999,7 +999,7 @@ err_nn:
|
|||||||
} else if(!node && !(hints->ai_flags & AI_PASSIVE)) {
|
} else if(!node && !(hints->ai_flags & AI_PASSIVE)) {
|
||||||
af = ((struct sockaddr_in *) &space->sockaddr_space)->sin_family = AF_INET;
|
af = ((struct sockaddr_in *) &space->sockaddr_space)->sin_family = AF_INET;
|
||||||
memcpy(&((struct sockaddr_in *) &space->sockaddr_space)->sin_addr,
|
memcpy(&((struct sockaddr_in *) &space->sockaddr_space)->sin_addr,
|
||||||
(char[]){127,0,0,1}, 4);
|
"\177\0\0\1", 4);
|
||||||
}
|
}
|
||||||
if(service) mygetservbyname_r(service, NULL, &se_buf, buf, sizeof(buf), &se);
|
if(service) mygetservbyname_r(service, NULL, &se_buf, buf, sizeof(buf), &se);
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -103,7 +103,7 @@ typedef int (*close_t)(int);
|
|||||||
typedef int (*close_range_t)(unsigned, unsigned, int);
|
typedef int (*close_range_t)(unsigned, unsigned, int);
|
||||||
typedef int (*connect_t)(int, const struct sockaddr *, socklen_t);
|
typedef int (*connect_t)(int, const struct sockaddr *, socklen_t);
|
||||||
typedef struct hostent* (*gethostbyname_t)(const char *);
|
typedef struct hostent* (*gethostbyname_t)(const char *);
|
||||||
typedef int (*freeaddrinfo_t)(struct addrinfo *);
|
typedef void (*freeaddrinfo_t)(struct addrinfo *);
|
||||||
typedef struct hostent *(*gethostbyaddr_t) (const void *, socklen_t, int);
|
typedef struct hostent *(*gethostbyaddr_t) (const void *, socklen_t, int);
|
||||||
|
|
||||||
typedef int (*getaddrinfo_t)(const char *, const char *, const struct addrinfo *,
|
typedef int (*getaddrinfo_t)(const char *, const char *, const struct addrinfo *,
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#undef _GNU_SOURCE
|
||||||
#define _GNU_SOURCE
|
#define _GNU_SOURCE
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#define _POSIX_C_SOURCE 200809L
|
#define _POSIX_C_SOURCE 200809L
|
||||||
|
|||||||
@@ -241,7 +241,7 @@ static int proxy_from_string(const char *proxystring,
|
|||||||
ul = p-u;
|
ul = p-u;
|
||||||
p++;
|
p++;
|
||||||
pl = at-p;
|
pl = at-p;
|
||||||
if(proxytype == RS_PT_SOCKS5 && (ul > 255 || pl > 255))
|
if(ul > 255 || pl > 255)
|
||||||
return 0;
|
return 0;
|
||||||
memcpy(user_buf, u, ul);
|
memcpy(user_buf, u, ul);
|
||||||
user_buf[ul]=0;
|
user_buf[ul]=0;
|
||||||
@@ -767,7 +767,7 @@ HOOKFUNC(int, connect, int sock, const struct sockaddr *addr, unsigned int len)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef IS_SOLARIS
|
#ifdef IS_SOLARIS
|
||||||
HOOKFUNC(int, __xnet_connect, int sock, const struct sockaddr *addr, unsigned int len)
|
HOOKFUNC(int, __xnet_connect, int sock, const struct sockaddr *addr, unsigned int len) {
|
||||||
return connect(sock, addr, len);
|
return connect(sock, addr, len);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user