You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Scapy provides several high-level utilities related to Kerberos:
10
-
11
-
- ``Ticketer``: a module that allows manipulating Kerberos tickets:
12
-
- Request TGT/ST
13
-
- Generate a ``KerberosSSP`` from a ST
14
-
- Renew tickets
15
-
- Read, create, write **ccache** files
16
-
- Read, create, write **keytab** files
17
-
- Kerberos armoring (via FAST) is available
18
-
- S4U2Self / S4U2Proxy are implemented
19
-
- KPasswd is implemented
20
-
- ``KerberosSSP``: an implementation of a GSSAPI SSP for Kerberos, usable in any of Scapy's client that support GSSAPI.
21
-
- Encryption/MIC using GSSAPI is available
22
-
- Channel bindings are supported
23
-
- U2U (User-To-User) is fully supported
24
-
- [MS-KKDCP] (KDC proxy) is supported
6
+
Scapy's Kerberos implementation is accessed through two main components:
7
+
8
+
- :class:`~scapy.modules.ticketer.Ticketer`: a module that allows manipulating Kerberos tickets;
9
+
- :class:`~scapy.layers.kerberos.KerberosSSP`: an implementation of a GSSAPI SSP for Kerberos, usable in any of Scapy's client that support GSSAPI, for both authentication and encryption.
10
+
11
+
The general idea is that the first one allows to request tickets and perform almost all Kerberos related operations (S4U2Self, S4U2Proxy, FAST armoring, U2U, DMSA, etc.). The latter is used once a final Service Ticket is obtained, by other parts of Scapy, for instance `SMB <smb.html>`_, `LDAP <ldap.html>`_ or `DCE/RPC <dcerpc.html>`_.
25
12
26
13
Ticketer module
27
14
~~~~~~~~~~~~~~~
28
15
29
-
The **Ticketer** module can be used both from the CLI or programmatically. This section tries to give many usage examples of features
30
-
that are available. For more detail regarding the parameters of the functions, it is encouraged to have a look at their docstrings.
16
+
The :class:`~scapy.modules.ticketer.Ticketer` module can be used both from the CLI or programmatically to perform operations on Kerberos tickets. To use it, you must first create an instance of a :class:`~scapy.modules.ticketer.Ticketer`, which acts as both a **ccache** (holds tickets) and a **keytab** (holds secrets).
17
+
18
+
This section tries to give many usage examples, but isn't exhaustive. For more details regarding the parameters of each functions, it is encouraged to have a look at the docstrings of :class:`~scapy.layers.kerberos.KerberosClient`.
31
19
32
-
- **Request TGT**:
20
+
- **Request TGT**: see the docstring of :func:`~scapy.layers.kerberos.krb_as_req`
33
21
34
22
.. code:: pycon
35
23
@@ -44,7 +32,7 @@ that are available. For more detail regarding the parameters of the functions, i
- **Use ticket as SSP**: the :func:`~scapy.modules.ticketer.Ticketer.ssp` function.
65
53
66
54
.. code:: pycon
67
55
@@ -467,11 +455,12 @@ You can typically use it in :class:`~scapy.layers.smbclient.SMB_Client`, :class:
467
455
468
456
.. note:: Remember that you can wrap it in a :class:`~scapy.layers.spnego.SPNEGOSSP`
469
457
470
-
Low-level
471
-
_________
458
+
See `GSSAPI <gssapi.html>`_ for usage examples.
472
459
473
-
Decrypt kerberos packets
474
-
~~~~~~~~~~~~~~~~~~~~~~~~
460
+
Decrypt kerberos packets manually
461
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
462
+
463
+
.. note:: This section is useful to understand the inner workings of Kerberos, but isn't necessary to use Scapy's implementation.
475
464
476
465
Kerberos packets contain encrypted content, let's take the following packet:
477
466
@@ -576,10 +565,10 @@ Let's run a few examples:
576
565
'4c01cd46d632d01e6dbe230a01ed642a'
577
566
578
567
579
-
Decrypt FAST
580
-
~~~~~~~~~~~~
568
+
Decrypt FAST manually
569
+
~~~~~~~~~~~~~~~~~~~~~
581
570
582
-
.. note:: Have a look at `RFC6113 <https://datatracker.ietf.org/doc/html/rfc6113.html>`_ for Kerberos FAST
571
+
.. note:: This section is useful to understand the inner workings of Kerberos FAST, but FAST can simply be used in :class:`~scapy.modules.ticketer.Ticketer` through the ``armor_with`` parameter when performing either a ASREQ or TGSREQ. For more details related to how FAST works, have a look at `RFC6113 <https://datatracker.ietf.org/doc/html/rfc6113.html>`_.
583
572
584
573
Let's take a Kerberos AS-REQ packet with FAST armoring (RFC6113):
585
574
@@ -802,8 +791,8 @@ That we can now use to decrypt the last payload:
802
791
| encAuthorizationData= None
803
792
| additionalTickets= None
804
793
805
-
Encryption
806
-
~~~~~~~~~~
794
+
Manually using Kerberos encryption
795
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
807
796
808
797
A :func:`~scapy.libs.rfc3961.Key.encrypt` function exists in the :class:`~scapy.libs.rfc3961.Key` object in order to do the opposite of :func:`~scapy.libs.rfc3961.Key.decrypt`.
0 commit comments