内网攻防:如何利用防火墙创建VPN进入内网
mportant; overflow-wrap: break-word !important;">
资产空间测绘
想复现的话,采用的fofa语句如下
app="HUAWEI-USG防火墙" && country!="CN"
系统登录

一般情况下,可以使用下面的用户密码登录,如果不是的话需要自己想办法
Console口登录:
admin/Admin@123
Telnet登录:
admin/Admin@123
Web网管登录(审计管理员):
audit-admin/Admin@123
Web网管登录(系统管理员):
admin/Admin@123
附上nuclei的admin默认口令检测脚本
id: huaweiUsgpass
info:
name: Template Name
author: ww
severity: high
description: 华为防火墙admin默认口令Admin@123
reference:
- https://
tags: tags
http:
- raw:
- |-
POST /default.html?dc=1730741842465 HTTP/1.1
Host: {{Hostname}}
Cookie: SESSIONID=UgEAAHlDcN4S7NrZzQP7oDZsi250Q83H3O5Pz3XTK2E=&UgEAALQ0Jwl5zoLpl8s3Ew==&HUAWEI &langfrombrows=zh-CN©right=2014-2022
Content-Length: 128
Sec-Ch-Ua: "Not/A)Brand";v="8", "Chromium";v="125", "Google Chrome";v="125"
Accept-Language: zh-CN
Sec-Ch-Ua-Mobile: ?0
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Accept: */*
X-Requested-With: XMLHttpRequest
Sec-Ch-Ua-Platform: "Linux"
Origin: https://127.0.0.1:8443
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: cors
Sec-Fetch-Dest: empty
Referer: https://127.0.0.1:8443/
Accept-Encoding: gzip, deflate, br
X-Forwarded-For: 127.0.0.1
X-Originating-Ip: 127.0.0.1
X-Remote-Ip: 127.0.0.1
X-Remote-Addr: 127.0.0.1
Priority: u=1, i
Connection: keep-alive
spring-security-redirect=&language=zh_CN&username=YWRtaW4%3D&password=QWRtaW5AMTIz&isLogin=true&platcontent=&platcontentConfirm=
matchers-condition: and
matchers:
- type: word
part: header
words:
- ''
- type: status
status:
- 200
使用admin用户登录防火墙进行VPN配置


VPN配置步骤
探测内外网IP
点击<font style="color:rgba(55,202,168,1);">网络</font>
,打开网络选项界面

在<font style="color:rgba(55,202,168,1);">接口</font>
页面(打开网络选项界面之后默认跳转的就是接口页面) 中查看对应内网IP地址和外网的IP地址(机器的公网IP地址),并查看其对应的接口。通过这些IP我们可以先大致理清楚内网中的网络地址端以及目标的大体网络框架

比如这里就可以知道内网的大体信息,0口为192.168.0.1端、6口为192.168.30.1、10口为192.168.1.1,其中9口的untrust区就是该机器的公网IP。之后进入内网就有主要网段可以fscan了
配置策略
点击<font style="color:rgba(55,202,168,1);">策略</font>
,打开策略配置界面

找到<font style="color:rgba(55,202,168,1);">安全策略</font>
选项

点击<font style="color:rgba(55,202,168,1);">新建安全策略</font>

此处源安全区域设为:<font style="color:rgba(55,202,168,1);">untrust</font>
,目的安全区域设为:<font style="color:rgba(55,202,168,1);">local</font>
没有特殊标明的随便写就行

然后点击目的地址/地区

使用新建
功能的新建地址
功能

然后配置本防火墙的公网IP,IP地址设置为当前公网IP/32,如果这里已经有了,那就不用配置了

配置完成后点击确定创建配置,在地址选项中选择我们刚刚创建的

VLAN ID用默认的即可

同样的,在服务
功能中使用新建
功能的新建自定义服务
创建我们需要的服务


此处端口设置一个未使用的端口,剩下的随意,注意不要和原本的服务名重了




然后选择刚刚创建的服务

剩下的一般情况下默认即可

最后点击确定
创建策略


现在按照刚刚的步骤再创建一个安全策略,只需要配置源安全区域设为:trust
,目的安全区域设为:untrust
,确认即可。这个一般情况下运维都会建,先检查一下是否存在,如果存在就不比创建了

发现设备上原来就存在该规则

检查规则内容也符合要求

配置网关
打开网络
界面

找到SSL VPN
功能选项

使用新建
功能

此处网关名称随便设置,网关地址设置为第一步当中公网IP对应的接口(看前面公网IP绑定的接口),端口设置为第二步自定义服务当中的目的端口(比如我前面写的是40199,哪么这里就是40199)


SSL版本全选,剩下都默认

这里勾选网络扩展然后下一步

此处配置可分配IP,也就是你连接VPN服务器分配给你本机的IP,此处尽量选择第一步内网IP网段外的IP填写(比如我发现前面防火墙0口为192.168.0.1端、6口为192.168.30.1、10口为192.168.1.1,哪么我这里就可以给自己分配192.168.8.1-192.168.8.254/24)

另外新建网段
新建同内网IP下的网段即可,比如这里可以写192.168.212.1/24


完整配置如下图

最后一步,授权角色启用网络扩展

创建用户
这里在default按照下图创建用户即可
打开对象
界面

选择用户
功能下的default
选项

先把场景勾选如下图,然后点击新建
选择新建用户


然后检查配置

鼠标滑倒最底下,点击应用
,使我们刚刚的配置生效

连接
打开Secoclient(如果没有Secoclient,可以关注公众号回复Secoclient
获取),建议使用Windows客户端,Linux的用着不舒服

添加连接配置

配置如下:连接名称即远程网关地址和端口和第四步网关配置相同

选择我们刚刚创建的配置

连接上服务器,现在输入我们创建的用户登录即可


记得忽略证书警告,认证成功后就直接进入了内网

比如上面的分配IP段的时候是192.168.8.1-192.168.254/24,哪么我连上VPN之后我的IP自然就是这个网段的

之后直接梭哈内网就完事了
本文链接:https://www.kinber.cn/post/3937.html 转载需授权!
推荐本站淘宝优惠价购买喜欢的宝贝: