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

Method request_st

scapy/modules/ticketer.py:2487–2552  ·  view source on GitHub ↗

Request a Kerberos TS and add it to the local CCache using another ticket. :param i: the index of the ticket/sessionkey to use in the TGS request. :param spn: the SPN to request a ticket for. :param armor_with: the index of the ticket/sessionkey to armor this reques

(
        self,
        i,
        spn,
        ip=None,
        renew=False,
        realm=None,
        additional_tickets=None,
        fast=False,
        armor_with=None,
        for_user=None,
        s4u2proxy=None,
        **kwargs,
    )

Source from the content-addressed store, hash-verified

2485 self.import_krb(res)
2486
2487 def request_st(
2488 self,
2489 i,
2490 spn,
2491 ip=None,
2492 renew=False,
2493 realm=None,
2494 additional_tickets=None,
2495 fast=False,
2496 armor_with=None,
2497 for_user=None,
2498 s4u2proxy=None,
2499 **kwargs,
2500 ):
2501 """
2502 Request a Kerberos TS and add it to the local CCache using another ticket.
2503
2504 :param i: the index of the ticket/sessionkey to use in the TGS request.
2505 :param spn: the SPN to request a ticket for.
2506 :param armor_with: the index of the ticket/sessionkey to armor this request.
2507 :param s4u2proxy: if an index, the index of the additional ticket to send along
2508 a S4U2PROXY request. If True, it will use additional_tickets
2509 as usual.
2510 :param for_user: if provided, requests S4U2SELF for that user.
2511
2512 See :func:`~scapy.layers.kerberos.krb_tgs_req` for the the other parameters.
2513 """
2514 ticket, sessionkey, upn, _ = self.export_krb(i)
2515
2516 if additional_tickets is None:
2517 additional_tickets = []
2518
2519 # If `armor_with` is specified, get the armor ticket from our store
2520 armor_ticket, armor_ticket_skey, armor_ticket_upn = None, None, None
2521 if armor_with is not None:
2522 fast = True
2523 armor_ticket, armor_ticket_skey, armor_ticket_upn, _ = self.export_krb(
2524 armor_with
2525 )
2526
2527 # If `s4u2proxy` is an index, get the ticket to armor with
2528 if isinstance(s4u2proxy, int):
2529 additional_tickets.append(self.export_krb(s4u2proxy)[0])
2530 s4u2proxy = True
2531
2532 res = krb_tgs_req(
2533 upn,
2534 spn,
2535 sessionkey=sessionkey,
2536 ticket=ticket,
2537 ip=ip,
2538 renew=renew,
2539 realm=realm,
2540 s4u2proxy=s4u2proxy,
2541 additional_tickets=additional_tickets,
2542 fast=fast,
2543 for_user=for_user,
2544 armor_ticket=armor_ticket,

Callers

nothing calls this directly

Calls 4

export_krbMethod · 0.95
import_krbMethod · 0.95
krb_tgs_reqFunction · 0.90
appendMethod · 0.45

Tested by

no test coverage detected