> For the complete documentation index, see [llms.txt](https://abdulazim.gitbook.io/write-up/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://abdulazim.gitbook.io/write-up/hacksmarter-write-up/martiniad.md).

# MartiniAD

Active Directory Penetration Testing-Easy Rate

#### Step 1- Nmap Reconnaisance

<figure><img src="https://2918211013-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJAG015FJfI6GuIB6PzJ6%2Fuploads%2FKN1MSYp6idSCca3f9D4H%2Fnmap%20result.png?alt=media&amp;token=d608846b-f117-4a0f-abf8-e263529d5d11" alt=""><figcaption></figcaption></figure>

#### Step 2- SMB share file enumeration

<figure><img src="https://2918211013-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJAG015FJfI6GuIB6PzJ6%2Fuploads%2FYMonHxqZcTokbiNguzTi%2Fenumerate%20shares%20file.%20found%20notes%20shared%20file%20using%20guest%20user.png?alt=media&amp;token=cdfde2bb-a27f-4b59-8fc1-7839b1458fb1" alt=""><figcaption></figcaption></figure>

Found share file that have "read, write" permissions.

<figure><img src="https://2918211013-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJAG015FJfI6GuIB6PzJ6%2Fuploads%2Fv7gY2CtjyKGZOrI3mY6K%2Fconnecting%20to%20smb%20shares.png?alt=media&amp;token=55e55f6d-2d19-4ffd-bb02-bfbf6265330f" alt=""><figcaption></figcaption></figure>

Connecting to smb shared file specific notes folder. the "notes.txt" file can be download and view also.

<figure><img src="https://2918211013-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJAG015FJfI6GuIB6PzJ6%2Fuploads%2Fs6YuG1XzpT4atsDILnNr%2Ffound%20password%20inside%20share%20notes..png?alt=media&amp;token=1705afde-21ea-469a-9d5c-c0b88d844b18" alt=""><figcaption></figcaption></figure>

Found credential.

#### Step 3 Validate credential and kerberoasting

<figure><img src="https://2918211013-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJAG015FJfI6GuIB6PzJ6%2Fuploads%2FmOELT0L3rwcKMFw87llU%2Fenumerate%20mprice%20user%20shares.png?alt=media&amp;token=b14f4624-8203-46ee-9bd0-5d558c11653b" alt=""><figcaption></figcaption></figure>

Here, we can validate the creds is valid.

<figure><img src="https://2918211013-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJAG015FJfI6GuIB6PzJ6%2Fuploads%2FGivX1F7Ih5CBbEyukHem%2Frunning%20kerberoasting%20attack%20via%20ldap%20reteurn%20service%20ticket%20user%20ATHENA_SVC.png?alt=media&amp;token=f249686a-0c39-47c4-961e-848240600e78" alt=""><figcaption></figcaption></figure>

Run kerberoasting attack via ldap return one valid account called ATHENA\_SVC. Saved the krbtgt hash inside kerb.hash file.

#### Step 4 cracked krtbgt hash using Hashcat

<figure><img src="https://2918211013-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJAG015FJfI6GuIB6PzJ6%2Fuploads%2FFnnOMEvMf7KvCRPFRPpb%2Fcracked%20kerb%20hash.png?alt=media&amp;token=2376b0b1-7793-4c2f-ac5d-a9a6906fbf2d" alt=""><figcaption></figcaption></figure>

Hashcat successful crack the kerb hash.

#### Step 5 Enumerate other user and expanding access.

<figure><img src="https://2918211013-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJAG015FJfI6GuIB6PzJ6%2Fuploads%2FGmk7xwHissPs1wsiMc4C%2Fbrute%20force%20rid%20for%20enumerate%20user.png?alt=media&amp;token=75a82e65-e968-4c35-a5d9-fa72d7984627" alt=""><figcaption></figcaption></figure>

Can brute force rid to enumerate other user. also can use command "--users-export user.txt"

List below is the other user inside the domain.

```
Administrator
Guest
Krbtgt
mprice
athena.t0
ATHENA_SVC
DC01$
```

#### Step 6 Adding domain dns and dns computer name inside hosts.

<figure><img src="https://2918211013-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJAG015FJfI6GuIB6PzJ6%2Fuploads%2FV1khCxfp76yT7RoTLfoN%2Fimage.png?alt=media&amp;token=3525065d-2124-478f-a3d7-9221600b15b9" alt=""><figcaption></figcaption></figure>

This is the outcome after running this command:

```
nxc smb 10.1.16.162 -u ""-p '' --generate-hosts-file hosts
```

or can manually add it at /etc/hosts

#### Step 7 Spray Attack

<figure><img src="https://2918211013-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJAG015FJfI6GuIB6PzJ6%2Fuploads%2FnG1q67UtcRDag3s4gX8j%2Fimage.png?alt=media&amp;token=823543c8-ab2f-4217-ade6-ff854a31abc4" alt=""><figcaption></figcaption></figure>

using the other user that we found and cracked kerb hash, found Domain Admin account.

#### Step 8 Dump the NTDS database and krbtgt hash

<figure><img src="https://2918211013-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJAG015FJfI6GuIB6PzJ6%2Fuploads%2FgVucmemSfpw3NrESlYr2%2Fimage.png?alt=media&amp;token=e9db7165-276e-46dc-afb0-46110bf0ed5d" alt=""><figcaption></figcaption></figure>

Successfully dump the NTDS and krbtgt. With this hash we can forge golden ticket even the password for this user is already change.
