# gentilkiwi/mimikatz architecture

> Architecture diagram of the GitHub repository gentilkiwi/mimikatz, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/gentilkiwi/mimikatz
- Repository: https://github.com/gentilkiwi/mimikatz

## Overview

##### Main Components Identification
The system should be divided into these major components:

a. Core Components:
- Main Executable (mimikatz.exe)
- Driver Component (mimidrv)
- Library Component (mimilib)
- Modules System

b. Module Categories:
- Security Modules (sekurlsa, kerberos, crypto)
- System Interaction Modules (process, service, token)
- Utility Modules (output, string, memory)

**[Command Line Interface]**
- ↓
**[Command Parser/Dispatcher]**

**[Module Manager]**
- ↙     ↓     ↘
**[Sekurlsa] [Kerberos] [Crypto]**
- ↓         ↓         ↓
**[Other Specialized Modules]**

**[Memory Management] ← → [Process Interaction]**
- ↕                      ↕
**[System Services API] ← → [Driver Interface]**

**[Windows API] [Driver Level] [System Services]**

##### Key Relationships to Highlight

- Command flow: User → Module
- Memory access: Modules ↔ Memory Management
- System interaction: Modules ↔ Windows API

b. Dependencies:
- Driver interactions (thick lines)

##### Component Details

For each major module, show:
- Entry points
- Main functions
- Dependencies
- Security boundaries

##### Notes Section

Technical notes about:
- Security considerations
- Windows version compatibility
- Required privileges
- Module interactions

Remember to highlight the modular architecture and how different components interact with Windows security subsystems, especially for credential access and manipulation functionality.

This design should be created using a professional diagramming tool that supports layered architecture representation and clear relationship indicators.

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph UI
        CLI[Command Line Interface]
        Parser[Command Parser/Dispatcher]
        CLI --> Parser
    end

    subgraph Core
        MainExe["Main Executable"]:::main
        ModuleManager["Module Manager"]
        MainExe --> ModuleManager
        Parser --> ModuleManager
    end

    subgraph SecurityModules
        Sekurlsa["Sekurlsa Module"]:::security
        Kerberos["Kerberos Module"]:::security
        Crypto["Crypto Module"]:::security
        ModuleManager --> Sekurlsa
        ModuleManager --> Kerberos
        ModuleManager --> Crypto
    end

    subgraph SystemModules
        Process["Process Module"]:::system
        Service["Service Module"]:::system
        Token["Token Module"]:::system
        ModuleManager --> Process
        ModuleManager --> Service
        ModuleManager --> Token
    end

    subgraph UtilityModules
        Output["Output Module"]:::utility
        String["String Module"]:::utility
        Memory["Memory Module"]:::utility
        ModuleManager --> Output
        ModuleManager --> String
        ModuleManager --> Memory
    end

    subgraph Support
        MemoryMgmt["Memory Management"]
        ProcessInt["Process Interaction"]
        SysServices["System Services API"]
        DriverInt["Driver Interface"]
        
        MemoryMgmt <--> ProcessInt
        SysServices <--> DriverInt
        MemoryMgmt <--> SysServices
    end

    subgraph WindowsIntegration
        WinAPI["Windows API"]
        Driver["Driver Component"]:::driver
        SysSvc["System Services"]
        
        DriverInt --> Driver
        SysServices --> SysSvc
        ProcessInt --> WinAPI
    end

    SecurityModules --> MemoryMgmt
    SystemModules --> ProcessInt
    UtilityModules --> SysServices

    %% Component Mappings
    click MainExe "https://github.com/gentilkiwi/mimikatz/blob/master/mimikatz/mimikatz.c"
    click Driver "https://github.com/gentilkiwi/mimikatz/blob/master/mimidrv/mimidrv.c"
    click Sekurlsa "https://github.com/gentilkiwi/mimikatz/blob/master/mimikatz/modules/sekurlsa/kuhl_m_sekurlsa.c"
    click Kerberos "https://github.com/gentilkiwi/mimikatz/blob/master/mimikatz/modules/kerberos/kuhl_m_kerberos.c"
    click Crypto "https://github.com/gentilkiwi/mimikatz/blob/master/mimikatz/modules/crypto/kuhl_m_crypto_pki.c"
    click Process "https://github.com/gentilkiwi/mimikatz/blob/master/modules/kull_m_process.c"
    click Service "https://github.com/gentilkiwi/mimikatz/blob/master/modules/kull_m_service.c"
    click Token "https://github.com/gentilkiwi/mimikatz/blob/master/modules/kull_m_token.c"
    click Output "https://github.com/gentilkiwi/mimikatz/blob/master/modules/kull_m_output.c"
    click String "https://github.com/gentilkiwi/mimikatz/blob/master/modules/kull_m_string.c"
    click Memory "https://github.com/gentilkiwi/mimikatz/blob/master/modules/kull_m_memory.c"

    %% Styling
    classDef security fill:#ff6b6b
    classDef system fill:#4ecdc4
    classDef utility fill:#45b7d1
    classDef driver fill:#ffd93d
    classDef main fill:#95a5a6

    %% Legend
    subgraph Legend
        L1[Security Module]:::security
        L2[System Module]:::system
        L3[Utility Module]:::utility
        L4[Driver Component]:::driver
        L5[Main Component]:::main
    end
```
