Skip to content

Kerberos authentication failure (GSSAPI) due to lowercase Realm in generated ccache #1

@Byxs20

Description

@Byxs20

Case-Sensitivity Issue in keycred-Generated ccache Files

I have identified a case-sensitivity issue in the ccache files generated by keycred. When using a ticket generated by keycred for Kerberos authentication (e.g., via evil-winrm), authentication fails with a GSSAPI error.

Upon investigation, the root cause appears to be that keycred saves the Service Principal Name (SPN) with a lowercase realm/domain, whereas other tools (like certipy) and Windows Kerberos expectations require it to be uppercase.

Comparison & Debugging
keycred output (Fails)

Service Principal: krbtgt/absolute.htb@ABSOLUTE.HTB (lowercase domain)

Result:

SpnegoError: Unspecified GSS failure. Minor code: Matching credential not found.

certipy output (Works)

Service Principal: krbtgt/ABSOLUTE.HTB@ABSOLUTE.HTB (uppercase domain)

Result:

Authentication successful.

klist Analysis
Image

This output highlights the difference in klist -c where the service principal realm casing differs.

Error Comparison
Image

Left side shows the GSS failure with the lowercase realm; right side shows successful authentication with uppercase.

Environment

Operating System: Kali Linux
Target: Windows Active Directory (HTB Absolute)
Authentication Method: Kerberos via evil-winrm -k

Expected Behavior

The ccache should be generated with the Service Principal realm in uppercase (e.g., krbtgt/REALM.LOCAL@REALM.LOCAL) to ensure compatibility with GSSAPI credential matching.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions