KRB5(3)
πΈ KRB5(3) πΈ
hiii bestie π this is the manual page for packet.application.krb5, and it rides along with krb5 1.0. It's a long one so we're doing it in two parts β this is part 1, so don't go anywhere, okay? π«Ά
β¨ NAME β¨
packet.application.krb5 β the KRB5 module, that's it, that's the whole name, periodt π
π¦ DESCRIPTION π¦
Okay so, real talk: this module decodes the KRB5 layer. The decoding is done using ASN.1 DER (Distinguished Encoding Representation) β you know, the strict little encoding that does NOT play games. π
It's built to follow these two RFCs, and they are iconic:
- RFC 4120 β <b>The Kerberos Network Authentication Service (V5)</b>
- RFC 6113 β <b>A Generalized Framework for Kerberos Pre-Authentication</b>
π CLASSES π
okay this is the big part, stay with me π every single class is listed below, and yes, we're doing all of them, no skips, no shortcuts. π«‘
π class APOptions(packet.utils.OptionFlags)
AP Option flags β literally the flags for AP options. That's the vibe. β¨
πΈ class AP_REP(baseobj.BaseObj)
The definition, verbatim, because ASN.1 does not do ~approximately~:
AP-REP ::= [APPLICATION 15] SEQUENCE {
pvno [0] INTEGER (5),
msg-type [1] INTEGER (15),
enc-part [2] EncryptedData -- EncAPRepPart
}
Methods defined here π
__init__(self, obj)β Constructor. Sets up the object's private data based on whatever args you hand it. You can pass them positionally, by name, or a lil mix of both. your call, bestie π«Ά
π¦ class AP_REQ(baseobj.BaseObj)
AP-REQ ::= [APPLICATION 14] SEQUENCE {
pvno [0] INTEGER (5),
msg-type [1] INTEGER (14),
options [2] APOptions,
ticket [3] Ticket,
authenticator [4] EncryptedData -- Authenticator
}
Methods defined here π
__init__(self, obj)β Constructor. Initializes the object's private data according to the arguments you give. Positional, named, or a combo β all valid. β¨
π class Checksum(baseobj.BaseObj)
Checksum ::= SEQUENCE {
cksumtype [0] Int32,
checksum [1] OCTET STRING
}
Methods defined here π
__init__(self, obj)β Constructor. Wires up the object's private data from the arguments passed in, whether that's positional, named, or both together. π
β class EncryptedData(baseobj.BaseObj)
EncryptedData ::= SEQUENCE {
etype [0] Int32 -- EncryptionType --,
kvno [1] UInt32 OPTIONAL,
cipher [2] OCTET STRING -- ciphertext
}
Methods defined here π
__init__(self, obj)β Constructor. Fills the object's private data per the arguments given. Positional args, named args, or a blend of the two β whatever feels right. π
π§ class EtypeInfo2Entry(baseobj.BaseObj)
ETYPE-INFO2-ENTRY ::= SEQUENCE {
etype [0] Int32,
salt [1] KerberosString OPTIONAL,
s2kparams [2] OCTET STRING OPTIONAL
}
Methods defined here π
__init__(self, obj)β Constructor. Sets up the object's private data according to the arguments supplied. Positional, named, or a mix of both β all fine. π
π class HostAddress(baseobj.BaseObj)
HostAddress ::= SEQUENCE {
addr-type [0] Int32,
address [1] OCTET STRING
}
Methods defined here π
__init__(self, obj)β Constructor. Initializes the object's private data based on the args you give it. Positional, named, or a combination of the two. π¦
π class KDCOptions(packet.utils.OptionFlags)
KDC Option flags β the flags, for KDC options. Short and sweet, we love her. π
π class KDC_REP(baseobj.BaseObj)
KDC-REP ::= SEQUENCE {
pvno [0] INTEGER (5),
msg-type [1] INTEGER (11 -- AS -- | 13 -- TGS --),
padata [2] SEQUENCE OF PA-DATA OPTIONAL
-- NOTE: not empty --,
crealm [3] Realm,
cname [4] PrincipalName,
ticket [5] Ticket,
enc-part [6] EncryptedData
-- EncASRepPart or EncTGSRepPart,
-- as appropriate
}
Methods defined here π
__init__(self, obj)β Constructor. Sets the object's private data according to the arguments given. Positional, named, or both at once β go off. β¨
π class KDC_REQ(baseobj.BaseObj)
heads up, bestie β peep the note, the first tag is [1], <b>not</b> [0]. Don't come for me, it's right there in the source:
KDC-REQ ::= SEQUENCE {
-- NOTE: first tag is [1], not [0]
pvno [1] INTEGER (5) ,
msg-type [2] INTEGER (10 -- AS -- | 12 -- TGS --),
padata [3] SEQUENCE OF PA-DATA OPTIONAL
-- NOTE: not empty --,
req-body [4] KDC-REQ-BODY
}
Methods defined here π
__init__(self, obj)β Constructor. Initializes the object's private data per the arguments passed. Positional, named, or a mix of both β all good. π
πΈ class KDC_REQ_BODY(baseobj.BaseObj)
KDC-REQ-BODY ::= SEQUENCE {
options [0] KDCOptions,
cname [1] PrincipalName OPTIONAL
-- Used only in AS-REQ --,
realm [2] Realm
-- Server's realm
-- Also client's in AS-REQ --,
sname [3] PrincipalName OPTIONAL,
from [4] KerberosTime OPTIONAL,
till [5] KerberosTime,
rtime [6] KerberosTime OPTIONAL,
nonce [7] UInt32,
etype [8] SEQUENCE OF Int32 -- EncryptionType
-- in preference order --,
addresses [9] HostAddresses OPTIONAL,
enc-authorization-data [10] EncryptedData OPTIONAL
-- AuthorizationData --,
additional-tickets [11] SEQUENCE OF Ticket OPTIONAL
-- NOTE: not empty
}
Methods defined here π
__init__(self, obj)β Constructor. Builds the object's private data according to the arguments given. Positional, named, or a combination of both. π«Ά
π₯ class KRB5(baseobj.BaseObj)
the main character herself π β the KRB5 object.
Usage β¨
from packet.application.krb5 import KRB5
# Decode KRB5 layer
x = KRB5(pktt, proto)
Object definition π
KRB5(
appid = int, # Application Identifier
kdata = KDC_REQ|KDC_REP|KRB_ERROR
}
Methods defined here π
__bool__(self)β Truth value testing for the built-in operationbool(). So you can just ask the object if it's true. vibe check, but make it Python. β__init__(self, pktt, proto)β Constructor. Initializes the object's private data, and it takes:pktt: the packet trace object (packet.pktt.Pktt), so this layer can reach up into its parent layers π«Άproto: the transport layer protocol.
π class KRB_ERROR(baseobj.BaseObj)
KRB-ERROR ::= [APPLICATION 30] SEQUENCE {
pvno [0] INTEGER (5),
msg-type [1] INTEGER (30),
ctime [2] KerberosTime OPTIONAL,
cusec [3] Microseconds OPTIONAL,
stime [4] KerberosTime,
susec [5] Microseconds,
error-code [6] Int32,
crealm [7] Realm OPTIONAL,
cname [8] PrincipalName OPTIONAL,
realm [9] Realm -- service realm --,
sname [10] PrincipalName -- service name --,
e-text [11] KerberosString OPTIONAL,
e-data [12] OCTET STRING OPTIONAL
}
Methods defined here π
__init__(self, obj)β Constructor. Sets up the object's private data according to the arguments given. Positional, named, or both together. π (affectionate)
π‘οΈ class KrbFastArmor(baseobj.BaseObj)
KrbFastArmor ::= SEQUENCE {
armor-type [0] Int32,
-- Type of the armor.
armor-value [1] OCTET STRING,
-- Value of the armor.
}
Methods defined here π
__init__(self, obj)β Constructor. Initializes the object's private data per the arguments you pass. Positional, named, or a mix of the two. β¨
π class KrbFastArmoredRep(baseobj.BaseObj)
KrbFastArmoredRep ::= SEQUENCE {
enc-fast-rep [0] EncryptedData, -- KrbFastResponse --
-- The encryption key is the armor key in the request, and
-- the key usage number is KEY_USAGE_FAST_REP.
}
Methods defined here π
__init__(self, obj)β Constructor. Fills the object's private data according to the arguments given. Positional, named, or a combination of both. π
π class KrbFastArmoredReq(baseobj.BaseObj)
KrbFastArmoredReq ::= SEQUENCE {
armor [0] KrbFastArmor OPTIONAL,
-- Contains the armor that identifies the armor key.
-- MUST be present in AS-REQ.
req-checksum [1] Checksum,
-- For AS, contains the checksum performed over the type
-- KDC-REQ-BODY for the req-body field of the KDC-REQ
-- structure;
-- For TGS, contains the checksum performed over the type
-- AP-REQ in the PA-TGS-REQ padata.
-- The checksum key is the armor key, the checksum
-- type is the required checksum type for the enctype of
-- the armor key, and the key usage number is
-- KEY_USAGE_FAST_REQ_CHKSUM.
enc-fast-req [2] EncryptedData, -- KrbFastReq --
-- The encryption key is the armor key, and the key usage
-- number is KEY_USAGE_FAST_ENC.
}
Methods defined here π
__init__(self, obj)β Constructor. Initializes the object's private data according to the arguments given. Positional, named, or both β your pick. π¦
π§ class PrincipalName(baseobj.BaseObj)
PrincipalName ::= SEQUENCE {
name-type [0] Int32,
name-string [1] SEQUENCE OF KerberosString
}
Methods defined here π
__init__(self, obj)β Constructor. Sets the object's private data according to the arguments supplied. Positional, named, or a mix of both. β¨
ποΈ class Ticket(baseobj.BaseObj)
Ticket ::= [APPLICATION 1] SEQUENCE {
tkt-vno [0] INTEGER (5),
realm [1] Realm,
sname [2] PrincipalName,
enc-part [3] EncryptedData -- EncTicketPart
}
Methods defined here π
__init__(self, obj)β Constructor. Initializes the object's private data based on the arguments given. Positional, named, or a combination of both. π«Ά
π class krb5_addrtype(packet.utils.Enum)
enum krb5_addrtype β an enum. Short, iconic, no notes. π
π class krb5_adtype(packet.utils.Enum)
enum krb5_adtype β also an enum. She's giving minimalism. β¨
π class krb5_application(packet.utils.Enum)
enum krb5_application β enum behavior, no further commentary. π
π class krb5_ctype(packet.utils.Enum)
enum krb5_ctype β it's an enum, bestie. π
π class krb5_etype(packet.utils.Enum)
enum krb5_etype β enum, exactly as the source says. π¦
π class krb5_fatype(packet.utils.Enum)
enum krb5_fatype β yep, an enum. π
π class krb5_patype(packet.utils.Enum)
enum krb5_patype β an enum, we love a consistent queen. πΈ
π class krb5_principal(packet.utils.Enum)
enum krb5_principal β last enum of part one, and she ate. π
class krb5_status(packet.utils.Enum) π
enum krb5_status
Okay bestie, itβs literally an enum named krb5_status. Slay. β¨
class paData(baseobj.BaseObj) π
PA-DATA ::= SEQUENCE {
-- NOTE: first tag is [1], not [0]
padata-type [1] Int32,
padata-value [2] OCTET STRING
}
Methods defined here: π«Ά
__init__(self, obj)
Constructor
Initialize objectβs private data according to the arguments given. Arguments can be given as positional, named arguments or a combination of both.
β¨ FUNCTIONS β¨ π¦
KerberosTime(stime, usec=None)β Convert floating point time to aDateStrobject, include the microseconds if given πOptional(obj, objtype)β Get Optional item of the given object type πSequenceOf(obj, objtype)β SEQUENCE OF: return list of the given object type π
πΈ SEE ALSO πΈ π
π BUGS π π
No known bugs.
π AUTHOR π π
Jorge Mora (mora@netapp.com)
Later, bestie! This whole vibe is from NFStest 3.2, dated 21 March 2023, and itβs KRB5(3). Periodt. π β¨
π¦ where this page comes from
- debian trixie: nfstest 3.2-3
- fedora 43: NFStest 3.2-14.fc43 Β· GPL-2.0-or-later
- fedora 44: NFStest 3.2-16.fc44 Β· GPL-2.0-or-later
- ubuntu noble: nfstest 3.2-2
- ubuntu questing: nfstest 3.2-3
- ubuntu resolute: nfstest 3.2-3build1
- ubuntu stonking: nfstest 3.2-5
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms