Convert one-liner into multi-liner for readability

main
Alexander Neff 2023-10-26 21:03:49 +02:00
parent c2d6eadd26
commit a416cec4bb
1 changed files with 6 additions and 1 deletions

View File

@ -243,4 +243,9 @@ class KerberosAttacks:
return None return None
# Let's output the TGT enc-part/cipher in Hashcat format, in case somebody wants to use it. # Let's output the TGT enc-part/cipher in Hashcat format, in case somebody wants to use it.
return "$krb5asrep$%d$%s@%s:%s$%s" % (as_rep["enc-part"]["etype"], client_name, domain, hexlify(as_rep["enc-part"]["cipher"].asOctets()[:12]).decode(), hexlify(as_rep["enc-part"]["cipher"].asOctets()[12:]).decode()) if as_rep["enc-part"]["etype"] == 17 or as_rep["enc-part"]["etype"] == 18 else "$krb5asrep$%d$%s@%s:%s$%s" % (as_rep["enc-part"]["etype"], client_name, domain, hexlify(as_rep["enc-part"]["cipher"].asOctets()[:16]).decode(), hexlify(as_rep["enc-part"]["cipher"].asOctets()[16:]).decode()) hash_tgt = f"$krb5asrep${as_rep['enc-part']['etype']}${client_name}@{domain}:"
if as_rep["enc-part"]["etype"] in (17, 18):
hash_tgt += f"{hexlify(as_rep['enc-part']['cipher'].asOctets()[:12]).decode()}${hexlify(as_rep['enc-part']['cipher'].asOctets()[12:]).decode()}"
else:
hash_tgt += f"{hexlify(as_rep['enc-part']['cipher'].asOctets()[:16]).decode()}${hexlify(as_rep['enc-part']['cipher'].asOctets()[16:]).decode()}"
return hash_tgt