## https://sploitus.com/exploit?id=7312085A-30C8-587D-A73B-B1CA3F2D4A49
# PoC2Rule Agent
Automatically convert PoC (Proof of Concept) files into detection rules (Snort/Suricata). ## Inputs
Three input formats are supported:
| Format | Example |
|------|------|
| Python PoC file | `python main.py -p poc.py` |
| Plaintext HTTP request | `python main.py -r request.txt` |
| PoC file URL | `python main.py -u https://example.com/poc.py` |
## Outputs
- **PCAP** β Attack traffic packets
- **Detection IR** β Intermediate detection rules (JSON)
- **Snort Rule** β Snort rules (support for Suricata later)
- **Test report** β Results of rule testing
## Quick Start
```bash
# 1. Configure
cp config.yaml.template config.yaml
# Edit config.yaml and fill in the LLM API key, etc.
# 2. Install dependencies
pip install -r requirements.txt
# 3. Run
python main.py -p examples/poc_sqli.py
python main.py -r examples/request.txt
python main.py -u https://example.com/poc.py
# 4. View outputs
ls workspace/output/
```
## Project Architecture
```
Inputs (POC/HTTP/URL)
β
βΌ
Workflow (Python control, LangGraph)
β
βββββββββββΌββββββββββ
βΌ βΌ βΌ
Planner Inference Plugin
β β β
βββββββββββΌββββββββββ
βΌ
Tool (Python execution)
```
- **Workflow** β Python controls the entire process; LLM does not intervene in the process.
- **Planner** β Local agents responsible for individual node strategies (e.g., PCAP generation).
- **Inference** β Single LLM inference; no cycling or scheduling of Tools.
- **Plugin** β Expands rule formats without changing the Workflow.
- **Tool** β Pure Python execution, no prompts required.
## Directory Structure
```
βββ main.py # Program entry point
βββ workflow.py # LangGraph workflow
βββ config.yaml.template # Configuration template
βββ requirements.txt
βββ app/ # Application base (State, Context, Logger)
βββ llm/ # LLM encapsulation (Client, Inference, Planner, PromptBuilder)
βββ workflow_nodes/ # 11 workflow nodes
βββ tools/ # 7 execution tools
βββ inference/ # Inference skills (SKILL + Knowledge + Examples)
βββ plugins/ # Rule format plugins
βββ schemas/ # Data models
βββ planners/ # Planner strategies
βββ workspace/ # Working directory
βββ logs/ # Logs
```
## Extensions
### Adding new rule formats
Create a new directory under `plugins/` and implement the `PluginBase` interface. **No changes to the Workflow are required.**
### Adding new models
Modify `config.yaml` to use OpenAI, DeepSeek, Qwen, or vLLM as the LLM provider.
### Adding new packet capture methods
Add new tools under `tools/`, and register them in the corresponding Planners.
## Dependencies
- Python >= 3.10
- LangGraph / LangChain
- Scapy
- Docker (optional, for sandboxing PoC)
- Snort (optional, for rule validation and testing)