scapy.modules.ticketer
Create/Edit Kerberos ticket using Scapy
See https://scapy.readthedocs.io/en/latest/layers/kerberos.html
- class scapy.modules.ticketer.CCAddress(_pkt, /, *, addrtype=0, address=<CCCountedOctetString |>)[source]
Bases:
Packet- aliastypes
- fields_desc
Display RFC-like schema
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ADDRTYPE | ADDRESS | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Fig. CCAddressCCAddress fields addrtype
0address
<CCCountedOctetString |>
- class scapy.modules.ticketer.CCAuthData(_pkt, /, *, authtype=0, authdata=<CCCountedOctetString |>)[source]
Bases:
Packet- aliastypes
- fields_desc
Display RFC-like schema
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | AUTHTYPE | AUTHDATA | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Fig. CCAuthDataCCAuthData fields authtype
0authdata
<CCCountedOctetString |>
- class scapy.modules.ticketer.CCCountedOctetString(_pkt, /, *, length=None, data=b'')[source]
Bases:
Packet- aliastypes
- fields_desc
Display RFC-like schema
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | LENGTH | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | DATA | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Fig. CCCountedOctetStringCCCountedOctetString fields length
Nonedata
b''
- class scapy.modules.ticketer.CCCredential(_pkt, /, *, client=<CCPrincipal realm=<CCCountedOctetString |> |>, server=<CCPrincipal realm=<CCCountedOctetString |> |>, keyblock=<CCKeyBlock |>, authtime=None, starttime=None, endtime=None, renew_till=None, is_skey=0, ticket_flags=<Flag 0 ()>, num_address=None, addrs=[], num_authdata=None, authdata=[], ticket=<CCCountedOctetString |>, second_ticket=<CCCountedOctetString |>)[source]
Bases:
Packet- aliastypes
- fields_desc
Display RFC-like schema
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | CLIENT | SERVER | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | KEYBLOCK | AUTHTIME | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | STARTTIME | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | ENDTIME | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | RENEW TILL | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | IS SKEY | TICKET FLAGS | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | NUM ADDRESS | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | ADDRS | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | NUM AUTHDATA | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | AUTHDATA | TICKET | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | SECOND TICKET | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Fig. CCCredentialCCCredential fields client
<CCPrincipal realm=<CCCountedOctetString |> |>server
<CCPrincipal realm=<CCCountedOctetString |> |>keyblock
<CCKeyBlock |>authtime
Nonestarttime
Noneendtime
Nonerenew_till
Noneis_skey
0ticket_flags
<Flag 0 ()>num_address
Noneaddrs
[]num_authdata
Noneauthdata
[]ticket
<CCCountedOctetString |>second_ticket
<CCCountedOctetString |>
- class scapy.modules.ticketer.CCDeltaTime(_pkt, /, *, time_offset=0, usec_offset=0)[source]
Bases:
Packet- aliastypes
- fields_desc
Display RFC-like schema
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | TIME OFFSET | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | USEC OFFSET | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Fig. CCDeltaTimeCCDeltaTime fields time_offset
0usec_offset
0
- class scapy.modules.ticketer.CCHeader(_pkt, /, *, tag=1, taglen=8, tagdata=<CCDeltaTime |>)[source]
Bases:
Packet- aliastypes
- fields_desc
Display RFC-like schema
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | TAG | TAGLEN | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | TAGDATA | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Fig. CCHeaderCCHeader fields tag
1taglen
8tagdata
<CCDeltaTime |>
- class scapy.modules.ticketer.CCKeyBlock(_pkt, /, *, keytype=0, etype=0, keylen=None, keyvalue=b'')[source]
Bases:
Packet- aliastypes
- fields_desc
Display RFC-like schema
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | KEYTYPE | ETYPE | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | KEYLEN | KEYVALUE | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Fig. CCKeyBlockCCKeyBlock fields keytype
0etype
0keylen
Nonekeyvalue
b''
- class scapy.modules.ticketer.CCPrincipal(_pkt, /, *, name_type=0, num_components=None, realm=<CCCountedOctetString |>, components=[])[source]
Bases:
Packet- aliastypes
- fields_desc
Display RFC-like schema
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | NAME TYPE | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | NUM COMPONENTS | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | REALM | COMPONENTS | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Fig. CCPrincipalCCPrincipal fields name_type
0num_components
Nonerealm
<CCCountedOctetString |>components
[]
- class scapy.modules.ticketer.CCache(_pkt, /, *, file_format_version=1284, headerlen=0, headers=[], primary_principal=<CCPrincipal realm=<CCCountedOctetString |> |>, credentials=[])[source]
Bases:
Packet- aliastypes
- fields_desc
Display RFC-like schema
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | FILE FORMAT VERSION | HEADERLEN | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | HEADERS | PRIMARY PRINCIPAL | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | CREDENTIALS | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Fig. CCacheCCache fields file_format_version
1284headerlen
0headers
[]primary_principal
<CCPrincipal realm=<CCCountedOctetString |> |>credentials
[]
- class scapy.modules.ticketer.KTCountedOctetString(_pkt, /, *, length=None, data=b'')[source]
Bases:
Packet- aliastypes
- fields_desc
Display RFC-like schema
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | LENGTH | DATA | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Fig. KTCountedOctetStringKTCountedOctetString fields length
Nonedata
b''
- class scapy.modules.ticketer.KTKeyBlock(_pkt, /, *, keytype=0, keylen=None, keyvalue=b'')[source]
Bases:
Packet- aliastypes
- fields_desc
Display RFC-like schema
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | KEYTYPE | KEYLEN | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | KEYVALUE | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Fig. KTKeyBlockKTKeyBlock fields keytype
0keylen
Nonekeyvalue
b''
- class scapy.modules.ticketer.Keytab(_pkt, /, *, file_format_version=1282, entries=[])[source]
Bases:
Packet- aliastypes
- fields_desc
Display RFC-like schema
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | FILE FORMAT VERSION | ENTRIES | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Fig. KeytabKeytab fields file_format_version
1282entries
[]
- class scapy.modules.ticketer.KeytabEntry(_pkt, /, *, size=None, num_components=None, realm=<KTCountedOctetString |>, components=[], name_type=0, timestamp=None, vno8=0, key=<KTKeyBlock |>, vno=None)[source]
Bases:
Packet- aliastypes
- fields_desc
Display RFC-like schema
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | SIZE | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | NUM COMPONENTS | REALM | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | COMPONENTS | NAME TYPE | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | TIMESTAMP | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | VNO8 | KEY | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | VNO | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | +-+-+-+-+-+-+-+-+ Fig. KeytabEntryKeytabEntry fields size
Nonenum_components
Nonerealm
<KTCountedOctetString |>components
[]name_type
IntField(Cond)0timestamp
Nonevno8
0key
<KTKeyBlock |>vno
IntField(Cond)None
- property versionNumber
- class scapy.modules.ticketer.Ticketer[source]
Bases:
object- add_cred(principal, mapupn=None, password=None, salt=None, key=None, etypes=None, kvno=None)[source]
Add a credential to the Keytab.
- import_krb(res, key=None, hash=None, _inplace=None)[source]
Import the result of krb_[tgs/as]_req or a Ticket into the CCache.
- Parameters:
obj – a KRB_Ticket object or a AS_REP/TGS_REP object
sessionkey – the session key that comes along the ticket
- kpasswdset(i, targetupn=None, newpassword=None)[source]
Use kpasswd in ‘Set Password’ mode to set the password of an account.
- Parameters:
i – the TGT to use.
- renew(i, ip=None, additional_tickets=[], **kwargs)[source]
Renew a Kerberos TGT or a TS from the local CCache using a TGS-REQ
- Parameters:
i – the ticket/sessionkey to renew.
- request_st(i, spn, ip=None, renew=False, realm=None, additional_tickets=None, fast=False, armor_with=None, for_user=None, s4u2proxy=None, **kwargs)[source]
Request a Kerberos TS and add it to the local CCache using another ticket.
- Parameters:
i – the index of the ticket/sessionkey to use in the TGS request.
spn – the SPN to request a ticket for.
armor_with – the index of the ticket/sessionkey to armor this request.
s4u2proxy – if an index, the index of the additional ticket to send along a S4U2PROXY request. If True, it will use additional_tickets as usual.
for_user – if provided, requests S4U2SELF for that user.
See
krb_tgs_req()for the the other parameters.
- request_tgt(upn, ip=None, key=None, password=None, realm=None, fast=False, armor_with=None, spn=None, x509=None, x509key=None, p12=None, **kwargs)[source]
Request a Kerberos TGT and add it to the local CCache
See
krb_as_req()for the full documentation.
- resign_ticket(i, hash=None, kdc_hash=None)[source]
Resign a ticket from CCache
- Parameters:
hash – the hash to use to compute the Server Signature
kdc_hash – the hash to use to compute the KDC signature (if None, not recomputed unless its a TGT where is uses hash)
- save_ccache(fname=None, i=None)[source]
Save ccache into file
- Parameters:
fname – if provided, save to a specific file.
i – if provided, only save the ticket n°i.
- save_keytab(fname=None)[source]
Save keytab into file
- Parameters:
fname – if provided, save to a specific file.