Skip to content

Static KVNO value is problematic when KVNO > 1 #4

@bryanmcnulty

Description

@bryanmcnulty

I've found that the static key version number (KNVO) set in credentials.go#L167 becomes problematic when the KVNO returned in the AS-REP message is greater than 1 (i.e. when a key is rotated due to a password reset)

I've found this using goexec - which relies on the adauth library for Kerberos support. Here's what I ran, and the associated error.

./goexec tsch demand "$target" \
  --user "${auth_user}@${domain}" \
  --aes-key "$auth_aes_256" \
  --exec 'C:\Windows\System32\cmd.exe' \
  --args '/C whoami /all' \
  --out - \
  --dc "$dc" \
  --debug

bind: init security context: security provider: krb5: init: apreq: affirm login: could not get valid TGT for client's realm: [Root cause: Decrypting_Error] KRBMessage_Handling_Error: AS Exchange Error: AS_REP is not valid or client password/keytab incorrect < Decrypting_Error: error decrypting EncPart of AS_REP < Decrypting_Error: error decrypting AS_REP encrypted part: matching key not found in keytab. Looking for \"Administrator\" realm: LUSTROUS.VL kvno: 2 etype: 18

I've confirmed that this is related to the fact that the KVNO was 2 in the AS-REP message by setting the kvno parameter on credentials.go#L167 to 2 in my Go workspace - this resolved the error.

P.S. Great job on this module - I've really found it well-featured and easy to use 😃

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions