# azeemidrisi/phonesploit-pro architecture

> Architecture diagram of the GitHub repository azeemidrisi/phonesploit-pro, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-04-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/azeemidrisi/phonesploit-pro
- Repository: https://github.com/azeemidrisi/phonesploit-pro

## Overview

1. **What this repo is**
   PhoneSploit Pro is a Python 3.10+ command-line toolkit for controlling Android devices primarily through **ADB**, with an optional **Metasploit** workflow for payload generation and session establishment. It is not a web app; the main architecture is a local interactive console app that orchestrates external binaries.

2. **Entry point and application shell**
   `phonesploitpro.py` is the top-level launcher. The user experience is driven by a text UI built from modules like `modules/cli.py`, `modules/console.py`, `modules/banner.py`, and `modules/color.py`. These likely handle menu rendering, prompts, terminal formatting, and session state for an interactive operator workflow.

3. **Core orchestration layer**
   `modules/app_manager.py` appears to be the central coordinator that binds the UI to feature handlers. It likely routes user actions into the appropriate subsystem, maintains the active device context, and sequences multi-step tasks such as connect → verify → execute → pull artifacts.

4. **Device connection boundary**
   `modules/connection.py`, `modules/device.py`, `modules/root_check.py`, and `modules/security.py` form the device-facing control plane. This boundary is responsible for discovering devices, connecting over USB or TCP/IP ADB, selecting a target device, checking access level/root heuristics, and executing privileged or diagnostic device commands.

5. **ADB command execution and remote control**
   A large share of the functionality is “remote device operations over ADB,” including shell access, key events, reboot/power actions, permission changes, launching apps, and opening system screens. These capabilities are concentrated in modules such as `modules/input_control.py`, `modules/tools.py`, `modules/wifi_utils.py`, and parts of `modules/device.py`, which together implement the operational layer above raw ADB.

6. **File and artifact transfer subsystem**
   `modules/file_manager.py` and `modules/data_extraction.py` handle movement of files and structured data between the device and host. This includes downloading/uploading files, copying screenshots/photos/WhatsApp data, and exporting SMS, contacts, and call logs. This subsystem is a key boundary between on-device content and host-side storage.

7. **Media capture and streaming**
   `modules/media.py` covers screenshot capture, screen recording, mirroring/control via `scrcpy`, and audio capture/streaming. This subsystem bridges ADB-driven device actions with host-side media processing and external playback/recording tools.

8. **Network and port-forwarding layer**
   `modules/port_forward.py` and `modules/wifi_utils.py` cover network-oriented operations: TCP forwarding through ADB, Wi‑Fi status queries, WLAN IP information, radio toggles, ping checks, and network snapshots. This is the repo’s network-control boundary for interacting with the device and helping locate or expose services over the LAN.

9. **Metasploit/payload workflow**
   `modules/communication.py` and `modules/extras.py` likely implement the “one-click” exploit workflow described in the README: derive `LHOST`, generate a payload with `msfvenom`, install it through ADB, and launch `msfconsole` for a meterpreter session. This is a separate attack-oriented subsystem built on top of the ADB control plane and external Metasploit binaries.

10. **Configuration, console utilities, and shared helpers**
    `modules/config.py` stores runtime settings and feature options; `modules/connection.py` and `modules/console.py` likely centralize reusable command execution and prompt logic; `modules/banner.py`, `modules/color.py`, and `modules/tools.py` provide presentation and helper utilities. These are supporting layers rather than feature owners.

11. **Runtime dependencies and external tool boundaries**
    The repo’s architecture depends materially on external executables: **adb**, **scrcpy**, **nmap**, and **Metasploit Framework**. Python is the orchestrator, but actual device access, scanning, mirroring, and payload generation are delegated to these host-installed tools.

12. **Operational flow**
    A typical flow is: start the CLI → connect to or select an Android target → execute ADB-backed device actions or file transfers → optionally use network scans/forwarding → optionally launch the Metasploit path for payload/session handling. The architecture is therefore centered on a single operator session that fans out into specialized command modules.

13. **Architectural shape**
    This is a layered, tool-automation repository: a thin interactive front end, a set of feature-specific service modules, and a hard dependency boundary on external Android/security tooling. For an architecture diagram, the most important boxes are the CLI entrypoint, the ADB/device-control core, the media/data/network subsystems, and the external binaries they invoke.

