Skip to main content
Artifacts Generated: WindowsAPIInvoke

Summary

Adds Kerberos tickets to the current logon session’s ticket cache using LSA APIs. Supports loading tickets from base64-encoded data or existing Mythic credential store entries. Can target specific logon sessions when executed from elevated context.
  • Needs Admin: False (elevated context required for targeting specific LUIDs)
  • Version: 2
  • Author: @drago-qcc

Arguments

  • base64ticket (String, Required for “Add New Ticket” group) - Base64-encoded Kerberos ticket
  • existingTicket (Credential_JSON, Required for “Use Existing Ticket” group) - Existing ticket from Mythic credential store
  • luid (String, Optional) - Target LUID for ticket loading (requires elevation)

Usage

Output:

Detailed Summary

Agent Execution Flow

1. Parameter Processing and Validation

  • Requires JSON parameter format only
  • Supports two parameter groups: “Add New Ticket” and “Use Existing Ticket”
  • Validates JSON structure before processing

2. Ticket Source Resolution (Python)

  • Handles existing ticket selection from credential store
  • Extracts credential data and converts to base64ticket parameter
  • Maintains parameter group information for processing

3. Ticket Parsing and Credential Creation

  • Uses Impacket CCache to parse Kerberos ticket structure
  • Extracts client, server, and timing information
  • Creates credential entry in Mythic for new tickets
  • Formats detailed comment with ticket metadata

4. LSA Connection and Package Resolution (C#)

  • Establishes LSA connection using LsaConnectUntrusted
  • Elevates to SYSTEM for high integrity contexts
  • Looks up Kerberos authentication package
  • Generates appropriate artifacts for API calls

5. Ticket Loading Process

  • Creates KERB_SUBMIT_TKT_REQUEST structure
  • Allocates memory for request and ticket data
  • Uses LsaCallAuthenticationPackage to submit ticket
  • Handles memory management and cleanup

6. LUID Handling and Target Selection

  • Uses current logon session LUID for non-elevated contexts
  • Allows targeting specific LUID when elevated
  • Validates integrity level before LUID targeting

7. Memory Management and Cleanup

  • Frees allocated memory for request structure
  • Releases LSA return buffers
  • Deregisters LSA logon process
  • Ensures proper cleanup regardless of success/failure

Kerberos Ticket Structure

KERB_SUBMIT_TKT_REQUEST Structure

  • MessageType: Specifies ticket submission operation
  • LogonId: Target logon session identifier
  • KerbCredSize: Size of ticket data in bytes
  • KerbCredOffset: Offset to ticket data within request

Ticket Metadata Extraction

Error Handling

LSA Operation Errors

  • Checks both API status and protocol status
  • Converts NTSTATUS codes to Win32 error codes
  • Provides detailed error information

Connection Initialization Errors

  • Validates LSA connection establishment
  • Handles authentication package lookup failures
  • Provides specific error context

Integration Points

TicketManager Integration

  • Provides interface to KerberosHelpers functionality
  • Handles LUID string conversion
  • Maintains consistent API surface

Mythic Credential Store Integration

  • Creates credential entries for loaded tickets
  • Stores ticket metadata for future reference
  • Enables ticket reuse across operations

Display Parameters

Parameter Display Format

  • Shows client and service principals
  • Includes target LUID when specified
  • Provides clear operation summary

APIs Used

MITRE ATT&CK Mapping

  • T1550 - Use Alternate Authentication Material
  • T1550.003 - Use Alternate Authentication Material: Pass the Ticket

Security Considerations

  • Ticket Injection: Loads arbitrary Kerberos tickets into system cache
  • LSA Interaction: Direct interaction with Local Security Authority
  • Privilege Requirements: Elevated context needed for cross-session operations
  • Credential Storage: Tickets stored in Mythic credential database
  • Session Targeting: Can target specific logon sessions when elevated

Limitations

  1. JSON Format Only: Requires JSON parameter format
  2. Elevation for LUID: Targeting specific LUIDs requires elevated context
  3. Valid Tickets: Only accepts properly formatted Kerberos tickets
  4. Memory Constraints: Large tickets may cause memory allocation issues
  5. LSA Dependencies: Requires functional LSA subsystem
  6. Session Access: Limited to accessible logon sessions

Error Conditions

  • Invalid JSON: Malformed JSON parameters
  • LSA Connection Failed: Cannot connect to Local Security Authority
  • Package Lookup Failed: Kerberos authentication package not found
  • Ticket Submit Failed: LSA rejected ticket submission
  • Memory Allocation Failed: Insufficient memory for ticket operations
  • Invalid Ticket Format: Malformed or corrupted ticket data
  • Access Denied: Insufficient privileges for target LUID

Best Practices

  1. Ticket Validation: Verify ticket format before loading
  2. Error Monitoring: Check for LSA operation failures
  3. Memory Management: Monitor memory usage for large tickets
  4. Credential Tracking: Use Mythic credential store for ticket management
  5. LUID Awareness: Understand target session implications
  6. Privilege Context: Ensure appropriate elevation for cross-session operations