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.74k stars 1.07k forks source link

telnet with proxychains is OK,but it doesn't work in other cases #534

Open niuwz opened 10 months ago

niuwz commented 10 months ago

It's connected.

tjuai% proxychains telnet baidu.com 443
[proxychains] config file found: /home/aaa/.proxychains/proxychains.conf
[proxychains] preloading /usr/lib/libproxychains4.so
[proxychains] DLL init: proxychains-ng 4.16
Trying 110.242.68.66...
[proxychains] Dynamic chain  ...  127.0.0.1:60019  ...  110.242.68.66:443  ...  OK
Connected to baidu.com.
Escape character is '^]'.

Doesn't work when using sudo proxychains apt update

tjuai% sudo proxychains apt update
[proxychains] config file found: /etc/proxychains.conf
[proxychains] preloading /usr/lib/libproxychains4.so
[proxychains] DLL init: proxychains-ng 4.16
[proxychains] DLL init: proxychains-ng 4.16
[proxychains] DLL init: proxychains-ng 4.16
[proxychains] DLL init: proxychains-ng 4.16
[proxychains] DLL init: proxychains-ng 4.16
0% [执行中][proxychains] Strict chain  ...  127.0.0.1:1080  ...  timeout
[proxychains] Strict chain  ...  127.0.0.1:1080  ...  timeout
[proxychains] Strict chain  ...  127.0.0.1:1080 忽略:1 https://mirrors.aliyun.com/ubuntu focal InRelease
0% [正在连接 mirrors.aliyun.com (224.0.0.1)] ...  timeout
忽略:2 https://mirrors.aliyun.com/ubuntu focal-security InRelease
0% [正在连接 mirrors.aliyun.com (224.0.0.1)] ...  timeout
忽略:3 https://mirrors.aliyun.com/ubuntu focal-updates InRelease
0% [正在连接 mirrors.aliyun.com (224.0.0.1)][proxychains] Strict chain  ...  127.0.0.1:1080  ...  timeout
忽略:4 https://mirrors.aliyun.com/ubuntu focal-proposed InRelease
忽略:5 https://mirrors.aliyun.com/ubuntu focal-backports InRelease
0% [执行中] ...  timeoutin  ...  127.0.0.1:1080 
[proxychains] Strict chain  ...  127.0.0.1:1080  ...  timeout
错误:6 https://mirrors.aliyun.com/ubuntu focal Release
  无法发起与 mirrors.aliyun.com:443 (224.0.0.1) 的连接 - connect (111: 拒绝连接)
0% [正在连接 mirrors.aliyun.com (224.0.0.1)] ...  timeout
错误:7 https://mirrors.aliyun.com/ubuntu focal-security Release
  无法发起与 mirrors.aliyun.com:443 (224.0.0.1) 的连接 - connect (111: 拒绝连接)
 ...  timeout                                   xychains] Strict chain  ...  127.0.0.1:1080 
错误:8 https://mirrors.aliyun.com/ubuntu focal-updates Release
  无法发起与 mirrors.aliyun.com:443 (224.0.0.1) 的连接 - connect (111: 拒绝连接)
错误:9 https://mirrors.aliyun.com/ubuntu focal-proposed Release
  无法发起与 mirrors.aliyun.com:443 (224.0.0.1) 的连接 - connect (111: 拒绝连接)
0% [执行中][proxychains] Strict chain  ...  127.0.0.1:1080  ...  timeout
错误:10 https://mirrors.aliyun.com/ubuntu focal-backports Release
  无法发起与 mirrors.aliyun.com:443 (224.0.0.1) 的连接 - connect (111: 拒绝连接)
0% [执行中][proxychains] Strict chain  ...  127.0.0.1:1080  ...  timeout
忽略:11 https://download.docker.com/linux/ubuntu focal InRelease
0% [执行中][proxychains] Strict chain  ...  127.0.0.1:1080  ...  timeout
错误:12 https://download.docker.com/linux/ubuntu focal Release
  无法发起与 download.docker.com:443 (224.0.0.1) 的连接 - connect (111: 拒绝连接)
