滚动 要闻 宏观 证券 产经 汽车 科技 评论 原创 地产 关注 生活 快讯

Kali Linux 配置系统代理

2023-07-02 16:29:14      来源:博客园


(资料图片仅供参考)

打开redsocks配置文件

vim /etc/redsocks.conf

修改配置文件

redsocks {        /* `local_ip" defaults to 127.0.0.1 for security reasons,         * use 0.0.0.0 if you want to listen on every interface.         * `local_*" are used as port to redirect to.         */        local_ip = 127.0.0.1;        local_port = 12345;        // `ip" and `port" are IP and tcp-port of proxy-server        // You can also use hostname instead of IP, only one (random)        // address of multihomed host will be used.        ip = 127.0.0.1;        port = 1080;        // known types: socks4, socks5, http-connect, http-relay        type = socks5;        // login = "foobar";        // password = "baz";}

将上面的ipport改成你代理服务的地址和端口,也就是把流量转发到哪里

启动redsocks,这一步每次开机都要弄一次

redsocks
#不重定向目的地址为服务器的包iptables -t nat -A OUTPUT -d *.*.*.* -j RETURN  #请用你的服务器的地址替换$SERVER_IP #不重定向私有地址的流量iptables -t nat -A OUTPUT -d 10.0.0.0/8 -j RETURNiptables -t nat -A OUTPUT -d 172.16.0.0/16 -j RETURNiptables -t nat -A OUTPUT -d 192.168.0.0/16 -j RETURN #不重定向保留地址的流量,这一步很重要iptables -t nat -A OUTPUT -d 127.0.0.0/8 -j RETURN #重定向所有不满足以上条件的流量到redsocks监听的12345端口iptables -t nat -A OUTPUT -p tcp -j REDIRECT --to-ports 12345 #12345是你的redsocks运行的端口,请根据你的情况替换它

请使用你的代理服务的ip地址替换...,然后在命令行执行这些语句

标签:

相关阅读

今日推荐
精选图文
48小时频道点击排行

Copyright @ 2008-2017   www.cjtx.042.cn   All Rights Reserved   财经天下周刊网 版权所有  关于我们 

联系我们:855 729 8@qq.com粤ICP备18023326号-5