Content
# HTB Solver
A simplified tool for solving HackTheBox challenges with step-by-step guidance.
## Overview
HTB Solver helps you solve HackTheBox machines by providing:
1. Step-by-step guidance with exactly one command at a time
2. Analysis of command outputs
3. Session management to track your progress
4. Web search integration to find relevant information
5. Flag tracking for user and root flags
6. Local document retrieval for machine walkthroughs
## Features
- **Interactive Step-by-Step Approach**: Get exactly one command at a time, then provide the output to get the next step
- **Session Management**: Save your progress and continue later
- **Machine Information**: Automatically search for information about the target machine
- **Command Execution**: Safely execute commands and analyze the output
- **Flag Tracking**: Track your progress with user and root flags
- **Local RAG**: Access machine walkthroughs and information from local documents
- **MCP Integration**: Use the Pentest MCP server for command execution
## Installation
1. Clone the repository:
```bash
git clone https://github.com/ibrahimsaleem/local-pentest-rag-mcp.git
cd local-pentest-rag-mcp
```
2. Create a virtual environment:
```bash
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
```
3. Install dependencies:
```bash
pip install -r requirements.txt
```
## Usage
1. Run the main script:
```bash
python main3.py [options]
```
2. Follow the prompts to create a new session or continue an existing one
3. Enter the machine name and IP address when prompted
4. Follow the step-by-step guidance to solve the machine
### Command-line Options
- `--mcp`: Use MCP server for command execution
- `--no-local-rag`: Disable local RAG functionality
- `--data-dir PATH`: Specify directory containing RAG documents (default: data)
## Commands
- `/help` - Show help information
- `/flag user <value>` - Add user flag
- `/flag root <value>` - Add root flag
- `/status` - Show machine and flag status
- `/steps` - Show all steps taken so far
- `/cache clear` - Clear search cache
- `/walkthrough` - Show complete walkthrough for the current machine (if available)
- `/quit` - Exit the program
## Local RAG Documents
Place your machine walkthroughs and information in the `data` directory with the following structure:
```
data/
├── MachineName1/
│ ├── Readme.md # Main walkthrough document
│ └── Images/ # Optional images directory
├── MachineName2/
│ └── Readme.md
└── ...
```
## Project Structure
```
htb-solver/
├── main3.py # Main script
├── modules/ # Modules directory
│ ├── __init__.py # Package initialization
│ ├── commands.py # Command extraction and execution
│ ├── document_rag.py # Document retrieval functionality
│ ├── local_rag.py # Local RAG integration
│ ├── mcp_integration.py# MCP server integration
│ ├── rag.py # Retrieval-augmented generation
│ ├── search.py # Web search functionality
│ └── session.py # Session management
├── sessions/ # Session files directory
├── cache/ # Search cache directory
├── data/ # Local RAG documents directory
└── README.md # This file
```
## Dependencies
- Python 3.7+
- langchain (optional, for better LLM integration)
- ollama (optional, for local LLM)
- requests
## License
MIT License
Connection Info
You Might Also Like
everything-claude-code
Complete Claude Code configuration collection - agents, skills, hooks,...
markitdown
Python tool for converting files and office documents to Markdown.
awesome-claude-skills
A curated list of awesome Claude Skills, resources, and tools for...
antigravity-awesome-skills
The Ultimate Collection of 130+ Agentic Skills for Claude...
claude-context-mode
claude-context-mode plugin reduces MCP context bloat, saving up to 99% of tokens.
context-mode
MCP is the protocol for tool access. We're the virtualization layer for context.