# nejcpirecnik/devil-s-cupid architecture

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

- Interactive diagram: https://gitdiagram.com/nejcpirecnik/devil-s-cupid
- Repository: https://github.com/nejcpirecnik/devil-s-cupid

## Overview

##### Main Components

a. Client-Side Components (Attack Vector):
- Rubber Ducky USB Device (Entry Point)
- Target Windows Machine
- PowerShell Script Execution Environment

b. Server-Side Components:
- DropBox API/Storage
- Attacker's Collection Point

##### Flow and Relationships

**[Physical Layer]    [Execution Layer]    [Storage Layer]    [Collection Layer]**
**Rubber Ducky    →   Target Windows    →   DropBox API    →   Attacker's Access**
**(inject.bin)        (PowerShell)         (Credentials)      (Retrieved Data)**

##### Specific Elements

a. Components:

b. Data Flows:
- USB HID injection → PowerShell execution
- PowerShell → Fake authentication popup
- Credentials → DropBox upload
- DropBox → Attacker access

##### Technical Details

- HID Injection mechanism
- PowerShell execution parameters (-w h -NoP -NonI -Exec Bypass)
- DropBox API integration points
- Authentication token flow
- Credential capture mechanism

##### Important Notes

- "Leaves no trace" feature
- Required permissions for DropBox API
- Token authentication flow
- File delivery mechanism

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Styles and classes
    classDef physical fill:#ff6b6b,stroke:#333,stroke-width:2px
    classDef execution fill:#4ecdc4,stroke:#333,stroke-width:2px
    classDef storage fill:#45b7d1,stroke:#333,stroke-width:2px
    classDef attacker fill:#a367dc,stroke:#333,stroke-width:2px
    classDef warning fill:#ffd93d,stroke:#333,stroke-width:2px

    %% Title and Warning
    subgraph title["The Devil's Cupid - Security Testing Tool"]
        warning["⚠️ FOR SECURITY TESTING PURPOSES ONLY"]:::warning
    end

    %% Physical Layer
    subgraph physical["Physical Layer"]
        rubber["Rubber Ducky USB"]
        inject["inject.bin Script"]
    end
    click inject "https://github.com/nejcpirecnik/Devil-s-Cupid/blob/main/inject.txt"

    %% Execution Layer
    subgraph execution["Execution Layer"]
        windows["Target Windows Machine"]
        powershell["PowerShell Environment\n(-w h -NoP -NonI -Exec Bypass)"]
        popup["Credential Harvesting Popup"]
    end
    click powershell "https://github.com/nejcpirecnik/Devil-s-Cupid/blob/main/devilsCupid.ps1"

    %% Storage Layer
    subgraph storage["Storage Layer"]
        dropbox["DropBox API/Storage"]
        creds["Captured Credentials"]
    end

    %% Attacker Layer
    subgraph attacker["Collection Layer"]
        collection["Attacker's Collection Point"]
        access["Retrieved Data"]
    end

    %% Connections
    rubber --> inject
    inject --> windows
    windows --> powershell
    powershell --> popup
    popup --> creds
    creds --> dropbox
    dropbox --> collection
    collection --> access

    %% Legend
    subgraph legend["Legend"]
        l1["Physical Components"]:::physical
        l2["Execution Components"]:::execution
        l3["Storage Components"]:::storage
        l4["Attacker Components"]:::attacker
    end

    %% Apply styles
    class rubber,inject physical
    class windows,powershell,popup execution
    class dropbox,creds storage
    class collection,access attacker
```
