Skip to content

Danette10/Chaos-must-Die-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

137 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Chaos-must-Die-API

API Documentation

Table of Contents

⚠️ DISCLAIMER ⚠️

This project is developed for educational purposes only. The aim is to understand and demonstrate the security risks associated with C2 and to encourage the development of effective countermeasures. The author(s) of this project do not endorse any malicious use of the materials provided.

By using or interacting with this software in any way, you agree to use it solely for educational, ethical hacking, and security research purposes. It is strictly forbidden to use the software for illegal activities, and the author(s) will not be responsible for any misuse of the software.

All users are encouraged to report any vulnerabilities or security issues found within this software to the author(s) for improvement. Remember, unauthorized access to computer systems is illegal and punishable by law. Always conduct your security research within legal boundaries and with proper authorization.

Use this software at your own risk.

Introduction

Installation

Environment Setup with Poetry

To set up the environment, you can use Poetry. If you don't have Poetry installed, you can install it using the following command:

curl -sSL https://install.python-poetry.org | python3 -

After installing Poetry, you can create a new virtual environment and install the dependencies by running the following commands:

poetry install

Reverse Proxy with Caddy (Local HTTPS + WebSocket)

We use Caddy locally to handle HTTPS and WebSocket proxying properly (for compatibility with browsers and frontend).

1. Install Caddy (Ubuntu/Debian WSL tested)

sudo apt update
sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https curl gnupg
curl -fsSL https://dl.cloudsmith.io/public/caddy/stable/gpg.key | gpg --dearmor | sudo tee /usr/share/keyrings/caddy-stable-archive-keyring.gpg > /dev/null
echo "deb [signed-by=/usr/share/keyrings/caddy-stable-archive-keyring.gpg] https://dl.cloudsmith.io/public/caddy/stable/deb/debian any-version main" | sudo tee /etc/apt/sources.list.d/caddy-stable.list > /dev/null

sudo apt update
sudo apt install caddy

2. Configure Caddy (IMPORTANT !!)

Edit /etc/caddy/Caddyfile with:

sudo rm /etc/caddy/Caddyfile
sudo nano /etc/caddy/Caddyfile
localhost {
    reverse_proxy 127.0.0.1:5000 {
        transport http {
            versions h1
        }
    }
}

3. Restart Caddy

sudo systemctl restart caddy

After that, the API will be accessible via https://localhost

Running Flask API

Flask runs without SSL (Caddy manages HTTPS as reverse proxy):

poetry run cmd

Flask-Migrate

Initialization of Flask-Migrate

To initialize Flask-Migrate, run the following command:

$env:FLASK_APP = "src.chaos_must_die_api.app"       # PowerShell (Windows)
export FLASK_APP=src.chaos_must_die_api.app         # Linux / macOS

poetry run flask db init
poetry run flask db migrate -m "Initial migration."
poetry run flask db upgrade

Migration

To migrate the database, run the following command:

poetry run flask db migrate -m "Migration message."
poetry run flask db upgrade

Seeding the Database

To seed the database, run the following command:

poetry run seed

The seed script is located in the src/chaos_must_die_api/seeds/ file. You can modify the seed script to add your own data to the database.

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages