【proxychains4】虚拟机内kali走主机代理

news2024/9/20 19:13:31

文章目录

  • 简介
  • 安装
  • 配置
  • 使用测试

简介

ProxyChains是Linux和其他Unix下的代理工具。 它可以使任何程序通过代理上网, 允许TCP和DNS通过代理隧道, 支持HTTP、 SOCKS4和SOCKS5类型的代理服务器, 并且可配置多个代理。 ProxyChains通过一个用户定义的代理列表强制连接指定的应用程序, 直接断开接收方和发送方的连接。ProxyChains 是一个强制应用的 TCP 连接通过代理的工具,支持 Tor、HTTP、与 Socks 代理。ProxyChains 只会将当前应用的 TCP 连接转发至代理,而非全局代理。

安装

通过 apt 包管理工具安装

sudo apt install proxychains4

配置

在windows主机中

打开系统的代理设置,开启自动检测设置
在这里插入图片描述

将主机网络与虚拟机网络共享

现在我使用的是WLAN模式 所以我设置的是WLAN属性,虚拟机使用VM8(NAT)

在这里插入图片描述

打开代理软件
本地代理 允许来自局域网连接

在这里插入图片描述

在kali中

找到/etc/proxychains4.conf文件进行修改

sudo vim /etc/proxychains4.conf

将proxychains4.conf文件中的dynamic_chain前面的注释符’#‘取消,在strict_chain前面加上注释符’#’

下翻到最后一行,修改代理设置即可
#socks4 127.0.0.1 9050
socks5 10.133.40.227 7890

# 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
socks5 10.133.40.227 7890

简单介绍各配置项用法:

#dynamic_chain:

#每个连接都将通过链接代理完成
#所有代理按列表中显示的顺序链接
#至少有一个代理必须在线才能使用
#(跳过死的代理)

#strict_chain:该配置为ProxyChains的默认配置,同dynamic_chain一样,但所有代理必须正常,否则不能正常使用

#random_chain:该配置项会从ProxyList中随机选择代理IP来运行流量,如果ProxyList中有多个代理IP,在使用proxychains的时候会使用不同的代理访问目标主机,从而使主机端探测流量更加困难。

使用测试

在终端命令输入 proxychains4 软件名

注意 不要使用ping命令来测试,因为SOCKS协议并不支持ICMP包。

sudo proxychains4 git clone ...
sudo  git clone ...
对比速度即可

proxychains4 apt-get
proxychains4 docker
proxychains4 firefox

也可以在命令行输入命令查询ip是否已经属于代理IP

proxychains4 curl ip.gs
curl ip.gs

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/693605.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

数据结构--单链表的定义

数据结构–单链表的定义 本节的学习目标: 单链表的定义(如何用代码实现) 优点:不要求大片连续空间,改变容量方便 缺点:不可随机存取,要耗费一定空间存放指针 代码实现 struct LNode {ElemType data; //数据域stru…

vcruntime140.dll,丢失如何修复,vcruntime140.dll,丢失修复详细办法(有效的方法)

今天打开photoshop软件的时候,突然间就打不开,电脑报错由于找不到vcruntime140.dll,无法继续执行此代码,然后我就把photoshop卸载了,再重新安装,依然还是报错。这个可怎么办?vcruntime140.dll如…

C++【day1】

练习 定义一个命名空间Myspace&#xff0c;包含以下函数&#xff1a;将一个字符串中的所有单词进行反转&#xff0c;并输出反转后的结果。 #include <iostream> #include<iomanip>using namespace std;namespace Myspace { void reversal(string *str); }void My…

CW32L083不同主频功耗测试

本文主要介绍CWL083VCT6芯片在不同主频下的功耗测试方法和测试结果。 1.HSIOSC时钟 HSIOSC 时钟由内部 RC 振荡器产生&#xff0c;不需要外部电路&#xff0c;比 HSE 时钟的成本低&#xff0c;启动速度快。HSIOSC 时钟频率固定为 48MHz&#xff0c;频率精度低于 HSE 时钟。RC …

《计算机系统与网络安全》 第二章 计算机网络基础与TCPIP协议安全性

&#x1f337;&#x1f341; 博主 libin9iOak带您 Go to New World.✨&#x1f341; &#x1f984; 个人主页——libin9iOak的博客&#x1f390; &#x1f433; 《面试题大全》 文章图文并茂&#x1f995;生动形象&#x1f996;简单易学&#xff01;欢迎大家来踩踩~&#x1f33…

苹果app用发布证书打包后怎么装手机测试

一、背景 iOS 的开发证书打包后可以通过爱思助手安装到手机上测试&#xff0c;但发布 (Production) 证书是不允许安装在手机上的。而在实际开发过程中&#xff0c;尽管通过开发证书测试过了&#xff0c;iOS生产包仍然可能会出现一些问题&#xff0c;需对生产包也进行测试。 而…

【Stable diffusion教程】AutoDL云部署超详细步骤说明【外婆都会】

1 AutoDL云端部署操作流程 1.1 登录/注册 官网&#xff1a;https://www.autodl.com/home&#xff0c;点击右上角登录/注册。此处我已经注册了 如果你是学生的话&#xff0c;注册完之后&#xff0c;进入控制台&#xff0c;在右上角点一下学生认证&#xff0c;然后你就可以享受…

23.6.24

1、grep&#xff1a;查找字符串 grep 字符串 文件名 -w:按单词查找 -R:实现递归查找&#xff0c;主要用于路径是目录的情况 -i:不区分大小写 -n:显示行号 grep -w "^ubuntu" /etc/passwd ---->查找以ubuntu单词作为开头位置的所在行 grep -w "ubuntu$"…

html简单实现b站评论回车发布

头像&#xff1a; <!DOCTYPE html> <html lang"en"><head><meta charset"UTF-8"><meta http-equiv"X-UA-Compatible" content"IEedge"><meta name"viewport" content"widthdevice-wi…

Linux系统:进程概念

文章目录 1 操作系统1.1 概念1.2设计操作系统的目的 2进程2.1 进程是什么2.2 如何管理进程2.2查看进程2.3 程序中获取自己的pid2.4 创建一个进程2.5 进程状态2.6 进程优先级2.6.1为什么要有优先级2.6.2 什么是优先级2.6.3 linux下优先级的做法 2.8 其他概念 3进程地址空间3.1 初…

基于Docker环境下的Jenkins搭建及使用

目录 前言&#xff1a; Docker下安装Jenkins 启动Jenkins Jenkins插件下载 配置Jenkins 修改Jenkins时间 配置Python3环境 配置HTML报告/Allure报告 Allure报告配置 简单使用-实例构建 参数化构建 构建后操作 配置成功 控制台输出 Allure报告查看 HTML报告查看 前言&#xff1a…

macOS上下载安装Kibana并连接ES

下载Kibana 执行以下命令进行&#xff0c;版本号根据你所用的ES版本选择&#xff0c;比如我的是7.10.0 curl -O https://artifacts.elastic.co/downloads/kibana/kibana-7.10.0-darwin-x86_64.tar.gz解压安装Kibana tar -zxvf kibana-7.10.0-darwin-x86_64.tar.gz进行config…

Visual modflow Flex地下水数值模拟

专题一 地下水数值软件的操作流程、建模步骤和所需资料处理及相关注意事项 [1] Visual MODFLOW Flex特征 [2] Visual MODFLOW Flex软件界面及模块 [3] 地下水数值模拟的建模步骤及数据需求 专题二 模型建模操作方法 技巧、真实案例演练、特殊问题处理 [1] 直接模型建模的操…

【信号】信号处理与进程通信:快速上手

目录 0. 信号概述 1. 产生信号的方式&#xff1a; 1.1 当用户按某些终端键时&#xff0c;将产生信号。 1.2 硬件异常将产生信号。 1.3 软件异常将产生信号。 1.4 调用kill函数将发送信号。 1.5 运行kill命令将发送信号。 2. 信号的默认&#xff08;缺省&#xff09;处理…

用for循环----输出0-999的水仙数

输出0-999的水仙数 水仙算法&#xff1a;一个数它各位的立方和&#xff0c; 例如&#xff1a;1531*1*15*5*53*3*3 提示&#xff1a;for循环&#xff0c;求余数(%)取整&#xff08;/&#xff09;运算符。 答案&#xff1a; 代码如下&#xff1a; #include <stdio.h> …

物理备份xtrabackup

物理备份xtrabackup Xtrabackup 是一个开源的免费的热备工具&#xff0c;在 Xtrabackup 包中主要有 Xtrabackup 和innobackupex 两个工具。其中Xtrabackup 只能备份 InnoDB 和 XtraDB 两种引擎; innobackupex则是封装了Xtrabackup&#xff0c;同时增加了备份MyISAM引擎的功能。…

STM32开发——智能小车(循迹、避障、测速)

目录 1.循迹小车 1.1CubeMX配置 1.2函数代码 2.避障小车 3.小车测速 1.循迹小车 需求&#xff1a;用左右轮实现PWM调速、红外传感器获取道路信息改变方向。 左边红外D0——PB12 右边红外D0——PB13 1.1CubeMX配置 1.2函数代码 motor.c代码 #include "gpio.h"…

TCP三挥四握

TCP三挥四握 TCP最关键的三个步骤&#xff1a;建立连接、数据传输、释放连接&#xff0c;这里的三次握手实现的是服务端和客户端建立连接&#xff1b;四次握手实现的是服务端和客户端释放连接。 三次握手&#xff1a; 建立数据连接 TCP连接需要三次握手的原因&#xff1a; 三次…

【Free】基于主从博弈的主动配电网阻塞管理

目录 1 主要内容 程序亮点 2 部分代码 3 程序结果 4 下载链接 1 主要内容 《基于主从博弈的主动配电网阻塞管理》文献介绍&#xff1a;主要采用一种配电网节点边际电价统一出清的主从博弈双层调度框架。上层框架解决用户在负荷聚合商引导下的用电成本最小化问题&#xff0…

力扣题库刷题笔记18--四数之和

1、题目如下&#xff1a; 2、个人Python代码实现&#xff1a; 首先看到这题就会想到两种方式&#xff0c;一是四层循环暴力破解&#xff0c;二就是基于前面的三数之和外面加加一层嵌套。 先看一下暴力破解&#xff1a; 这里可以看到&#xff0c;当数据量足够大时&#xff0c;依…