-
Notifications
You must be signed in to change notification settings - Fork 3
Add routes for exploits, modules, and dashboards #54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Add routes for exploits, modules, and dashboards. * **Exploits Routes**: - Add routes for deploying exploits, SMS messages, and email messages in `exploits/exploits2.py`. * **Modules Routes**: - Add routes for controlling devices remotely, privilege escalation, and advanced commands in `modules/exploits2.py`. - Add routes for identifying vulnerabilities, developing exploits, and deploying exploits in `modules/zero_day_exploits.py`. * **Dashboards Routes**: - Add route for rendering the C2 dashboard in `c2_dashboard.py`. - Add routes for rendering the main dashboard, admin dashboard, compliance dashboard, and training dashboard in `dashboard/dashboard.py`. - Add route for rendering the GUI dashboard in `gui/dashboard.py`. * **Template Updates**: - Add links to the new routes for the main dashboard, admin dashboard, compliance dashboard, and training dashboard in `templates/dashboard.html`. * **Main Application Updates**: - Import and register the new routes in `main.py` and `app.py`. --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/ProjectZeroDays/Project-Red-Sword?shareId=XXXX-XXXX-XXXX-XXXX).
| return jsonify({"commands": ["get_user_info", "get_system_info", "get_network_info"]}) | ||
| return jsonify({"commands": ["get_user_info", "get_system_info", "get_network_info"]}) | ||
|
|
||
| if __name__ == '__main__': |
Check failure
Code scanning / CodeQL
Flask app is run in debug mode High
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 12 months ago
To fix the problem, we need to ensure that the Flask application does not run in debug mode in a production environment. The best way to achieve this is to use an environment variable to control the debug mode. This way, the application can run in debug mode during development but will have debugging disabled in production.
We will modify the app.run() call to check an environment variable (e.g., FLASK_DEBUG) to determine whether to enable debug mode. This change will be made in the if __name__ == '__main__': block.
-
Copy modified lines R61-R63
| @@ -60,2 +60,4 @@ | ||
| if __name__ == '__main__': | ||
| app.run(debug=True) | ||
| import os | ||
| debug_mode = os.getenv('FLASK_DEBUG', 'False').lower() in ['true', '1', 't'] | ||
| app.run(debug=debug_mode) |
| print("All services started!") | ||
|
|
||
| if __name__ == "__main__": | ||
| app.run(debug=True) |
Check failure
Code scanning / CodeQL
Flask app is run in debug mode High
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 12 months ago
To fix the problem, we need to ensure that the Flask application does not run in debug mode in a production environment. This can be achieved by using an environment variable to control the debug mode. We will modify the code to check the environment variable and set the debug mode accordingly. This way, the application can run in debug mode during development but will be secure in a production environment.
- Import the
osmodule to access environment variables. - Modify the
app.run()call to set thedebugparameter based on an environment variable.
-
Copy modified lines R43-R44
| @@ -42,3 +42,4 @@ | ||
| if __name__ == "__main__": | ||
| app.run(debug=True) | ||
| debug_mode = os.getenv('FLASK_DEBUG', 'False').lower() in ['true', '1', 't'] | ||
| app.run(debug=debug_mode) | ||
| start_all_services() |
| return jsonify({"commands": ["get_user_info", "get_system_info", "get_network_info"]}) | ||
| return jsonify({"commands": ["get_user_info", "get_system_info", "get_network_info"]}) | ||
|
|
||
| if __name__ == '__main__': |
Check failure
Code scanning / CodeQL
Flask app is run in debug mode High
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 12 months ago
To fix the problem, we need to ensure that the Flask application does not run in debug mode in a production environment. The best way to achieve this is to use an environment variable to control the debug mode. This way, we can easily switch between development and production configurations without changing the code.
- Modify the
app.run(debug=True)line to check an environment variable to determine whether to run in debug mode. - Import the
osmodule to access environment variables. - Set the default value of the debug mode to
Falseto ensure it is not enabled by default.
-
Copy modified lines R60-R62
| @@ -59,2 +59,4 @@ | ||
| if __name__ == '__main__': | ||
| app.run(debug=True) | ||
| import os | ||
| debug_mode = os.getenv('FLASK_DEBUG', 'False').lower() in ['true', '1', 't'] | ||
| app.run(debug=debug_mode) |
| return jsonify({"result": result}) | ||
|
|
||
| if __name__ == '__main__': | ||
| app.run(debug=True) |
Check failure
Code scanning / CodeQL
Flask app is run in debug mode High
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 12 months ago
To fix the problem, we need to ensure that the Flask application does not run in debug mode in a production environment. The best way to achieve this is by using environment variables to control the debug mode. This way, we can enable debug mode during development and disable it in production without changing the code.
- Import the
osmodule to access environment variables. - Modify the
app.run()call to set thedebugparameter based on an environment variable. - Set a default value for the environment variable to ensure the application does not run in debug mode by default.
-
Copy modified lines R61-R63
| @@ -60,2 +60,4 @@ | ||
| if __name__ == '__main__': | ||
| app.run(debug=True) | ||
| import os | ||
| debug_mode = os.getenv('FLASK_DEBUG', 'False').lower() in ['true', '1', 't'] | ||
| app.run(debug=debug_mode) |
Add routes for exploits, modules, and dashboards.
Exploits Routes:
exploits/exploits2.py.Modules Routes:
modules/exploits2.py.modules/zero_day_exploits.py.Dashboards Routes:
c2_dashboard.py.dashboard/dashboard.py.gui/dashboard.py.Template Updates:
templates/dashboard.html.Main Application Updates:
main.pyandapp.py.For more details, open the Copilot Workspace session.