How azeemidrisi/phonesploit-pro works
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: app_manager.py App Manager · cli.py CLI · wifi_utils.py Wi‑Fi Utils · media.py Media
Components 24
Entry & UI
Launcher and interactive console layer.
ADB Control Core
Device discovery, connection, and operator command coordination.
- App Manager · Central coordinator that routes UI actions into feature modules.
modules/app_manager.py - Connection · ADB connection setup and target selection.
modules/connection.py - Device · General ADB-backed device operations and command execution.
modules/device.py - Root Check · Heuristics for access level and root availability.
modules/root_check.py - Security · Security-related device actions and checks.
modules/security.py
Device Workflows
File transfer, extraction, media, and network operations over the target device.
- Input Control · Key events, screen actions, and input automation.
modules/input_control.py - Wi‑Fi Utils · Wi‑Fi state, IP, and connectivity helpers.
modules/wifi_utils.py - Port Forward · ADB forwarding and tunnel setup.
modules/port_forward.py - File Manager · Upload, download, and file movement between host and device.
modules/file_manager.py - Data Extraction · Exports structured device data such as SMS, contacts, and call logs.
modules/data_extraction.py - Media · Screenshots, screen recording, mirroring, and audio capture.
modules/media.py
Metasploit Flow
Optional payload and session workflow built on external security tools.
- Communication · Coordinates payload delivery and session-facing communication steps.
modules/communication.py - Extras · Auxiliary exploit workflow and Metasploit orchestration.
modules/extras.py
Shared Support
Configuration, presentation, and helper modules used across the app.
- Banner · Startup branding and terminal header output.
modules/banner.py - Color · Terminal styling and colored output helpers.
modules/color.py - Console · Reusable console and command interaction utilities.
modules/console.py - Config · Runtime options and feature settings.
modules/config.py - Tools · Shared ADB command helpers and utility actions.
modules/tools.py
External Tools
Host-installed binaries invoked by the Python orchestrator.
- ADB · Primary device control binary used for shell, file, and network operations.
- scrcpy · External screen mirroring and control tool.
- nmap · Network scanning and discovery tool.
- Metasploit · msfvenom and msfconsole workflow for payload generation and sessions.
Connections 29
- 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.