Forgent is an interactive agent-based network packet analysis and forging tool. It leverages large language models, Scapy, and Gradio to provide a conversational interface for capturing, crafting, sending, and analyzing network packets. Forgent is ideal for network engineers, security researchers, and educators who want to automate or experiment with network tasks using natural language.
-
Clone this repository:
git clone https://github.com/yourusername/forgent.git cd forgent
-
(Recommended) Create and activate a Python virtual environment:
python -m venv .venv # On Windows: .venv\Scripts\activate # On macOS/Linux: source .venv/bin/activate
-
Install the required dependencies:
pip install -r requirements.txt
Or, using uv (recommended for speed):
uv pip install -r requirements.txt
-
Basing on your LLM provider
- Fill the
settings.yaml
file the model id and api base URL. Checkout https://docs.litellm.ai/docs/ for more details. - Set the API_KEY in environment variables or in the
.env
file.
- Fill the
- Ensure you have the necessary permissions to capture and send raw packets on your network interface. Otherwise forgent will exit with an error.
- Run the main application:
python main.py
- Select the network interface index when prompted based on Index column.
- A default browser tab will be opened with the Forgent web UI.
- Start interacting with the agent by the example prompts provided in the UI or by entering your own commands.
Contributions are welcome! Please open issues or pull requests for bug fixes, features, or improvements.
This project is licensed under the MIT License. See LICENSE for details.