
Source code minh họa máy chủ c2 demo kịch bản thực thi của CVE-2024-23700
This project illustrates the design and construction of a Command & Control (C2) server used for the experimental exploitation scenario of the privilege escalation vulnerability CVE-2024-23700. This server is responsible for receiving, processing, classifying, and displaying sensitive data stolen from target Android devices.
The documentation and source code in this repository are intended solely for educational purposes, security analysis, and testing within authorized environments. Do not use them on devices, accounts, or data that fall outside the scope of lawful testing.
Course: Mobile Device Security
Team: Project carried out by a team of 4 members.
During the research and development of this C2 Server design project, the team undertook the following tasks:
data.json) to optimize for a fast and lightweight PoC.The C2 Server system follows a Client-Server model, where the malicious Android application (PoC) acts as the Client, continuously sending data back. The C2 architecture is divided into two independently processing components to ensure high speed and flexibility.
Main operational flow of the C2 Server:
/ is designed with a dual-handling mechanism. If accessed via the GET method (browser scanning), the server returns a fake 404 error to evade detection. If it receives a POST method containing JSON format from the malware, the server accepts it and extracts the device identifier.s_cache, gps_cache).data.json./api/data to read the database.device_id), deep-scans the structure to extract hardware parameters (RAM, Battery, OS), and visually displays them on the radar.Vulnerability ID: CVE-2024-23700
Android Severity: Critical
Affected Component: Android Companion Device Manager
Reference Patch: Android Wear Security Bulletin 2024-05-01
This C2 server is designed as part of an experimental network, receiving intelligence data streams from Android devices successfully exploited through the aforementioned vulnerability.
CVE-2024-23700-C2-Server/
├── backend/
│ ├── app.py - Initializes API Endpoints, handles disguise and JSON classification
│ └── requirements.txt
├── frontend/
│ ├── src/
│ │ ├── pages/
│ │ │ ├── Dashboard.jsx - Device overview radar screen
│ │ │ └── DeviceDetails.jsx - In-depth payload analysis dialog
│ │ ├── App.jsx
│ │ └── App.css
│ ├── package.json
│ └── nginx.conf - Custom Reverse Proxy for frontend
├── data.json - Flat-file database storing records (volume-mounted)
├── docker-compose.yml - Manages containers and internal network
├── .gitignore
└── README.md
Instead of using cumbersome logic, the server automatically identifies and labels data based on the returned cache blocks, while the Frontend interface integrates a smart dictionary (MODULE_MAP and COLUMN_TRANSLATIONS) to standardize and "localize" the results:
s_cache).c_cache).cal_cache).n_cache).gps_cache).Additionally, the system automatically converts raw timestamps into readable local time standards and interprets numeric codes into actual states (e.g., Call type 1 = "↙️ Incoming call").
The entire C2 infrastructure is operated using docker compose to ensure consistency and eliminate environmental discrepancies. The structure runs 2 main services:
data.json file to the /app/data.json location inside the container. This ensures intelligence data is permanently stored even if the container is deleted or restarted. The service applies the restart: always policy./api/ prefix are automatically forwarded (proxy_pass) to the Backend to enhance security. This container is required to start after the Backend (depends_on) to avoid initial connection loss errors.data.json file has appropriate read/write permissions set on the physical server before starting Docker.| Component | Description | Path |
|---|
Flask Backend (app.py) | C2 control center, listens, classifies, and stores data into data.json. | backend/app.py |
| Radar Dashboard | Central control panel, groups targets and displays HW/OS parameters and payload counts. | frontend/src/pages/Dashboard.jsx |
| Device Details Modal | Victim data dissection interface (XL Modal), providing an Accordion system and dynamic data tables. | frontend/src/pages/DeviceDetails.jsx |
| Docker Configuration File | Orchestrates deployment of Backend (port 5000) and Nginx Frontend (port 80) via Reverse Proxy. | docker-compose.yml |