Main entry points: [`modules/app_manager.py`](https://github.com/azeemidrisi/phonesploit-pro/blob/main/modules/app_manager.py) (App Manager), [`modules/cli.py`](https://github.com/azeemidrisi/phonesploit-pro/blob/main/modules/cli.py) (CLI), [`modules/wifi_utils.py`](https://github.com/azeemidrisi/phonesploit-pro/blob/main/modules/wifi_utils.py) (Wi‑Fi Utils), [`modules/media.py`](https://github.com/azeemidrisi/phonesploit-pro/blob/main/modules/media.py) (Media)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_grp_entry["Entry & UI"]
  node_n_launcher["Launcher<br/>entrypoint<br/>[phonesploitpro.py]"]
  node_n_cli["CLI<br/>interactive-ui<br/>[cli.py]"]
end

subgraph group_grp_core["ADB Control Core"]
  node_n_appmgr["App Manager<br/>orchestrator<br/>[app_manager.py]"]
  node_n_conn["Connection<br/>device-link<br/>[connection.py]"]
  node_n_device["Device<br/>[device.py]"]
  node_n_root["Root Check<br/>privilege-check<br/>[root_check.py]"]
  node_n_security["Security<br/>device-policy<br/>[security.py]"]
end

subgraph group_grp_data["Device Workflows"]
  node_n_input["Input Control<br/>remote-control<br/>[input_control.py]"]
  node_n_wifi["Wi‑Fi Utils<br/>network-ops<br/>[wifi_utils.py]"]
  node_n_forward["Port Forward<br/>networking<br/>[port_forward.py]"]
  node_n_files["File Manager<br/>artifact-transfer<br/>[file_manager.py]"]
  node_n_extract["Data Extraction<br/>collection<br/>[data_extraction.py]"]
  node_n_media["Media<br/>capture-stream<br/>[media.py]"]
end

subgraph group_grp_attack["Metasploit Flow"]
  node_n_comm["Communication<br/>payload-flow<br/>[communication.py]"]
  node_n_extras["Extras<br/>metasploit-ops<br/>[extras.py]"]
end

subgraph group_grp_support["Shared Support"]
  node_n_banner["Banner<br/>presentation<br/>[banner.py]"]
  node_n_color["Color<br/>presentation<br/>[color.py]"]
  node_n_console["Console<br/>prompt-shell<br/>[console.py]"]
  node_n_config["Config<br/>settings<br/>[config.py]"]
  node_n_tools["Tools<br/>adb-helpers<br/>[tools.py]"]
end

subgraph group_grp_ext["External Tools"]
  node_n_adb{{"ADB<br/>external-binary"}}
  node_n_scrcpy{{"scrcpy<br/>external-binary"}}
  node_n_nmap{{"nmap<br/>external-binary"}}
  node_n_msf{{"Metasploit<br/>external-binary"}}
end

node_n_launcher -->|"starts"| node_n_cli
node_n_cli -->|"renders"| node_n_banner
node_n_cli -->|"dispatches"| node_n_appmgr
node_n_appmgr -->|"connects"| node_n_conn
node_n_appmgr -->|"controls"| node_n_device
node_n_appmgr -->|"routes"| node_n_input
node_n_appmgr -->|"routes"| node_n_files
node_n_appmgr -->|"routes"| node_n_extract
node_n_appmgr -->|"routes"| node_n_media
node_n_appmgr -->|"routes"| node_n_forward
node_n_appmgr -->|"routes"| node_n_wifi
node_n_appmgr -->|"routes"| node_n_comm
node_n_appmgr -->|"applies"| node_n_security
node_n_conn -->|"checks"| node_n_root
node_n_device -->|"uses"| node_n_tools
node_n_input -->|"uses"| node_n_tools
node_n_files -->|"invokes"| node_n_adb
node_n_extract -->|"invokes"| node_n_adb
node_n_media -->|"invokes"| node_n_adb
node_n_media -->|"invokes"| node_n_scrcpy
node_n_wifi -->|"invokes"| node_n_adb
node_n_forward -->|"invokes"| node_n_adb
node_n_comm -->|"delegates"| node_n_extras
node_n_extras -->|"invokes"| node_n_msf
node_n_wifi -.->|"may use"| node_n_nmap
node_n_cli -->|"uses"| node_n_console
node_n_cli -->|"uses"| node_n_color
node_n_cli -->|"reads"| node_n_config
node_n_appmgr -->|"reads"| node_n_config

click node_n_launcher "https://github.com/azeemidrisi/phonesploit-pro/blob/main/phonesploitpro.py"
click node_n_cli "https://github.com/azeemidrisi/phonesploit-pro/blob/main/modules/cli.py"
click node_n_banner "https://github.com/azeemidrisi/phonesploit-pro/blob/main/modules/banner.py"
click node_n_color "https://github.com/azeemidrisi/phonesploit-pro/blob/main/modules/color.py"
click node_n_console "https://github.com/azeemidrisi/phonesploit-pro/blob/main/modules/console.py"
click node_n_config "https://github.com/azeemidrisi/phonesploit-pro/blob/main/modules/config.py"
click node_n_appmgr "https://github.com/azeemidrisi/phonesploit-pro/blob/main/modules/app_manager.py"
click node_n_conn "https://github.com/azeemidrisi/phonesploit-pro/blob/main/modules/connection.py"
click node_n_device "https://github.com/azeemidrisi/phonesploit-pro/blob/main/modules/device.py"
click node_n_root "https://github.com/azeemidrisi/phonesploit-pro/blob/main/modules/root_check.py"
click node_n_security "https://github.com/azeemidrisi/phonesploit-pro/blob/main/modules/security.py"
click node_n_input "https://github.com/azeemidrisi/phonesploit-pro/blob/main/modules/input_control.py"
click node_n_tools "https://github.com/azeemidrisi/phonesploit-pro/blob/main/modules/tools.py"
click node_n_wifi "https://github.com/azeemidrisi/phonesploit-pro/blob/main/modules/wifi_utils.py"
click node_n_forward "https://github.com/azeemidrisi/phonesploit-pro/blob/main/modules/port_forward.py"
click node_n_files "https://github.com/azeemidrisi/phonesploit-pro/blob/main/modules/file_manager.py"
click node_n_extract "https://github.com/azeemidrisi/phonesploit-pro/blob/main/modules/data_extraction.py"
click node_n_media "https://github.com/azeemidrisi/phonesploit-pro/blob/main/modules/media.py"
click node_n_comm "https://github.com/azeemidrisi/phonesploit-pro/blob/main/modules/communication.py"
click node_n_extras "https://github.com/azeemidrisi/phonesploit-pro/blob/main/modules/extras.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_n_launcher,node_n_cli toneBlue
class node_n_appmgr,node_n_conn,node_n_device,node_n_root,node_n_security toneAmber
class node_n_input,node_n_wifi,node_n_forward,node_n_files,node_n_extract,node_n_media toneMint
class node_n_comm,node_n_extras toneRose
class node_n_banner,node_n_color,node_n_console,node_n_config,node_n_tools toneIndigo
class node_n_adb,node_n_scrcpy,node_n_nmap,node_n_msf toneTeal
```

## Components

### Entry & UI

Launcher and interactive console layer.

- [Launcher](https://github.com/azeemidrisi/phonesploit-pro/blob/main/phonesploitpro.py): entrypoint · Top-level program that starts the operator session. · `phonesploitpro.py`
- [CLI](https://github.com/azeemidrisi/phonesploit-pro/blob/main/modules/cli.py): interactive-ui · Text-based menu and prompt flow. · `modules/cli.py`

### ADB Control Core

Device discovery, connection, and operator command coordination.

- [App Manager](https://github.com/azeemidrisi/phonesploit-pro/blob/main/modules/app_manager.py): orchestrator · Central coordinator that routes UI actions into feature modules. · `modules/app_manager.py`
- [Connection](https://github.com/azeemidrisi/phonesploit-pro/blob/main/modules/connection.py): device-link · ADB connection setup and target selection. · `modules/connection.py`
- [Device](https://github.com/azeemidrisi/phonesploit-pro/blob/main/modules/device.py): device-ops · General ADB-backed device operations and command execution. · `modules/device.py`
- [Root Check](https://github.com/azeemidrisi/phonesploit-pro/blob/main/modules/root_check.py): privilege-check · Heuristics for access level and root availability. · `modules/root_check.py`
- [Security](https://github.com/azeemidrisi/phonesploit-pro/blob/main/modules/security.py): device-policy · Security-related device actions and checks. · `modules/security.py`

### Device Workflows

File transfer, extraction, media, and network operations over the target device.

- [Input Control](https://github.com/azeemidrisi/phonesploit-pro/blob/main/modules/input_control.py): remote-control · Key events, screen actions, and input automation. · `modules/input_control.py`
- [Wi‑Fi Utils](https://github.com/azeemidrisi/phonesploit-pro/blob/main/modules/wifi_utils.py): network-ops · Wi‑Fi state, IP, and connectivity helpers. · `modules/wifi_utils.py`
- [Port Forward](https://github.com/azeemidrisi/phonesploit-pro/blob/main/modules/port_forward.py): networking · ADB forwarding and tunnel setup. · `modules/port_forward.py`
- [File Manager](https://github.com/azeemidrisi/phonesploit-pro/blob/main/modules/file_manager.py): artifact-transfer · Upload, download, and file movement between host and device. · `modules/file_manager.py`
- [Data Extraction](https://github.com/azeemidrisi/phonesploit-pro/blob/main/modules/data_extraction.py): collection · Exports structured device data such as SMS, contacts, and call logs. · `modules/data_extraction.py`
- [Media](https://github.com/azeemidrisi/phonesploit-pro/blob/main/modules/media.py): capture-stream · Screenshots, screen recording, mirroring, and audio capture. · `modules/media.py`

### Metasploit Flow

Optional payload and session workflow built on external security tools.

- [Communication](https://github.com/azeemidrisi/phonesploit-pro/blob/main/modules/communication.py): payload-flow · Coordinates payload delivery and session-facing communication steps. · `modules/communication.py`
- [Extras](https://github.com/azeemidrisi/phonesploit-pro/blob/main/modules/extras.py): metasploit-ops · Auxiliary exploit workflow and Metasploit orchestration. · `modules/extras.py`

### Shared Support

Configuration, presentation, and helper modules used across the app.

- [Banner](https://github.com/azeemidrisi/phonesploit-pro/blob/main/modules/banner.py): presentation · Startup branding and terminal header output. · `modules/banner.py`
- [Color](https://github.com/azeemidrisi/phonesploit-pro/blob/main/modules/color.py): presentation · Terminal styling and colored output helpers. · `modules/color.py`
- [Console](https://github.com/azeemidrisi/phonesploit-pro/blob/main/modules/console.py): prompt-shell · Reusable console and command interaction utilities. · `modules/console.py`
- [Config](https://github.com/azeemidrisi/phonesploit-pro/blob/main/modules/config.py): settings · Runtime options and feature settings. · `modules/config.py`
- [Tools](https://github.com/azeemidrisi/phonesploit-pro/blob/main/modules/tools.py): adb-helpers · Shared ADB command helpers and utility actions. · `modules/tools.py`

### External Tools

Host-installed binaries invoked by the Python orchestrator.

- **ADB**: external-binary · Primary device control binary used for shell, file, and network operations.
- **scrcpy**: external-binary · External screen mirroring and control tool.
- **nmap**: external-binary · Network scanning and discovery tool.
- **Metasploit**: external-binary · msfvenom and msfconsole workflow for payload generation and sessions.

## Connections

- Launcher → CLI: starts · Launches the interactive operator interface.
- CLI → Banner: renders · Displays startup branding and headers.
- CLI → App Manager: dispatches · Sends selected actions into the central coordinator.
- App Manager → Connection: connects · Establishes and manages the active device link.
- App Manager → Device: controls · Routes general device commands and workflows.
- App Manager → Input Control: routes · Invokes remote input and key-event actions.
- App Manager → File Manager: routes · Triggers file transfer operations.
- App Manager → Data Extraction: routes · Triggers structured data export.
- App Manager → Media: routes · Triggers media capture and mirroring tasks.
- App Manager → Port Forward: routes · Triggers forwarding and tunnel setup.
- App Manager → Wi‑Fi Utils: routes · Queries and manipulates wireless state.
- App Manager → Communication: routes · Hands off the Metasploit-oriented flow.
- App Manager → Security: applies · Runs security-related device checks and actions.
- Connection → Root Check: checks · Verifies access level and root heuristics during connection.
- Device → Tools: uses · Shares command execution helpers.
- Input Control → Tools: uses · Relies on ADB utility helpers for device actions.
- File Manager → ADB: invokes · Uses ADB for push, pull, and shell file operations.
- Data Extraction → ADB: invokes · Uses ADB to collect data from the device.
- Media → ADB: invokes · Uses ADB for screenshots and recording setup.
- Media → scrcpy: invokes · Uses scrcpy for mirroring and control.
- Wi‑Fi Utils → ADB: invokes · Uses ADB for network-state queries and toggles.
- Port Forward → ADB: invokes · Configures ADB port forwarding.
- Communication → Extras: delegates · Passes the payload/session workflow to supporting routines.
- Extras → Metasploit: invokes · Uses Metasploit tooling for payload generation and session handling.
- Wi‑Fi Utils → nmap: may use · Can complement device/network discovery with scanning.
- CLI → Console: uses · Shares prompt and terminal interaction utilities.
- CLI → Color: uses · Formats terminal output.
- CLI → Config: reads · Loads runtime settings and feature options.
- App Manager → Config: reads · Consults shared configuration for behavior and defaults.
