# an0nud4y/evilginx-phishing-infra-setup architecture

> Architecture diagram of the GitHub repository an0nud4y/evilginx-phishing-infra-setup, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/an0nud4y/evilginx-phishing-infra-setup
- Repository: https://github.com/an0nud4y/evilginx-phishing-infra-setup

## Overview

##### Project type and purpose
- This repository is a documentation and automation-playbook for building a Phishing Engagement Infrastructure (i.e., a red-team phishing platform).
- It covers domain procurement & reputation checking, email delivery methods, multiple phishing proxies (Evilginx, GoPhish), email template‐linting, OPSEC/anti-detection hardening, and defense research.

##### Main architectural components
a. Domain Management & Reputation Services
- Domain registrar/DNS provider (automated via scripts or cloud APIs)
- External categorization/reputation APIs (Bluecoat, McAfee, Palo Alto, FortiGuard, etc.)
b. Certificate Authority
- Let’s Encrypt (wildcard cert issuance for phishing domains)
c. Edge Proxy & WAF
- Cloudflare (DNS proxy, basic WAF, TLS termination)
- Nginx reverse proxy (to obfuscate Golang fingerprints, enforce UA rules)
d. Phishing Proxy Layer
- Evilginx2 instances (HTTP/S mitm to proxy legitimate sites, inject JS, capture credentials)
- Phishlets (custom scripts, wildcard cert automation)
e. Campaign Management & SMTP Relay
- GoPhish server (campaign orchestration, landing pages, tracking pixel)
- External SMTP services (SendGrid, Mailgun, AWS SES, or Microsoft365/Azure)
- Email‐template tooling (HTML linter, spam header decoder)
f. Data Storage & Analytics
- SQLite (GoPhish or Evilginx session DBs)
- Log aggregation/monitoring (custom scripts, mail-tester)
g. Attacker Workstation
- CLI/tools to automate deployment (Terraform/Ansible/Github Actions)
- Local dev scripts for phishlet building and testing

##### Relationships and data flows
- Attacker workstation → (1) Domain API calls → DNS provider
- Attacker workstation → (2) Cert-request → Let’s Encrypt
- Attacker workstation → (3) Cloudflare config → Proxy/TLS setup
- Target user email flow:
- GoPhish → SMTP relay → Target inbox
- Target clicks link to phishing domain → Cloudflare → Nginx → Evilginx → real site upstream
- Evilginx injects JS, captures credentials → writes to core/http_proxy.go DB
- GoPhish GUI/API for campaign metrics → Analyst workstation

##### Architectural patterns & design principles
- Layered security & defense-in-depth: separate domain management, TLS termination, proxying, app logic
- Modular phishlets: each target site encapsulated as a self-contained proxy rule
- Microservices style: GoPhish and Evilginx run as distinct services behind Nginx
- Infrastructure-as-Code: automate setup to reduce OPSEC leaks

- Notes on OPSEC hardening layers (header removal, UA filters, JS obfuscation)
- Components into logical tiers: Provisioning → Edge Proxy → Phishing Services → Data Store → Analyst

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Provisioning Layer"
        AW["Attacker Workstation"]:::work
        DR["Domain Registrar/DNS Provider"]:::infra
        CA["Let's Encrypt (Cert Authority)"]:::infra
        ER["External Reputation APIs"]:::external
    end

    subgraph "Edge Proxy Layer"
        CF["Cloudflare (WAF)"]:::infra
        NG["Nginx Reverse Proxy"]:::infra
    end

    subgraph "Phishing Services"
        EG["Evilginx2"]:::phish
        GP["GoPhish (SQLite3)"]:::phish
    end

    subgraph "Delivery & Data Capture"
        SMTP["SMTP Relay\n(SendGrid/Mailgun/AWS SES/M365)"]:::external
        TU["Target User Client"]:::external
        DB["SQLite DB"]:::datastore
        LA["Log Aggregation/Monitoring"]:::external
        AWL["Analyst Workstation"]:::work
    end

    AW -->|"DNS update"| DR
    AW -->|"Cert request"| CA
    AW -->|"Reputation check"| ER
    AW -->|"Cloudflare config"| CF

    CF -->|"TLS terminate"| NG
    NG -->|"Proxy traffic"| EG
    NG -->|"Route campaigns"| GP

    GP -->|"SMTP send"| SMTP
    SMTP -->|"Email deliver"| TU
    TU -->|"Click link"| CF

    EG -->|"Inject JS & capture"| DB
    EG -->|"Upstream proxy to real site"| ER

    GP -->|"Write sessions"| DB
    GP -->|"Send logs"| LA
    GP -->|"GUI/API metrics"| AWL

    AWL -->|"Query data"| DB

    classDef infra fill:#ADD8E6,stroke:#333,stroke-width:1px
    classDef phish fill:#90EE90,stroke:#333,stroke-width:1px
    classDef external fill:#D3D3D3,stroke:#333,stroke-width:1px
    classDef work fill:#FFEDA0,stroke:#333,stroke-width:1px
    classDef datastore fill:#FFE4B5,stroke:#333,stroke-width:1px

    click AW "https://github.com/an0nud4y/evilginx-phishing-infra-setup/blob/main/README.md"
    click DR "https://github.com/an0nud4y/evilginx-phishing-infra-setup/blob/main/README.md"
    click img "https://github.com/an0nud4y/evilginx-phishing-infra-setup/tree/main/img/"
```
