MCPcopy Index your code
hub / github.com/secdev/scapy / ssp

Method ssp

scapy/modules/ticketer.py:853–889  ·  view source on GitHub ↗

Create a KerberosSSP from a ticket or from the keystore. :param i: index of the ticket to use from ccache (client) OR SPN of the key to use from the keystore (server)

(self, i, **kwargs)

Source from the content-addressed store, hash-verified

851 )
852
853 def ssp(self, i, **kwargs):
854 """
855 Create a KerberosSSP from a ticket or from the keystore.
856
857 :param i: index of the ticket to use from ccache (client)
858 OR SPN of the key to use from the keystore (server)
859 """
860 if isinstance(i, int):
861 ticket, sessionkey, upn, spn = self.export_krb(i)
862 if spn.startswith("krbtgt/"):
863 # It's a TGT
864 kwargs.setdefault("SPN", None) # Use target_name only
865 return KerberosSSP(
866 TGT=ticket,
867 KEY=sessionkey,
868 UPN=upn,
869 **kwargs,
870 )
871 else:
872 # It's a ST
873 return KerberosSSP(
874 ST=ticket,
875 KEY=sessionkey,
876 UPN=upn,
877 SPN=spn,
878 **kwargs,
879 )
880 elif isinstance(i, str):
881 spn = i
882 key = self.get_cred(spn)
883 return KerberosSSP(
884 SPN=spn,
885 KEY=key,
886 **kwargs,
887 )
888 else:
889 raise ValueError("Invalid 'i' value. Must be int or str")
890
891 def _add_cred(self, decTkt, hash=None, kdc_hash=None):
892 """

Callers 1

from_cli_argumentsMethod · 0.95

Calls 3

export_krbMethod · 0.95
get_credMethod · 0.95
KerberosSSPClass · 0.90

Tested by

no test coverage detected