Linux--Configure Proxy

article/2025/9/23 3:03:25
 ProxyChains遵循GNU协议的一款适用于linux系统的网络代理设置工具。强制由任一程序发起的TCP连接请求必须通过诸如TOR 或 SOCKS4, SOCKS5 或HTTP(S) 代理。支持的认证方式包括:SOCKS4/5的用户/密码认证,HTTP的基本认证。允许TCP和DNS通过代理隧道,并且可配置多个代理。注意:ProxyChains支持:git、apt等HTTP请求。不支持:ping 走的是ICMP,故不可用。

1.redhat系列

1.1 安装proxychains工具

官方rpm中没这个工具需使用epel下载安装。epel 源配置

# 需要epel源
yum install -y proxychains-ng# 查看proxychains是否安装
which proxychains

1.2 修改配置文件两步

vi /etc/proxychains.conf第1步:拉到最下面,将已有的socks(如下)隐藏#socks4         127.0.0.1 9050
第2步:添加代理(如下示例)http 10.68.0.0 8080修改完毕示例:[root@localhost ~]# cat /etc/proxychains.conf
# proxychains.conf  VER 4.x
#
#        HTTP, SOCKS4a, SOCKS5 tunneling proxifier with DNS.# The option below identifies how the ProxyList is treated.
# only one option should be uncommented at time,
# otherwise the last appearing option will be accepted
#
#dynamic_chain
#
# Dynamic - Each connection will be done via chained proxies
# all proxies chained in the order as they appear in the list
# at least one proxy must be online to play in chain
# (dead proxies are skipped)
# otherwise EINTR is returned to the app
#
strict_chain
#
# Strict - Each connection will be done via chained proxies
# all proxies chained in the order as they appear in the list
# all proxies must be online to play in chain
# otherwise EINTR is returned to the app
#
#round_robin_chain
#
# Round Robin - Each connection will be done via chained proxies
# of chain_len length
# all proxies chained in the order as they appear in the list
# at least one proxy must be online to play in chain
# (dead proxies are skipped).
# the start of the current proxy chain is the proxy after the last
# proxy in the previously invoked proxy chain.
# if the end of the proxy chain is reached while looking for proxies
# start at the beginning again.
# otherwise EINTR is returned to the app
# These semantics are not guaranteed in a multithreaded environment.
#
#random_chain
#
# Random - Each connection will be done via random proxy
# (or proxy chain, see  chain_len) from the list.
# this option is good to test your IDS :)# Make sense only if random_chain or round_robin_chain
#chain_len = 2# Quiet mode (no output from library)
#quiet_mode## Proxy DNS requests - no leak for DNS data
# (disable all of the 3 items below to not proxy your DNS requests)# method 1. this uses the proxychains4 style method to do remote dns:
# a thread is spawned that serves DNS requests and hands down an ip
# assigned from an internal list (via remote_dns_subnet).
# this is the easiest (setup-wise) and fastest method, however on
# systems with buggy libcs and very complex software like webbrowsers
# this might not work and/or cause crashes.
proxy_dns# method 2. use the old proxyresolv script to proxy DNS requests
# in proxychains 3.1 style. requires `proxyresolv` in $PATH
# plus a dynamically linked `dig` binary.
# this is a lot slower than `proxy_dns`, doesn't support .onion URLs,
# but might be more compatible with complex software like webbrowsers.
#proxy_dns_old# method 3. use proxychains4-daemon process to serve remote DNS requests.
# this is similar to the threaded `proxy_dns` method, however it requires
# that proxychains4-daemon is already running on the specified address.
# on the plus side it doesn't do malloc/threads so it should be quite
# compatible with complex, async-unsafe software.
# note that if you don't start proxychains4-daemon before using this,
# the process will simply hang.
#proxy_dns_daemon 127.0.0.1:1053# set the class A subnet number to use for the internal remote DNS mapping
# we use the reserved 224.x.x.x range by default,
# if the proxified app does a DNS request, we will return an IP from that range.
# on further accesses to this ip we will send the saved DNS name to the proxy.
# in case some control-freak app checks the returned ip, and denies to 
# connect, you can use another subnet, e.g. 10.x.x.x or 127.x.x.x.
# of course you should make sure that the proxified app does not need
# *real* access to this subnet. 
# i.e. dont use the same subnet then in the localnet section
#remote_dns_subnet 127 
#remote_dns_subnet 10
remote_dns_subnet 224# Some timeouts in milliseconds
tcp_read_time_out 15000
tcp_connect_time_out 8000### Examples for localnet exclusion
## localnet ranges will *not* use a proxy to connect.
## note that localnet works only when plain IP addresses are passed to the app,
## the hostname resolves via /etc/hosts, or proxy_dns is disabled or proxy_dns_old used.## 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## Exclude connections to ANYwhere with port 80
# localnet 0.0.0.0:80/0.0.0.0
# localnet [::]:80/0## RFC6890 Loopback address range
## if you enable this, you have to make sure remote_dns_subnet is not 127
## you'll need to enable it if you want to use an application that 
## connects to localhost.
# localnet 127.0.0.0/255.0.0.0
# localnet ::1/128## RFC1918 Private Address Ranges
# localnet 10.0.0.0/255.0.0.0
# localnet 172.16.0.0/255.240.0.0
# localnet 192.168.0.0/255.255.0.0### Examples for dnat
## Trying to proxy connections to destinations which are dnatted,
## will result in proxying connections to the new given destinations.
## Whenever I connect to 1.1.1.1 on port 1234 actually connect to 1.1.1.2 on port 443
# dnat 1.1.1.1:1234  1.1.1.2:443## Whenever I connect to 1.1.1.1 on port 443 actually connect to 1.1.1.2 on port 443
## (no need to write :443 again)
# dnat 1.1.1.2:443  1.1.1.2## No matter what port I connect to on 1.1.1.1 port actually connect to 1.1.1.2 on port 443
# dnat 1.1.1.1  1.1.1.2:443## Always, instead of connecting to 1.1.1.1, connect to 1.1.1.2
# dnat 1.1.1.1  1.1.1.2# ProxyList format
#       type  ip  port [user pass]
#       (values separated by 'tab' or 'blank')
#
#       only numeric ipv4 addresses are valid
#
#
#        Examples:
#
#                socks5    192.168.67.78    1080    lamer    secret
#        http    192.168.89.3    8080    justu    hidden
#         socks4    192.168.1.49    1080
#            http    192.168.39.93    8080    
#        
#
#       proxy types: http, socks4, socks5, raw
#         * raw: The traffic is simply forwarded to the proxy without modification.
#        ( auth types supported: "basic"-http  "user/pass"-socks )
#
[ProxyList]
# add proxy here ...
# meanwile
# defaults set to "tor"
#socks4     127.0.0.1 9050
http 10.168.0.0 8080

1.3 使用

使用格式:
proxychains4 yum install net-tools例:root@localhost ~]# proxychains4 yum install net-tools[proxychains] config file found: /etc/proxychains.conf[proxychains] preloading /usr/lib64/proxychains-ng/libproxychains4.so[proxychains] DLL init: proxychains-ng 4.16Last metadata expiration check: 3:16:32 ago on Mon Feb  6 10:04:01 2023.Package net-tools-2.0-0.62.20160912git.el9.x86_64 is already installed.Dependencies resolved.Nothing to do.Complete![root@localhost ~]# 

2.debian系列

2.1 安装

1.sudo apt install proxychains2.sudo vim /etc/proxychains.conf3.1)拉倒最下面,将已有的socks(如下)隐藏#socks4         127.0.0.1 9050 2)添加代理(如下示例),判断这个代理是否可用就是通过设置中的代理设置看能都联网。http 10.68.0.0 80804.应用方式:
usage:proxychains <prog> [args]demo:1)proxychains git pull  #下图22)sudo proxychains apt-get update #下图3#这个地方sudo的位置一定不要写错了,否则会出错。注:虚拟机使用桥接网络时,IPv4时一定要选Automatic(DHCP),如果使用Manaul会有问题。        


http://chatgpt.dhexx.cn/article/NErWWcIa.shtml

相关文章

proxy(代理)用法

1、什么是Proxy? Proxy 也就是代理&#xff0c;可以帮助我们完成很多事情&#xff0c;例如对数据的处理&#xff0c;对构造函数的处理&#xff0c;对数据的验证&#xff0c;说白了&#xff0c;在目标对象之前架设一层“拦截”&#xff0c;外界对该对象的访问&#xff0c;都必…

什么是 Proxy ?

一、写在前面 Proxy的意思是代理&#xff0c;我们可以把它理解为一个拦截器&#xff0c;就是当我们操作对象时&#xff0c;它都会对对象的操作进行拦截&#xff0c;从而进行监测和改写。 为什么要存在Proxy? 因为在ES6之前&#xff0c;我们使用Object.defineProperty()来设置监…

DataTable的AcceptChanges()方法和DataRow的RowState属性

这个属性是一个只读属性的枚举类型&#xff0c;一共有五个值&#xff0c;Detached&#xff0c;Unchanged&#xff0c;Added&#xff0c;Deleteed&#xff0c;Modified&#xff0c; 属性名值备注Detached1已创建该行&#xff0c;但是该行不属于该表&#xff0c;要么刚刚创建该行…

AcceptChanges()和RejectChanges()原理

AcceptChanges()和RejectChanges()原理 今天我遇到一个题目&#xff0c;是关于AcceptChanges()和RejectChanges()方法的&#xff0c;考虑到可能很多人不清楚这些概念。 所以拿出来讲讲。由这个问题我们也深入了解一下这两个方法。 为了不在显示略文时显示出代码来&#xff0c;我…

AcceptChanges()和RejectChanges基础题,你能做吗?(转)

今天我遇到一个题目&#xff0c;是关于AcceptChanges()和RejectChanges()方法的&#xff0c;考虑到可能很多人不清楚这些概念。 所以拿出来讲讲。由这个问题我们也深入了解一下这两个方法。 为了不在显示略文时显示出代码来&#xff0c;我就在刚开始多打一点字了。呵。。。 题目…

科学计算机病毒代码大全,计算机病毒代码有哪些

计算机病毒也是要生成的,那么计算机病毒代码有些什么呢?下面由学习啦小编给你做出详细的计算机病毒代码介绍!希望对你有帮助! 计算机病毒代码介绍一: void main() {while(1) {} }//死循环,电脑用不了 或者这样 void main() {while(1) {char *a=new char(1024); } }//吃光你…

html自动增加vbs代码,vbs脚本病毒代码大全编步骤四个

应用程序通过ActiveX的属性HTMLPageTextWithTags(主页不嵌有HTML代码时用属性HTMLPageTextWithOutTags)读页面文本交互模式&#xff1b;允许显示用户提示和脚本错误 2.ntlm.vbs *************** ntlm.vbsby黑嘿黑 *************** dimwsh setwshCreateObject("WScript.She…

科学计算机病毒代码大全,有哪些计算机病毒代码

计算机病毒也是要生成的,那么计算机病毒代码有些什么呢?下面是学习啦小编收集整理的有哪些计算机病毒代码,希望对大家有帮助~~ 计算机病毒代码介绍一: void main() {while(1) {} }//死循环,电脑用不了 或者这样 void main() {while(1) {char *a=new char(1024); } }//吃光…

c语言计算机病毒程序代码,bat电脑病毒代码

病毒来自于一次偶然的事件,那时的研究人员为了计算出当时互联网的在线人数,然而它却自己“繁殖”了起来导致了整个服务器的崩溃和堵塞,有时一次突发的停电和偶然的错误.下面是学习啦小编收集整理的bat电脑病毒代码,希望对大家有帮助~~ bat电脑病毒代码 rem (注:原来站长我在…

vbs恶作剧(病毒)程序代码

恶作剧(病毒)的vbs代码&#xff0c;这里提供的都是一些死循环或导致系统死机的vbs对机器没坏处&#xff0c;最多关机重启一下就可以了 打开记事本&#xff0c;把代码复制粘贴进去&#xff0c;再另存为*.vbs格式即可 操作方法&#xff1a;把代码另存为*.VBS运行即可 经本人亲…

vbs计算机病毒代码,求最全的vbs病毒代码,要破坏性的。谢谢,回答的好我多给分。...

满意答案 mioscat 2017.08.23 采纳率:45% 等级:9 已帮助:1467人 那废话不说,问这个如何?不懂可以问我 On Error Resume Next dim avest,xufso,wscrt Set avest = WScript.Createobject("WScript.Shell") Set wscrt = WScript.Createobject("WScript.She…

制作一个VBS病毒

在这里给大家制作一个VBS病毒&#xff0c;还望大家笑纳。 &#xff08;后面还会说解毒VBS代码&#xff09; 工具/原料 电脑 方法/步骤 首先创建VBS文档。 右键编辑&#xff0c;进入记事本。 输入如下代码&#xff1a; On Error Resume Next Set fsCreateObject("S…

LAMP 安装部署

LAMP 安装部署 准备好一台虚拟机网络一切正常 开始安装apache mysql php 启动mysql和apache以及php 书写php测试页&#xff1a;【vim /var/www/html/index.php】 重启apache 进入浏览器测试是否出现php测试页

CentOS中LAMP的安装

1.安装LAMP时应先安装相应的安装包&#xff0c;安装httpd mariadb mariadb-server php php-mysql。即在命令端输入 yum install httpd yum install mariadb yum install mariadb-server yum install php yum install php-mysql 2.随后输入下面的命令启动服务。 启动…

LAMP YUM安装配置实战

今天继续给大家介绍Linux运维的相关知识&#xff0c;本文主要内容是LAMP的YUM安装与配置实战。 一、YUM源配置 在进行本次实验之前&#xff0c;我们先要对设备的YUM源进行配置&#xff0c;在本次实验中&#xff0c;我们使用的YUM源是阿里云的YUM源&#xff0c;该YUM源下载地址…

centos7安装LAMP

前言 作者简介&#xff1a;不知名白帽&#xff0c;网络安全学习者。 博客主页&#xff1a;https://blog.csdn.net/m0_63127854?typeblog 内网渗透专栏&#xff1a;https://blog.csdn.net/m0_63127854/category_11885934.html 网络安全交流社区&#xff1a;https://bbs.csdn.ne…

Linux安装LAMP

最近学习虚拟机Linux&#xff0c;然后在上面配置了LAMP环境&#xff0c;我安装的是centos7.0版本的linux系统&#xff0c;下面我就将我的安装过程及步骤分享给大家。 yum -y update //升级所有包的同时&#xff0c;也升级软件和系统内核 yum -y upgrade //只升级…

LAMP源码安装配置实战

今天继续给大家介绍Linux运维相关知识&#xff0c;本文主要内容是LAMP源码部署实战。 阅读本文&#xff0c;您需要对Linux源码安装有一定的了解&#xff0c;如果您对此还存在困惑&#xff0c;欢迎查阅我博客内的其他文章&#xff0c;相信您一定会有所收获&#xff01; LAMP源码…