From ce8c55724200cdfdd0662a86c34970481ec6be4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Gr=C3=A9goire?= Date: Sat, 3 Aug 2024 09:36:10 -0400 Subject: [PATCH] Do not automatically uppercase realm names Fixes https://github.com/ropnop/kerbrute/issues/66 Uppercasing the realm name is a convention, but not strictly necessary. https://web.mit.edu/kerberos/krb5-1.12/doc/admin/realm_config.html#realm-name https://web.mit.edu/kerberos/krb5-1.12/doc/admin/realm_config.html#realm-name --- session/session.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/session/session.go b/session/session.go index af7d530..0af2f44 100644 --- a/session/session.go +++ b/session/session.go @@ -70,8 +70,7 @@ func NewKerbruteSession(options KerbruteSessionOptions) (k KerbruteSession, err } } - realm := strings.ToUpper(options.Domain) - configstring := buildKrb5Template(realm, options.DomainController) + configstring := buildKrb5Template(options.Domain, options.DomainController) Config, err := kconfig.NewFromString(configstring) if options.Downgrade { Config.LibDefaults.DefaultTktEnctypeIDs = []int32{23} // downgrade to arcfour-hmac-md5 for crackable AS-REPs @@ -80,13 +79,13 @@ func NewKerbruteSession(options KerbruteSessionOptions) (k KerbruteSession, err if err != nil { panic(err) } - _, kdcs, err := Config.GetKDCs(realm, false) + _, kdcs, err := Config.GetKDCs(options.Domain, false) if err != nil { - err = fmt.Errorf("Couldn't find any KDCs for realm %s. Please specify a Domain Controller", realm) + err = fmt.Errorf("Couldn't find any KDCs for realm %s. Please specify a Domain Controller", options.Domain) } k = KerbruteSession{ Domain: options.Domain, - Realm: realm, + Realm: options.Domain, Kdcs: kdcs, ConfigString: configstring, Config: Config,