mirror of
https://github.com/dirkjanm/krbrelayx.git
synced 2026-11-07 09:25:58 -10:00
update sign/seal/cbt support for dns tools
This commit is contained in:
1 parent
10b45a33bc
commit
f9427d0257
3 files changed
+15
-10
No files matched your search
@@ -1,8 +1,9 @@
|
||||
# Krbrelayx - Kerberos relaying and unconstrained delegation abuse toolkit
|
||||
|
||||
Toolkit for abusing Kerberos.
|
||||
Requires [impacket](https://github.com/SecureAuthCorp/impacket), [ldap3](https://github.com/cannatag/ldap3) and dnspython to function.
|
||||
It is recommended to install impacket from git directly to have the latest version available.
|
||||
Requires [impacket](https://github.com/SecureAuthCorp/impacket), [ldap3](https://github.com/cannatag/ldap3), [ldap3-ad-auth](https://github.com/dirkjanm/ldap3-ad-auth) and dnspython to function.
|
||||
|
||||
Requirements can be installed with `pip install -r requirements.txt`
|
||||
|
||||
More info about this toolkit available in my blog <https://dirkjanm.io/krbrelayx-unconstrained-delegation-abuse-toolkit/>. Information about Kerberos relaying in the follow-up blog <https://dirkjanm.io/relaying-kerberos-over-dns-with-krbrelayx-and-mitm6/>.
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ from impacket.krb5.kerberosv5 import getKerberosTGT, getKerberosTGS
|
||||
from impacket.krb5.types import Principal
|
||||
from impacket.krb5 import constants
|
||||
from ldap3 import NTLM, Server, Connection, ALL, LEVEL, BASE, MODIFY_DELETE, MODIFY_ADD, MODIFY_REPLACE, SASL, KERBEROS
|
||||
from lib.utils.kerberos import ldap_kerberos
|
||||
from ldap3_ad_auth import bind_kerberos, bind_ntlm
|
||||
import ldap3
|
||||
from ldap3.protocol.microsoft import security_descriptor_control
|
||||
|
||||
@@ -131,16 +131,18 @@ def main():
|
||||
# define the server and the connection
|
||||
s = Server(args.host, get_info=ALL)
|
||||
print_m('Connecting to host...')
|
||||
c = Connection(s, user=args.user, password=args.password, authentication=authentication, sasl_mechanism=sasl_mech)
|
||||
c = Connection(s, user=args.user, password=args.password, authentication=authentication, sasl_mechanism=sasl_mech, auto_referrals=False)
|
||||
print_m('Binding to host')
|
||||
# perform the Bind operation
|
||||
if authentication == NTLM:
|
||||
if not c.bind():
|
||||
try:
|
||||
bind_ntlm(c, domain=domain, username=user, password=args.password)
|
||||
except Exception:
|
||||
print_f('Could not bind with specified credentials')
|
||||
print_f(c.result)
|
||||
sys.exit(1)
|
||||
else:
|
||||
ldap_kerberos(domain, kdcHost, None, userName, c, args.host, TGS)
|
||||
bind_kerberos(c, domain=domain, kdc=kdcHost, username=user, hostname=args.host, tgs=TGS)
|
||||
print_o('Bind OK')
|
||||
|
||||
if args.target:
|
||||
|
||||
+6
-4
@@ -37,7 +37,7 @@ from impacket.krb5.kerberosv5 import getKerberosTGT, getKerberosTGS
|
||||
from impacket.krb5.types import Principal
|
||||
from impacket.krb5 import constants
|
||||
from ldap3 import NTLM, Server, Connection, ALL, LEVEL, BASE, MODIFY_DELETE, MODIFY_ADD, MODIFY_REPLACE, SASL, KERBEROS
|
||||
from lib.utils.kerberos import ldap_kerberos
|
||||
from ldap3_ad_auth import bind_kerberos, bind_ntlm
|
||||
import ldap3
|
||||
from impacket.ldap import ldaptypes
|
||||
import dns.resolver
|
||||
@@ -424,16 +424,18 @@ def main():
|
||||
# define the server and the connection
|
||||
s = Server(args.host, port=args.port, use_ssl=args.force_ssl, get_info=ALL)
|
||||
print_m('Connecting to host...')
|
||||
c = Connection(s, user=args.user, password=args.password, authentication=authentication, sasl_mechanism=sasl_mech)
|
||||
c = Connection(s, user=args.user, password=args.password, authentication=authentication, sasl_mechanism=sasl_mech, auto_referrals=False)
|
||||
print_m('Binding to host')
|
||||
# perform the Bind operation
|
||||
if authentication == NTLM:
|
||||
if not c.bind():
|
||||
try:
|
||||
bind_ntlm(c, domain=domain, username=user, password=args.password)
|
||||
except Exception:
|
||||
print_f('Could not bind with specified credentials')
|
||||
print_f(c.result)
|
||||
sys.exit(1)
|
||||
else:
|
||||
ldap_kerberos(domain, kdcHost, None, userName, c, args.host, TGS)
|
||||
bind_kerberos(c, domain=domain, kdc=kdcHost, username=user, hostname=args.host, tgs=TGS)
|
||||
print_o('Bind OK')
|
||||
domainroot = s.info.other['defaultNamingContext'][0]
|
||||
forestroot = s.info.other['rootDomainNamingContext'][0]
|
||||
|
||||
Reference in new issue
Block a user