How darkrain2009/redext works
Project Overview and Main Components
• The project is a full-stack security tool combining a Chromium Manifest V3 extension (in the ext directory) with a Flask-based C2 server (in the server directory).
• Key components include:
a. Browser Extension:
• Background script (ext/background.js) running as a service worker.
• Content scripts (ext/content_script.js) interacting with the webpage DOM.
• Popup UI (ext/popup.html and ext/popup.js) for user interactions.
• Manifest configuration (ext/manifest.json) that defines permissions and behaviors.
b. Server Component:
• Flask server (server/c2_server.py) handling API requests, task management, and data storage.
• Database setup (server/db_setup.py and usage of SQLite3 as per the README).
• A set of HTML templates (server/templates) that power the dark-themed dashboard UI for managing tasks, viewing collected browser data (cookies, history, screenshots, clipboard, DOM, local storage, system reconnaissance, etc.).
• A requirements file (server/requirements.txt) that details dependencies (Flask, etc.).
Relationships and Interactions
• Browser Extension to Server Communication:
• The extension collects browser data (cookies, history, screenshots, etc.) and likely communicates with the server via RESTful JSON endpoints.
• Data flows from the extension (client-side) through network calls to the Flask server.
• Server’s Role:
• The Flask C2 server manages tasks (creation, deployment, monitoring) and processes incoming data, serving it via the dashboard.
• The SQLite database holds collected data which is rendered through multiple HTML templates.
• Client-Server Architecture:
• The extension operates as the distributed data collector.
• The dashboard provides operational control and visualization of the collected data.
Architectural Patterns and Design Principles
• Separation of concerns via the split between client (browser extension) and server (Flask application).
• Use of RESTful endpoints to facilitate communication between the extension and the C2 server.
• MVC-like pattern within the server: Templates (View), Python backend logic (Controller), and database operations (Model).
• Security-focused design ensuring that operations are for authorized red team use.
Key Technologies and Frameworks
• Python (3.8+) and Flask 2.2.5 for the backend.
• SQLite3 as the database engine.
• Chrome Extension development based on Manifest V3.
• HTML/CSS (and likely JavaScript) for both extension UI and the server’s dashboard.
• Optionally, RESTful API design principles to structure the interaction between the extension and server.
Final Advice
• Major data paths, particularly data collection from the browser to the server and the dashboard’s role in task monitoring/management, are clearly represented.