0% [执行中][proxychains] Strict chain  ...  127.0.0.1:1080  ...  timeout
忽略:13 https://mirrors.ustc.edu.cn/ubuntu focal InRelease
 ...  timeout
 ...  timeout oxychains] Strict chain  ...  127.0.0.1:1080 
忽略:14 https://mirrors.ustc.edu.cn/ubuntu focal-updates InRelease
忽略:15 https://mirrors.ustc.edu.cn/ubuntu focal-backports InRelease
0% [执行中][proxychains] Strict chain  ...  127.0.0.1:1080  ...  timeout
忽略:16 https://mirrors.ustc.edu.cn/ubuntu focal-security InRelease
 ...  timeout
忽略:17 https://mirrors.ustc.edu.cn/ubuntu focal-proposed InRelease
0% [执行中][proxychains] Strict chain  ...  127.0.0.1:1080  ...  timeout
错误:18 https://mirrors.ustc.edu.cn/ubuntu focal Release
  无法发起与 mirrors.ustc.edu.cn:443 (224.0.0.1) 的连接 - connect (111: 拒绝连接)
 ...  timeout
错误:19 https://mirrors.ustc.edu.cn/ubuntu focal-updates Release
  无法发起与 mirrors.ustc.edu.cn:443 (224.0.0.1) 的连接 - connect (111: 拒绝连接)
0% [执行中][proxychains] Strict chain  ...  127.0.0.1:1080  ...  timeout
错误:20 https://mirrors.ustc.edu.cn/ubuntu focal-backports Release
  无法发起与 mirrors.ustc.edu.cn:443 (224.0.0.1) 的连接 - connect (111: 拒绝连接)
 ...  timeout
错误:21 https://mirrors.ustc.edu.cn/ubuntu focal-security Release
  无法发起与 mirrors.ustc.edu.cn:443 (224.0.0.1) 的连接 - connect (111: 拒绝连接)
0% [执行中][proxychains] Strict chain  ...  127.0.0.1:1080  ...  timeout
错误:22 https://mirrors.ustc.edu.cn/ubuntu focal-proposed Release
  无法发起与 mirrors.ustc.edu.cn:443 (224.0.0.1) 的连接 - connect (111: 拒绝连接)
[proxychains] DLL init: proxychains-ng 4.16
[proxychains] DLL init: proxychains-ng 4.16
[proxychains] DLL init: proxychains-ng 4.16
[proxychains] DLL init: proxychains-ng 4.16
[proxychains] DLL init: proxychains-ng 4.16
[proxychains] DLL init: proxychains-ng 4.16
[proxychains] DLL init: proxychains-ng 4.16
[proxychains] DLL init: proxychains-ng 4.16
[proxychains] DLL init: proxychains-ng 4.16
[proxychains] DLL init: proxychains-ng 4.16
[proxychains] DLL init: proxychains-ng 4.16
[proxychains] DLL init: proxychains-ng 4.16
[proxychains] DLL init: proxychains-ng 4.16
[proxychains] DLL init: proxychains-ng 4.16
正在读取软件包列表... 完成
E: 仓库 “https://mirrors.aliyun.com/ubuntu focal Release” 不再含有 Release 文件。
N: 无法安全地用该源进行更新,所以默认禁用该源。
N: 参见 apt-secure(8) 手册以了解仓库创建和用户配置方面的细节。
E: 仓库 “https://mirrors.aliyun.com/ubuntu focal-security Release” 不再含有 Release 文件。
N: 无法安全地用该源进行更新,所以默认禁用该源。
N: 参见 apt-secure(8) 手册以了解仓库创建和用户配置方面的细节。
E: 仓库 “https://mirrors.aliyun.com/ubuntu focal-updates Release” 不再含有 Release 文件。
N: 无法安全地用该源进行更新,所以默认禁用该源。
N: 参见 apt-secure(8) 手册以了解仓库创建和用户配置方面的细节。
E: 仓库 “https://mirrors.aliyun.com/ubuntu focal-proposed Release” 不再含有 Release 文件。
N: 无法安全地用该源进行更新,所以默认禁用该源。
N: 参见 apt-secure(8) 手册以了解仓库创建和用户配置方面的细节。
E: 仓库 “https://mirrors.aliyun.com/ubuntu focal-backports Release” 不再含有 Release 文件。
N: 无法安全地用该源进行更新,所以默认禁用该源。
N: 参见 apt-secure(8) 手册以了解仓库创建和用户配置方面的细节。
E: 仓库 “https://download.docker.com/linux/ubuntu focal Release” 不再含有 Release 文件。
N: 无法安全地用该源进行更新,所以默认禁用该源。
N: 参见 apt-secure(8) 手册以了解仓库创建和用户配置方面的细节。
E: 仓库 “https://mirrors.ustc.edu.cn/ubuntu focal Release” 不再含有 Release 文件。
N: 无法安全地用该源进行更新,所以默认禁用该源。
N: 参见 apt-secure(8) 手册以了解仓库创建和用户配置方面的细节。
E: 仓库 “https://mirrors.ustc.edu.cn/ubuntu focal-updates Release” 不再含有 Release 文件。
N: 无法安全地用该源进行更新,所以默认禁用该源。
N: 参见 apt-secure(8) 手册以了解仓库创建和用户配置方面的细节。
E: 仓库 “https://mirrors.ustc.edu.cn/ubuntu focal-backports Release” 不再含有 Release 文件。
N: 无法安全地用该源进行更新,所以默认禁用该源。
N: 参见 apt-secure(8) 手册以了解仓库创建和用户配置方面的细节。
E: 仓库 “https://mirrors.ustc.edu.cn/ubuntu focal-security Release” 不再含有 Release 文件。
N: 无法安全地用该源进行更新,所以默认禁用该源。
N: 参见 apt-secure(8) 手册以了解仓库创建和用户配置方面的细节。
E: 仓库 “https://mirrors.ustc.edu.cn/ubuntu focal-proposed Release” 不再含有 Release 文件。
N: 无法安全地用该源进行更新,所以默认禁用该源。
N: 参见 apt-secure(8) 手册以了解仓库创建和用户配置方面的细节。

Doesn't work when creating a new virtual environment. (It is another user so the port is 60189 rather 60019)

(base) nnn@tjuai:~$ proxychains conda create -n test_new python=3.8
[proxychains] config file found: /home/nnn/.proxychains/proxychains.conf
[proxychains] preloading /usr/lib/libproxychains4.so
[proxychains] DLL init: proxychains-ng 4.16
Collecting package metadata (current_repodata.json): - [proxychains] Dynamic chain  ...  127.0.0.1:60189  ...  172.18.245.137:808 [proxychains] Dynamic chain  ...  127.0.0.1:60189  ...  172.18.245.137:808 [proxychains] Dynamic chain  ...  127.0.0.1:60189  ...  172.18.245.137:808 [proxychains] Dynamic chain  ...  127.0.0.1:60189  ...  172.18.245.137:808 [proxychains] Dynamic chain  ...  127.0.0.1:60189 [proxychains] Dynamic chain  ...  127.0.0.1:60189  ...  172.18.245.137:808  ...  172.18.245.137:808 [proxychains] Dynamic chain  ...  127.0.0.1:60189  ...  172.18.245.137:808 [proxychains] Dynamic chain  ...  127.0.0.1:60189 [proxychains] Dynamic chain  ...  127.0.0.1:60189  ...  172.18.245.137:808  ...  172.18.245.137:808 [proxychains] Dynamic chain  ...  127.0.0.1:60189  ...  172.18.245.137:80- <--socket error or timeout!
<--socket error or timeout!
<--socket error or timeout!
<--socket error or timeout!
<--socket error or timeout!
<--socket error or timeout!
[proxychains] Dynamic chain  ...  127.0.0.1:60189  ...  172.18.245.137:808 [proxychains] Dynamic chain  ...  127.0.0.1:60189  ...  172.18.245.137:808 [proxychains] Dynamic chain  ...  127.0.0.1:60189 [proxychains] Dynamic chain  ...  127.0.0.1:60189  ...  172.18.245.137:808  ...  172.18.245.137:808 [proxychains] Dynamic chain  ...  127.0.0.1:60189 [proxychains] Dynamic chain  ...  127.0.0.1:60189  ...  172.18.245.137:808  ...  172.18.245.137:80\ <--socket error or timeout!
<--socket error or timeout!
<--socket error or timeout!
[proxychains] Dynamic chain  ...  127.0.0.1:60189  ...  172.18.245.137:808 [proxychains] Dynamic chain  ...  127.0.0.1:60189 [proxychains] Dynamic chain  ...  127.0.0.1:60189  ...  172.18.245.137:808  ...  172.18.245.137:808 <--socket error or timeout!
[proxychains] Dynamic chain  ...  127.0.0.1:60189  ...  172.18.245.137:80\ <--socket error or timeout!
<--socket error or timeout!
<--socket error or timeout!
<--socket error or timeout!
<--socket error or timeout!
<--socket error or timeout!
<--socket error or timeout!
<--socket error or timeout!
<--socket error or timeout!
<--socket error or timeout!                                                                                                                                                                                                                  \ [proxychains] Dynamic chain  ...  127.0.0.1:60189  ...  172.18.245.137:808 [proxychains] Dynamic chain  ...  127.0.0.1:60189  ...  172.18.245.137:808 [proxychains] Dynamic chain  ...  127.0.0.1:60189 [proxychains] Dynamic chain  ...  127.0.0.1:60189 [proxychains] Dynamic chain  ...  127.0.0.1:60189  ...  172.18.245.137:808  ...  172.18.245.137:808  ...  172.18.245.137:808 [proxychains] Dynamic chain  ...  127.0.0.1:60189  ...  172.18.245.137:808 [proxychains] Dynamic chain  ...  127.0.0.1:60189  ...  172.18.245.137:808 [proxychains] Dynamic chain  ...  127.0.0.1:60189 [proxychains] Dynamic chain  ...  127.0.0.1:60189  ...  172.18.245.137:808 [proxychains] Dynamic chain  ...  127.0.0.1:60189  ...  172.18.245.137:808  ...  172.18.245.137:80\ <--socket error or timeout!
<--socket error or timeout!
<--socket error or timeout!
<--socket error or timeout!
<--socket error or timeout!
<--socket error or timeout!
<--socket error or timeout!
<--socket error or timeout!
<--socket error or timeout!
<--socket error or timeout!                                                                                                                                                                                                                  \ [proxychains] Dynamic chain  ...  127.0.0.1:60189  ...  172.18.245.137:808 [proxychains] Dynamic chain  ...  127.0.0.1:60189  ...  172.18.245.137:808 [proxychains] Dynamic chain  ...  127.0.0.1:60189 [proxychains] Dynamic chain  ...  127.0.0.1:60189 [proxychains] Dynamic chain  ...  127.0.0.1:60189  ...  172.18.245.137:808 [proxychains] Dynamic chain  ...  127.0.0.1:60189  ...  172.18.245.137:808  ...  172.18.245.137:808  ...  172.18.245.137:808 [proxychains] Dynamic chain  ...  127.0.0.1:60189  ...  172.18.245.137:808 [proxychains] Dynamic chain  ...  127.0.0.1:60189  ...  172.18.245.137:808 [proxychains] Dynamic chain  ...  127.0.0.1:60189  ...  172.18.245.137:808 [proxychains] Dynamic chain  ...  127.0.0.1:60189  ...  172.18.245.137:80| <--socket error or timeout!
<--socket error or timeout!
<--socket error or timeout!
<--socket error or timeout!
<--socket error or timeout!
<--socket error or timeout!
<--socket error or timeout!
<--socket error or timeout!
<--socket error or timeout!
<--socket error or timeout!                                                                                                                                                                                                                  failed

ProxyError: Conda cannot proceed due to an error in your proxy configuration.
Check for typos and other configuration errors in any '.netrc' file in your home directory,
any environment variables ending in '_PROXY', and any other system-wide proxy
configuration settings.
rofl0r commented 10 months ago

sudo command most likely doesnt work correctly with proxychains. it's a setuid binary and glibc dynlinker restricts its use with LD_PRELOAD. try first sudo bash then in the new shell run proxychains4 apt upgrade or whatever. as for conda, you seem to have configured it to use a proxy, which likely makes it fail.