How karma9874/androrat works
Purpose and scope
AndroRAT is a client/server Android remote-access tool: a Python operator program communicates with an Android client that runs background services and exposes device-data collection and device-control capabilities. The repository includes Android source, prebuilt/reverse-engineered APK contents, and packaging utilities.
Entry points and deliverables
The operator-side entry point is androRAT.py; supporting Python utilities and dependencies are utils.py and requirements.txt. The Android application entry/activity and manifest are Android_Code/app/src/main/java/com/example/reverseshell2/MainActivity.java and Android_Code/app/src/main/AndroidManifest.xml. Build outputs are checked in under Android_Code/app/release/.
Android lifecycle and persistence
The Android client is structured around activity, service, receiver, and scheduler components. MainActivity.java provides initial application startup; mainService.java is the likely long-running execution host; broadcastReciever.java provides system-event ingress, and jobScheduler.java supports deferred/background reactivation. These components form the boundary between Android lifecycle callbacks and persistent remote-control behavior.
• Android_Code/app/src/main/java/com/example/reverseshell2/MainActivity.java
• Android_Code/app/src/main/java/com/example/reverseshell2/mainService.java
• Android_Code/app/src/main/java/com/example/reverseshell2/broadcastReciever.java
Command-and-control transport
tcpConnection.java is the client network boundary, connecting the Android process to the Python-side listener/interpreter. config.java holds endpoint-oriented configuration, while functions.java appears to centralize command handling/dispatch. Control flow is: remote input arrives over TCP, is interpreted by the Android command layer, then routed to device-facing payloads; returned data or files traverse the same connection in the opposite direction.
• Android_Code/app/src/main/java/com/example/reverseshell2/tcpConnection.java
• Android_Code/app/src/main/java/com/example/reverseshell2/config.java
• Android_Code/app/src/main/java/com/example/reverseshell2/functions.java
Device capability payloads
Capabilities are separated into payload classes that interface with Android system services, hardware, and content providers. The payload boundary includes camera/video capture, audio capture, location, call logs, SMS, network identity, vibration, and shell execution. These modules consume privileged runtime permissions and produce data for the transport layer.
• Android_Code/app/src/main/java/com/example/reverseshell2/Payloads/CameraPreview.java
• Android_Code/app/src/main/java/com/example/reverseshell2/Payloads/videoRecorder.java
• Android_Code/app/src/main/java/com/example/reverseshell2/Payloads/locationManager.java
Local/operator interaction surfaces
A dial-code/keypad-triggered path appears to expose an on-device control panel, distinct from remote TCP control. keypadListner.java detects the trigger, jumper.java likely transitions into UI, and controlPanel.java backs the panel layout. This is a local UI boundary rather than the primary operator interface.
• Android_Code/app/src/main/java/com/example/reverseshell2/keypadListner.java
• Android_Code/app/src/main/java/com/example/reverseshell2/controlPanel.java
• Android_Code/app/src/main/res/layout/activity_control_panel.xml
Runtime, infrastructure, and artifacts
The client targets the Android Java runtime and is built with Gradle (Android_Code/app/build.gradle). The server/runtime is Python 3. External infrastructure includes a TCP listener and optional ngrok tunneling, per the documented modes. Compiled_apk/ is an apktool-style decompilation/repackaging tree containing manifest, resources, smali, signing metadata, and bundled libraries; Jar_utils/apktool.jar and Jar_utils/sign.jar support that artifact pipeline.
Main entry points: tcpConnection.java TCP connection · mainService.java Service, receiver & scheduler · AndroidManifest.xml App manifest · androRAT.py Python operator
Components 21
Operator Runtime
- Python operator · Starts the operator-side listener and command interface.
androRAT.py - Python utilities
utils.py - Python dependencies
requirements.txt - TCP listener / tunnel · Listener may be exposed through optional ngrok tunneling.
Android Client
- App manifest · Declares client components and permissions.
Android_Code/app/src/main/AndroidManifest.xml - Main activity · Initial client startup surface.
Android_Code/app/src/main/java/com/example/reverseshell2/MainActivity.java - Service, receiver & scheduler · Keeps background behavior active and handles system-event reentry.
Android_Code/app/src/main/java/com/example/reverseshell2/mainService.java - Broadcast receiver
Android_Code/app/src/main/java/com/example/reverseshell2/broadcastReciever.java - TCP connection · Bidirectional command and result channel.
Android_Code/app/src/main/java/com/example/reverseshell2/tcpConnection.java - Endpoint config
Android_Code/app/src/main/java/com/example/reverseshell2/config.java - Command dispatch · Interprets remote commands and routes device actions.
Android_Code/app/src/main/java/com/example/reverseshell2/functions.java - On-device control panel · Dial-code-triggered local control surface.
Android_Code/app/src/main/java/com/example/reverseshell2/controlPanel.java - Control panel layout
Android_Code/app/src/main/res/layout/activity_control_panel.xml
Device Payloads
- Device payloads · Camera, video, location, audio, messaging, identity, vibration, and shell capabilities.
- Camera capture
Android_Code/app/src/main/java/com/example/reverseshell2/Payloads/CameraPreview.java - Video recorder
Android_Code/app/src/main/java/com/example/reverseshell2/Payloads/videoRecorder.java - Location collection
Android_Code/app/src/main/java/com/example/reverseshell2/Payloads/locationManager.java
APK Packaging
- Gradle build
Android_Code/app/build.gradle - Release APK outputs · Checked-in Android release artifacts.
- APK repackage tree · apktool-style manifest, resources, smali, signing metadata, and libraries.
- APK tooling
Jar_utils/apktool.jar
Connections 20
- Python operator → Python utilities: uses
- Python dependencies → Python operator: supports
- Python operator → TCP listener / tunnel: hosts
- TCP listener / tunnel → TCP connection: TCP session
- App manifest → Main activity: declares
- App manifest → Service, receiver & scheduler: declares
- App manifest → Broadcast receiver: declares
- Main activity → Service, receiver & scheduler: starts
- Broadcast receiver → Service, receiver & scheduler: reactivates
- Endpoint config → TCP connection: configures
- Service, receiver & scheduler → TCP connection: runs
- TCP connection → Command dispatch: incoming commands
- Command dispatch → Device payloads: routes actions
- Device payloads → TCP connection: results and files
- Device payloads → Camera capture: includes
- Device payloads → Video recorder: includes
- Device payloads → Location collection: includes
- On-device control panel → Control panel layout: renders
- Gradle build → Release APK outputs: produces
- APK tooling → APK repackage tree: decompiles / repackages