An open API service indexing awesome lists of open source software.

https://github.com/therealfredp3d/making-banditgui

Play Overthewire Bandit wargame using a browser, allowing users to connect to the Bandit server, execute commands in a real SSH terminal, access level-specific information and hints, and track their progress. (Playable Demo)
https://github.com/therealfredp3d/making-banditgui

bandit-war-games ctf cybersecurity education flask learning-by-doing linux overthewire-bandit project python terminal webdev xterm

Last synced: 11 months ago
JSON representation

Play Overthewire Bandit wargame using a browser, allowing users to connect to the Bandit server, execute commands in a real SSH terminal, access level-specific information and hints, and track their progress. (Playable Demo)

Awesome Lists containing this project

README

          

# v0.4 - BanditGUI: Making Cybersecurity Learning Accessible

![Screenshot](docs/assets/v0.4-Main-screen.jpg)

BanditGUI is a web-based interface for the popular OverTheWire Bandit wargame. It aims to make learning cybersecurity fundamentals more approachable by providing a browser-based terminal, structured level information, and an AI-powered assistant.

## Why BanditGUI?

The command-line nature of challenges like Bandit can be a hurdle for beginners. BanditGUI lowers this barrier by:

* Providing an integrated terminal in your browser.
* Offering easy access to level goals, commands, and learning resources.
* Assisting with hints and explanations through an AI chat interface.

## Core Features

* **Interactive Web Terminal:** A full-featured xterm.js terminal in your browser to connect to Bandit via SSH.

![Interactive Web Terminal](docs/assets/v0.4-Bandit0-Done-Terminal.jpg)

* **Real SSH Connections:** Practice with actual Linux commands in a realistic environment.

* **Level Guidance:** Access information, relevant commands, and reading materials for each Bandit level.

![Level Guidance](docs/assets/v0.4-Bandit0.jpg)

* **AI-Powered Chat Assistant:** Get intelligent hints and explanations from an LLM-powered chat (supports various models via LiteLLM).

![Ask-a-Pro](docs/assets/v0.4-Mentor.jpg)

* **Simplified Setup:** Easy installation using a Python script.
* **Modular Design:** Built with a maintainable Python Flask backend and JavaScript frontend.

## Tech Stack

* **Backend:** Python (Flask)
* **Frontend:** HTML, CSS, JavaScript (xterm.js)
* **SSH:** Paramiko
* **LLM Integration:** LiteLLM

![Easy LLM Selection](docs/assets/v0.4-Ask-a-Pro-LLM.jpg)

## Getting Started

### Installation

1. **Clone the repository:**

```bash
git clone https://github.com/therealfredp3D/Making-BanditGUI.git
cd Making-BanditGUI
```

2. **Run the installation script:**
This script will set up a virtual environment, install dependencies, and create run scripts.

```bash
python install.py
# or python3 install.py on some systems
```

3. **Follow on-screen instructions.** The script will guide you through any necessary checks.

### Running BanditGUI

* **Windows:** Execute `run.bat` (Generated by `install.py`)
* **Linux/macOS:** Execute `./run.sh` (Generated by `install.py`)

Once started, the application is typically available at `http://127.0.0.1:5000`.

## How to Contribute

We welcome contributions! Please follow these general steps:

1. Fork the repository.
2. Create a new branch for your feature or bug fix.
3. Make your changes.
4. Test your changes thoroughly.
5. Commit your changes with a clear message.
6. Open a Pull Request to the `main` branch.

## Roadmap Highlights

We are continuously working to improve BanditGUI. Some of our future goals include:

1. **Password Management**: Adding secure password storage with encryption
2. **Progress Tracking**: Implementing a system to track user progress through the challenges
3. **Gamification**: Adding badges, streaks, and other gamification elements to increase engagement

## License

This project is licensed under the MIT License.

### 5. LLM-Powered Chat Interface

The application includes an advanced chat interface powered by Large Language Models (LLMs). It leverages `litellm` to support various API providers and LLMs, making it easy to switch between different models.

**Dynamic Ollama Model Loading:**

* When selecting an Ollama model, the app automatically fetches the list of available models from your local Ollama server (`http://localhost:11434/api/tags`).
* This ensures the dropdown always reflects the actual models you have installed in Ollama, without needing to update the static config file.

For more detailed installation instructions, see [installation guide](docs/notion/notion_installation_guide.md).

## New in v0.4

## Frontend Asset Bundling (v0.4.2+)

* The frontend now uses Webpack to bundle and minify JavaScript and CSS assets for improved performance.
* All main JS and CSS are bundled into `banditgui/static/dist/main.js` and `banditgui/static/dist/styles.css`.
* The main HTML template (`banditgui/templates/index.html`) now references these bundled files.

### How to Build Frontend Assets

1. Install dependencies (if not already):

```bash
npm install
```

2. Build the assets:

```bash
npm run build
```

3. The output will be in `banditgui/static/dist/`.

> **Note:** If you add or change JS/CSS, re-run `npm run build` to update the bundles.