# insecurityofthings/jackit architecture

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

- Interactive diagram: https://gitdiagram.com/insecurityofthings/jackit
- Repository: https://github.com/insecurityofthings/jackit

## Overview

##### Project type and purpose
- JackIt is a Python-based, command-line exploit tool for wireless keyboards and mice using the MouseJack vulnerability and a CrazyRadio PA dongle. It combines packet sniffing, keystroke logging, and scripted payload injection (Duckyscript).

##### File structure
- Top-level:
- bin/jackit – executable entry point
- jackit/ – core package
- examples/ – sample payloads and usage demos
- requirements.txt, setup.py, tox.ini – build, install, test configuration
- Inside jackit/:
- duckyparser.py – Duckyscript parser and encoder
- keylogger.py, keymap.py – sniffed keystroke capture and mapping
- mousejack.py – core sniff/inject control loop and CLI interface
- lib/ – low-level CrazyRadio PA radio drivers (nrf24 interface)
- plugins/ – vendor-specific protocol handlers (amazon, logitech, microsoft, etc.)
- test/ – unit tests for parser and other modules

##### Key insights from README
- Exploit workflow: use CrazyRadio PA to monitor 2.4 GHz traffic, identify vulnerable devices, log keystrokes, optionally inject payloads via Duckyscript.
- External dependencies: Bastille’s mousejack firmware, Python libraries from requirements.txt.
- Architecture is modular: separates hardware interface, protocol plugins, script parsing, CLI orchestration.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% User and CLI
    User(("User")):::external
    CLI["CLI Entry Point\n(bin/jackit)"]:::core
    User -->|runs| CLI
    click CLI "https://github.com/insecurityofthings/jackit/tree/master/bin/jackit"

    %% Core Controller
    Controller["Core Controller\n(mousejack.py)"]:::core
    CLI -->|invokes| Controller
    click Controller "https://github.com/insecurityofthings/jackit/blob/master/jackit/mousejack.py"

    %% Infrastructure Layer
    subgraph "Radio Driver Layer"
        direction TB
        Driver1["nrf24.py"]:::infra
        Driver2["nrf24_reset.py"]:::infra
        Driver1 --> Driver2
        click Driver1 "https://github.com/insecurityofthings/jackit/blob/master/jackit/lib/nrf24.py"
        click Driver2 "https://github.com/insecurityofthings/jackit/blob/master/jackit/lib/nrf24_reset.py"
    end
    Controller -->|initializes| Driver1

    Hardware["CrazyRadio PA\n(Hardware)"]:::infra
    Driver2 -->|accesses| Hardware
    Hardware -->|raw RF packets| Driver1

    %% Protocol Plugins
    subgraph "Protocol Plugins" 
        direction TB
        Amazon["amazon.py"]:::core
        Logitech["logitech.py"]:::core
        Microsoft["microsoft.py"]:::core
        MicrosoftEnc["microsoft_enc.py"]:::core
        click Amazon "https://github.com/insecurityofthings/jackit/blob/master/jackit/plugins/amazon.py"
        click Logitech "https://github.com/insecurityofthings/jackit/blob/master/jackit/plugins/logitech.py"
        click Microsoft "https://github.com/insecurityofthings/jackit/blob/master/jackit/plugins/microsoft.py"
        click MicrosoftEnc "https://github.com/insecurityofthings/jackit/blob/master/jackit/plugins/microsoft_enc.py"
    end
    Driver1 -->|passes raw packets| Amazon
    Driver1 -->|passes raw packets| Logitech
    Driver1 -->|passes raw packets| Microsoft
    Driver1 -->|passes raw packets| MicrosoftEnc

    %% Logger & Keymap
    subgraph "Keystroke Logger & Keymap"
        direction TB
        Logger["keylogger.py"]:::core
        Keymap["keymap.py"]:::core
        click Logger "https://github.com/insecurityofthings/jackit/blob/master/jackit/keylogger.py"
        click Keymap "https://github.com/insecurityofthings/jackit/blob/master/jackit/keymap.py"
    end
    Amazon -->|decoded keystrokes| Keymap
    Logitech -->|decoded keystrokes| Keymap
    Microsoft -->|decoded keystrokes| Keymap
    MicrosoftEnc -->|decoded keystrokes| Keymap
    Keymap -->|mapped keystrokes| Logger
    Logger -->|output to console/file| User

    %% Scripting Layer
    subgraph "Scripting & Payloads"
        direction TB
        Examples["Payload Examples\n(examples/)"]:::scripting
        Parser["Duckyscript Parser\n(duckyparser.py)"]:::scripting
        click Examples "https://github.com/insecurityofthings/jackit/tree/master/examples/"
        click Parser "https://github.com/insecurityofthings/jackit/blob/master/jackit/duckyparser.py"
    end
    Controller -->|injection mode| Parser
    Examples -->|reads payload| Parser
    Parser -->|HID payloads| Driver1

    %% Auxiliary Components
    subgraph "Auxiliary" 
        direction TB
        TestSuite["Test Suite\n(jackit/test/)"]:::aux
        Packaging["Packaging & Deployment\n(setup.py,\nrequirements.txt,\ntox.ini)"]:::aux
        click TestSuite "https://github.com/insecurityofthings/jackit/tree/master/jackit/test/"
        click Packaging "https://github.com/insecurityofthings/jackit/blob/master/setup.py"
        %% Note: requirements and tox not clickable per mapping
    end
    TestSuite -.->|tests parser/plugins| Parser
    TestSuite -.->|tests parser/plugins| Amazon
    Packaging -.->|configures build| CLI
    Packaging -.->|configures build| Controller

    %% Styles
    classDef infra fill:#add8e6,stroke:#333,stroke-width:1px
    classDef core fill:#90ee90,stroke:#333,stroke-width:1px
    classDef scripting fill:#ffa500,stroke:#333,stroke-width:1px
    classDef aux fill:#f0f0f0,stroke-dasharray: 5 5,stroke:#333
    classDef external fill:#ffffff,stroke:#333,stroke-width:1px,stroke-dasharray: 2 2
```
