Dynamic analysis framework for Android apps.
Project description
Octopus
Octopus is a dynamic analysis framework for Android applications, part of the PiRogue Tool Suite. It instruments Android app behavior using Frida and provides the following capabilities:
- Screen recording
- Full network capture (on device)
- TLS interception with friTap
- Socket operations tracing
- Cryptographic operations logging
Octopus communicates with a running adb-server, either locally or remotely.
The target device can be a physical Android phone or an emulator, accessible
via USB or TCP.
Requirements
- Python 3.11 or newer
- A rooted Android device (emulator, phone, or tablet)
Installation
pip install pirogue-octopus
Usage
The main entry point is the octopus CLI.
# List available Android devices (local only)
octopus device list
# Start instrumentation over USB
octopus instrument usb
# Start instrumentation over network
octopus instrument tcp --device-host <DEVICE_IP>
Octopus instruments processes when they spawn. To instrument an application, start octopus then launch the application
to be analyzed when Octopus is Waiting for data. Press CTRL + C to stop.
Common options for instrument:
-o, --output-path: directory to save capture results (default:./output).-d, --device-id: serial number of the device connected to ADB (USB mode only).-ns, --no-screen-record: disable screen recording.-ni, --no-instrumentation: disable Frida instrumentation.-nn, --no-network-capture: disable network capture.--duration: capture duration in seconds to wait before it's automatically stopped (default: unlimited).-w, --overwrite: to overwrite the output files
Outputs
ad_ids.txt: the list of Android Advertising IDsdevice.json: the list of device properties (e.g. IMEI, brand, fingerprint)dynamic_hook.json: the output of dynamically injected hooksexperiment.json: the summary and timings of the capture and instrumentationscreen.mp4: the screen recordingsocket_trace.json: the trace of every operation on socketssslkeylog.txt: the list of TLS client randomstraffic.pcap: the network capture
Remote ADB server
The following options let you specify the ADB server to use:
-ah, --adb-host: ADB server IP address (default:127.0.0.1)-ap, --adb-port: ADB server port (default:5037)
octopus device list --adb-host 127.0.0.1 --adb-port 5037
Remote Android device
The following options let you specify the device to use:
-dh, --device-host: device IP address-dp, --device-port: device port (default:5555)
ADB over network must be enabled.
octopus instrument tcp --device-host <DEVICE_IP>
Development
It is recommended to use uv for managing the Python environment.
-
Clone the repository:
git clone https://github.com/PiRogueToolSuite/octopus.git cd octopus
-
Install Python dependencies:
uv sync -
Install Node.js dependencies and build Frida agents:
npm install npm run build
Scripts
The project uses tox for automation:
tox -e fix: Format code using Ruff and run pre-commit hooks.tox -e docs: Generate HTML documentation.
Frida agent development:
npm run build: Compile TypeScript agent to JavaScript.npm run watch: Continuously compile agent on changes.
Project Structure
octopus/: Core Python package.capture/: Modules for device, network, screen, and Frida management.commands/: CLI command definitions.frida/: Frida instrumentation logic.
frida-scripts-src/: TypeScript source for Frida agents.debian/: Debian packaging configuration.
License
This project is licensed under the GPL-3.0-or-later. See the LICENSES directory for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pirogue_octopus-1.0.0.tar.gz.
File metadata
- Download URL: pirogue_octopus-1.0.0.tar.gz
- Upload date:
- Size: 5.3 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.7.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
da8c40b1d9de67448721b8293013fe494d7df9a63ec1ff21b99b14671810b5ca
|
|
| MD5 |
1d6d8f78c9e82b38d9ec5a50f05e8451
|
|
| BLAKE2b-256 |
249f2941a4242c4383c4bbd5fdf4e8f9418a29427030354195326473fe35ec26
|
File details
Details for the file pirogue_octopus-1.0.0-py3-none-any.whl.
File metadata
- Download URL: pirogue_octopus-1.0.0-py3-none-any.whl
- Upload date:
- Size: 5.3 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.7.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f567e255876d9dacd5d7b358d36182bda944bf4f8b49c7b7e5d0d383d2d165ad
|
|
| MD5 |
3822cb1de03fb3bd8a1b4afe1bdf24db
|
|
| BLAKE2b-256 |
66ca43ed1adeadf8bba6a79007f5f89ab225d9e49c5e792c765960878ee61d0f
|