# lgandx/responder architecture

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

- Interactive diagram: https://gitdiagram.com/lgandx/responder
- Repository: https://github.com/lgandx/responder

## Overview

##### Main Components
- Central Orchestrator: At the core, the Responder.py script acts as the main entry point that orchestrates the operation of all modules. It uses configuration settings (from Responder.conf and settings.py) to decide which functionality to activate.
- Protocol Poisoners: Located in the “poisoners” directory (modules such as LLMNR.py, NBTNS.py, MDNS.py, DHCP.py in servers/tools), these components are responsible for intercepting specific network requests.
- Protocol Servers: The “servers” directory contains modules (DNS.py, FTP.py, HTTP.py, IMAP.py, Kerberos.py, LDAP.py, SMB.py, etc.) that simulate various authentication servers. They accept and process connections by mimicking the respective protocols—performing NTLM, LM, or Basic Auth challenges.
- Utility & Relay Tools: In the “tools” directory (including MultiRelay, BrowserListener.py, DNSUpdate.py, Icmp-Redirect.py etc.), these support auxiliary functions such as multi-relay attacks, additional network probing, or capturing specific protocol interactions.
- Logging & Reporting: Files and directories like logs/, Report.py, and DumpHash.py show that results (e.g., captured hashes and session logs) are recorded. An SQLite database might also be used as configured in Responder.conf.
- Certificates & Configurations: The certs/ directory and Responder.conf provide essential runtime configuration and cryptographic keys (self-signed certificates for HTTPS) required by some servers.

##### Relationships & Interactions
- The main script initiates the listening services, spawning different server components based on configuration.
- Each server (in the servers folder) listens on designated network ports (e.g., TCP 80 for HTTP, TCP 445 for SMB, UDP/TCP 53 for DNS) and interacts with the victim networks.
- Poisoners intercept non-HTTP network queries (LLMNR, NBT-NS, mDNS) and “poison” the responses.
- Utility tools may run concurrently or be used in a separate operational mode (e.g., Analyze mode) to monitor or enhance attack traffic.

##### Architectural Patterns & Technologies
- Modular Design: The separation into “servers,” “poisoners,” and “tools” suggests a plug-and-play approach where each module is independent. This makes it easier to add or remove protocol support.
- Event-Driven and Multithreaded Operation: Given the numerous protocols listened to simultaneously, concurrent processing (either via multithreading or event loops) is likely deployed.
- Configuration via Files: Use of configuration files (Responder.conf) and settings.py demonstrates a clear separation between code and configurable parameters.
- Use of Third-party Libraries: Dependencies listed in requirements.txt and the inclusion of external projects (such as impacket in MultiRelay) imply the use of external libraries to handle network protocols and authentication.

##### Detail and Clarity
- That network port interactions and protocol specifics (NTLM authentication, DNS poisoning, etc.) are marked where relevant.
- Detail the interconnection between the various tools and how they enhance the primary functionality (for instance, MultiRelay’s integration with impacket for advanced attacks).

Happy diagramming!

## Diagram (Mermaid)

