# Enumeration - Certificate Authority

## Windows

### Native&#x20;

{% tabs %}
{% tab title="AD Module" %}
{% code overflow="wrap" %}

```powershell
# AD Module
Get-ADObject -Filter * -SearchBase 'CN=Certification Authorities,CN=Public Key Services,CN=Services,CN=Configuration,DC=security,DC=local'

Get-ADObject -LDAPFilter '(objectclass=certificationAuthority)' -SearchBase 'CN=Configuration,DC=security,DC=local' | fl *
```

{% endcode %}
{% endtab %}

{% tab title="ADSI" %}

```powershell
# Get-CertificationAuthority -SearchBase LDAP://CN=Configuration,DC=security,DC=local

function Get-CertificationAuthority {
    param([string]$searchBase = "LDAP://CN=Configuration,DC=security,DC=local")
    
    $directorySearcher = New-Object System.DirectoryServices.DirectorySearcher
    $directorySearcher.SearchRoot = New-Object System.DirectoryServices.DirectoryEntry($searchBase)
    $directorySearcher.Filter = "(objectclass=certificationAuthority)"
    $directorySearcher.PropertiesToLoad.Add("*") > $null
    
    try {
        $results = $directorySearcher.FindAll()
        foreach ($result in $results) {
            $properties = @{}
            foreach ($prop in $result.Properties.PropertyNames) {
                $properties[$prop] = $result.Properties[$prop][0]
            }
            
            $outputObj = New-Object PSObject -Property $properties
            Write-Output $outputObj
        }
    }
    catch {}
    finally {
        $results.Dispose()
    }
}
```

{% endtab %}
{% endtabs %}

### Certify

Github: <https://github.com/GhostPack/Certify>

```powershell
Certify.exe cas 
Invoke-Certify cas
```

<figure><img src="/files/ZzlgFOxMP21LlJymMXOq" alt=""><figcaption></figcaption></figure>

## Linux

### Certipy

Github: <https://github.com/ly4k/Certipy>

```python
certipy find -u <user> -p <password> -dc-ip 10.10.10.100 -stdout
```

<figure><img src="/files/eim7n23ckAZ5KOS0l8gH" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: 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://viperone.gitbook.io/pentest-everything/everything/everything-active-directory/adcs/enumeration-certificate-authority.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.
