-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- 添加目录 - 使用 netsh 设置端口转发
- Loading branch information
Showing
1 changed file
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,16 @@ | ||
# 代理转发 | ||
|
||
- [代理转发](#代理转发) | ||
- [正向代理与反向代理](#正向代理与反向代理) | ||
- [正向代理(Forward Proxy)](#正向代理forward-proxy) | ||
- [反向代理(Reverse Proxy)](#反向代理reverse-proxy) | ||
- [Socks 协议](#socks-协议) | ||
- [使用 SSH 创建动态端口转发作 socks 代理](#使用-ssh-创建动态端口转发作-socks-代理) | ||
- [BurpSuit 挂内网主机的 socks 代理拦截本地 http 流量访问内网其他的服务](#burpsuit-挂内网主机的-socks-代理拦截本地-http-流量访问内网其他的服务) | ||
- [使用 netsh 设置端口转发](#使用-netsh-设置端口转发) | ||
|
||
--- | ||
|
||
> [内网渗透之代理转发 - FreeBuf网络安全行业门户](https://www.freebuf.com/articles/web/256415.html) | ||
当拿到一个主机的权限之后可以通过该主机向内网进行渗透, 不过由于该主机上不一定有渗透需要的工具以及若是直接远程连接到主机的话会留下明显的痕迹, 因此通过本地操作然后内网转发流量是比较稳妥的做法 | ||
|
@@ -176,3 +187,37 @@ ssh -fND localhost:12345 -i [私钥路径] [email protected] | |
|
||
--- | ||
|
||
## 使用 netsh 设置端口转发 | ||
|
||
`netsh(Network Shell)` 是 Windows 用于查看和修改本地计算机或远程计算机网络配置的命令行脚本工具, 被广泛应用于配置网络接口, 防火墙规则, IP地址, 路由规则等多种网络相关的设置 | ||
|
||
可以使用 netsh 来配置端口转发, 结合如下场景演示: | ||
|
||
```mermaid | ||
graph TB | ||
subgraph 本地主机 | ||
A((Local Host-连接)) | ||
end | ||
subgraph 本地主机可以访问到的一台Windows主机 | ||
B((Transport Host<br>转发本地listenprot到<br>Remote Host connectport)) | ||
end | ||
subgraph Transport Host 可以访问到的目标远程Linux主机 | ||
C((Remote Host<br>connectport上有SSH服务)) | ||
end | ||
A -->|SSH Connection <br>-> listenport| B --> C | ||
``` | ||
|
||
```powershell | ||
netsh interface portproxy add v4tov4 listenport=[本地端口] listenaddress=0.0.0.0 connectport=[远程端口] connectaddress=[内网Linux设备的IP] | ||
``` | ||
|
||
这样就可以在 Local Host 上直接 SSH 到 Transport Host 的 listenport 来连接 Remote Host 上的 SSH 服务了 | ||
|
||
|
||
|
||
|
||
|