```mermaid
flowchart TD
    IncomingTraffic("Incoming Traffic"):::network

    subgraph "Central Orchestrator"
        Responder("Responder.py\n(Main Controller)"):::controller
        Settings("settings.py"):::controller
        ConfigFile("Responder.conf"):::config
    end

    subgraph "Protocol Poisoners"
        LLMNR("LLMNR.py"):::poison
        NBTNS("NBTNS.py"):::poison
        MDNS("MDNS.py"):::poison
        DHCP("DHCP.py"):::poison
    end

    subgraph "Protocol Servers"
        DNS("DNS.py"):::server
        FTP("FTP.py"):::server
        HTTP("HTTP.py"):::server
        IMAP("IMAP.py"):::server
        Kerberos("Kerberos.py"):::server
        LDAP("LDAP.py"):::server
        SMB("SMB.py"):::server
    end

    subgraph "Utility & Relay Tools"
        MultiRelay("MultiRelay"):::tools
        BrowserListener("BrowserListener.py"):::tools
        DNSUpdate("DNSUpdate.py"):::tools
        IcmpRedirect("Icmp-Redirect.py"):::tools
    end

    subgraph "Logging & Reporting"
        Logs("logs/"):::logging
        DumpHash("DumpHash.py"):::logging
        Report("Report.py"):::logging
    end

    subgraph "Certificates & Configurations"
        Certs("certs/"):::config
    end

    %% Data Flow
    IncomingTraffic -->|"HTTP_req"| HTTP
    IncomingTraffic -->|"LLMNR_req"| LLMNR
    IncomingTraffic -->|"FTP_req"| FTP
    IncomingTraffic -->|"SMB_req"| SMB

    %% Configuration injected into the Central Orchestrator
    ConfigFile --> Responder
    Certs --> Responder

    %% Central orchestrator spawns modules
    Responder -->|"launch_poisoners"| LLMNR
    Responder -->|"launch_servers"| HTTP
    Settings --> Responder

    %% Utility tools integration
    Responder -->|"integrate_tools"| MultiRelay
    MultiRelay -->|"relay_to_servers"| HTTP
    BrowserListener -->|"monitor"| HTTP
    DNSUpdate -->|"update_dns"| DNS
    IcmpRedirect -->|"redirect_traffic"| HTTP

    %% Logging and Reporting connections
    LLMNR -->|"log_data"| Logs
    NBTNS -->|"log_data"| Logs
    MDNS -->|"log_data"| Logs
    DHCP -->|"log_data"| Logs
    DNS -->|"log_data"| Logs
    FTP -->|"log_data"| Logs
    HTTP -->|"log_data"| Logs
    IMAP -->|"log_data"| DumpHash
    Kerberos -->|"log_data"| Logs
    LDAP -->|"log_data"| Logs
    SMB -->|"log_data"| Logs
    MultiRelay -->|"log_data"| Report

    %% Click Events
    click Responder "https://github.com/lgandx/responder/blob/master/Responder.py"
    click Settings "https://github.com/lgandx/responder/blob/master/settings.py"
    click ConfigFile "https://github.com/lgandx/responder/blob/master/Responder.conf"
    click LLMNR "https://github.com/lgandx/responder/tree/master/poisoners/"
    click NBTNS "https://github.com/lgandx/responder/tree/master/poisoners/"
    click MDNS "https://github.com/lgandx/responder/tree/master/poisoners/"
    click DHCP "https://github.com/lgandx/responder/tree/master/poisoners/"
    click DNS "https://github.com/lgandx/responder/tree/master/servers/"
    click FTP "https://github.com/lgandx/responder/tree/master/servers/"
    click HTTP "https://github.com/lgandx/responder/tree/master/servers/"
    click IMAP "https://github.com/lgandx/responder/tree/master/servers/"
    click Kerberos "https://github.com/lgandx/responder/tree/master/servers/"
    click LDAP "https://github.com/lgandx/responder/tree/master/servers/"
    click SMB "https://github.com/lgandx/responder/tree/master/servers/"
    click MultiRelay "https://github.com/lgandx/responder/tree/master/tools/"
    click BrowserListener "https://github.com/lgandx/responder/tree/master/tools/"
    click DNSUpdate "https://github.com/lgandx/responder/tree/master/tools/"
    click IcmpRedirect "https://github.com/lgandx/responder/tree/master/tools/"
    click Logs "https://github.com/lgandx/responder/tree/master/logs/"
    click DumpHash "https://github.com/lgandx/responder/blob/master/DumpHash.py"
    click Report "https://github.com/lgandx/responder/blob/master/Report.py"
    click Certs "https://github.com/lgandx/responder/tree/master/certs/"

    %% Styles
    classDef network fill:#ffcc00,stroke:#000,stroke-width:2px;
    classDef controller fill:#99ccff,stroke:#000,stroke-width:2px;
    classDef config fill:#cfc,stroke:#000,stroke-width:2px;
    classDef poison fill:#ff9999,stroke:#000,stroke-width:2px;
    classDef server fill:#99ff99,stroke:#000,stroke-width:2px;
    classDef tools fill:#ffccff,stroke:#000,stroke-width:2px;
    classDef logging fill:#ffff99,stroke:#000,stroke-width:2px;
```
