Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Name mismatch between certificate and user even though they match #34

Closed
tmoney11 opened this issue Mar 5, 2022 · 6 comments
Closed

Comments

@tmoney11
Copy link

tmoney11 commented Mar 5, 2022

So I've got a few certs identified with ESC1 possible and I'm able to request certificate with -alt otheruser and output looks like this:

[+] Trying to resolve 'CA.FULL.DOMAIN.COM' at '192.168.1.101'
[*] Requesting certificate
[+] Trying to resolve dynamic endpoint '91AE6020-xxxxxx'
[+] Resolved dynamic endpoint '91AE6020-xxxxx' to 'ncacn_ip_tcp:192.168.1.101[59431]'
[+] Trying to connect to endpoint: ncacn_ip_tcp:192.168.1.101[59431]
[+] Connected to endpoint: ncacn_ip_tcp:192.1681.101[59431]
[*] Successfully requested certificate
[*] Request ID is 5063
[*] Got certificate with UPN 'otheruser'
[*] Saved certificate and private key to 'otheruser.pfx'

However, when I run:
certipy auth -pfx otheruser.pfx -username 'otheruser' -domain 'full.domain.com' -dc-ip 192.168.1.100 I get:

[*] Using principal: otheruser@full.domain.com
[*] Trying to get TGT...
[-] Name mismatch between certificate and user otheruser'
[-] Verify that the username 'otheruser' matches the certificate UPN: otheruser

CA Server is 2016. I've tried multiple vulnerable certs as well as just running without the alt flag but no luck.

@ly4k
Copy link
Owner

ly4k commented Mar 8, 2022

Can you try to request the ESC1 with -alt 'otheruser@full.domain.com' instead?

@ly4k ly4k closed this as completed Mar 11, 2022
@vysecurity
Copy link

Did you ever figure this one out? It's still having this issue now.

@Cyb3rGh0st786
Copy link

Cyb3rGh0st786 commented Oct 25, 2022

Same for me as well. Also, in the latest version, there is no -alt flag, I guess

@ly4k would you please help with this?

@ly4k
Copy link
Owner

ly4k commented Oct 25, 2022

Hello. The newest version contains the -upn flag to specify a UPN. Please try to specify the UPN as user@domain rather than just user.

Best regards

@noraj
Copy link

noraj commented Apr 15, 2024

There is no -alt or -upn or -dns option for certipy auth command.

Something like that.

➜ certipy auth -pfx dc_machine_account.pfx -dc-ip 10.0.0.1       
Certipy v4.8.2 - by Oliver Lyak (ly4k)

[*] Using principal: dc_machine_account$@acme.local
[*] Trying to get TGT...
[-] Name mismatch between certificate and user 'dc_machine_account$'
[-] Verify that the username 'dc_machine_account$' matches the certificate DNS Host Name: dc_machine_account.acme.local

@noraj
Copy link

noraj commented Apr 15, 2024

Same mismatch error with impacket directly:

➜ gettgtpkinit -cert-pfx $(pwd)/dc_machine_account.pfx -pfx-pass '' -dc-ip 10.0.0.1 'acme.local/dc_machine_account$' dc_machine_account.tgt               
2024-04-15 15:46:29,807 minikerberos INFO     Loading certificate and key from file
INFO:minikerberos:Loading certificate and key from file
2024-04-15 15:46:29,867 minikerberos INFO     Requesting TGT
INFO:minikerberos:Requesting TGT
Traceback (most recent call last):
  File "/usr/share/pkinittools/gettgtpkinit.py", line 349, in <module>
    main()
  File "/usr/share/pkinittools/gettgtpkinit.py", line 345, in main
    amain(args)
  File "/usr/share/pkinittools/gettgtpkinit.py", line 315, in amain
    res = sock.sendrecv(req)
          ^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/minikerberos/network/clientsocket.py", line 85, in sendrecv
    raise KerberosError(krb_message)
minikerberos.protocol.errors.KerberosError:  Error Name: KDC_ERR_CLIENT_NAME_MISMATCH Detail: "Error message not found! Err code: 75"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants