全局代理工具 proxychains

2022-11-12  本文已影响0人  薄荷盐

ProxyChains 遵循GNU协议的一款适用于linux系统的网络代理设置工具。强制由任一程序发起的TCP连接请求必须通过诸如TOR 或 SOCKS4, SOCKS5 或HTTP(S) 代理。支持的认证方式包括:SOCKS4/5的用户/密码认证,HTTP的基本认证。允许TCP和DNS通过代理隧道,并且可配置多个代理。
这是主要介绍 proxychains-ng,是 proxychains 的增强版。
项目地址:https://github.com/rofl0r/proxychains-ng

安装部署

下载最新版:proxychains-ng-4.16.tar.xz

编译安装

# 解压
tar xf proxychains-ng-4.16.tar.xz &&  cd proxychains-ng-4.16
./configure --prefix=/usr --sysconfdir=/etc
make && make install
# 安装proxychains.conf配置文件
make install-config

修改配置

/etc/proxychains.conf

# 找到 [ProxyList],在其后面添加代码服务器配置:
[ProxyList]
# add proxy here ...
# meanwile
# defaults set to "tor"
socks5 172.18.0.17 9253

使用

telnet 测试

[root@VM-1-11-centos ~]# telnet cip.cc 80
Trying 81.68.78.216...
[root@VM-1-11-centos ~]# proxychains4 telnet cip.cc 80
[proxychains] config file found: /etc/proxychains.conf
[proxychains] preloading /usr/lib/libproxychains4.so
[proxychains] DLL init: proxychains-ng 4.16
Trying 224.0.0.1...
[proxychains] Strict chain  ...  172.18.0.17:9253  ...  cip.cc:80  ...  OK
Connected to cip.cc.
Escape character is '^]'.
^CConnection closed by foreign host.

curl 测试

[root@VM-1-11-centos ~]# curl cip.cc
^C
[root@VM-1-11-centos ~]# proxychains4 curl cip.cc
[proxychains] config file found: /etc/proxychains.conf
[proxychains] preloading /usr/lib/libproxychains4.so
[proxychains] DLL init: proxychains-ng 4.16
[proxychains] Strict chain  ...  172.18.0.17:9253  ...  cip.cc:80  ...  OK
IP  : 43.138.26.1
URL : http://www.cip.cc/43.138.26.1

排除内网流量

## Exclude connections to 192.168.1.0/24 with port 80
# localnet 192.168.1.0:80/255.255.255.0
## Exclude connections to 192.168.100.0/24
# localnet 192.168.100.0/255.255.255.0
localnet 172.18.1.0/255.255.255.0
## Exclude connections to ANYwhere with port 80
# localnet 0.0.0.0:80/0.0.0.0
# localnet [::]:80/0
上一篇 下一篇

猜你喜欢

热点阅读