AI-powered penetration testing assistant using local LLM on linux (Parrot OS)
Metatron is a CLI-based AI penetration testing assistant that runs entirely on your local machine β no cloud, no API keys, no subscriptions.
You give it a target IP or domain. It runs real recon tools (nmap, whois, whatweb, curl, dig, nikto), feeds all results to a locally running AI model, and the AI analyzes the target, identifies vulnerabilities, suggests exploits, and recommends fixes. Everything gets saved to a MariaDB database with full scan history.
- π€ Local AI Analysis β powered by
metatron-qwenvia Ollama, runs 100% offline - π Automated Recon β nmap, whois, whatweb, curl headers, dig DNS, nikto
- π Web Search β DuckDuckGo search + CVE lookup (no API key needed)
- ποΈ MariaDB Backend β full scan history with 5 linked tables
- βοΈ Edit / Delete β modify any saved result directly from the CLI
- π Agentic Loop β AI can request more tool runs mid-analysis
- π« No API Keys β everything is free and local -π€ Export Reports
Metatron allows you to export scan results into clean, shareable report formats by selecting '2.view history'->select slno and export
metatron-qwen analyzing scan results
Vulnerabilities saved to database
Export scan results as PDF and or HTML
| Component | Technology |
|---|---|
| Language | Python 3 |
| AI Model | metatron-qwen (fine-tuned Qwen 3.5) |
| Base Model | huihui_ai/qwen3.5-abliterated:9b |
| LLM Runner | Ollama |
| Database | MariaDB |
| OS | Parrot OS (Debian-based) |
| Search | DuckDuckGo (free, no key) |
git clone https://github.com/sooryathejas/METATRON.git
cd METATRONpython3 -m venv venv
source venv/bin/activatepip install -r requirements.txtsudo apt install nmap whois whatweb curl dnsutils niktocurl -fsSL https://ollama.com/install.sh | shollama pull huihui_ai/qwen3.5-abliterated:9b
β οΈ This model requires at least 8.4 GB of RAM. If your system has less, use the 4b variant:ollama pull huihui_ai/qwen3.5-abliterated:4bThen edit
Modelfileand change the FROM line to the 4b model.
The repo includes a Modelfile that fine-tunes the base model with pentest-specific parameters:
ollama create metatron-qwen -f ModelfileThis creates your local metatron-qwen model with:
- 16,384 token context window
- Temperature: 0.7
- Top-k: 10
- Top-p: 0.9
ollama listYou should see metatron-qwen in the list.
sudo systemctl start mariadb
sudo systemctl enable mariadbmysql -u rootCREATE DATABASE metatron;
CREATE USER 'metatron'@'localhost' IDENTIFIED BY '123';
GRANT ALL PRIVILEGES ON metatron.* TO 'metatron'@'localhost';
FLUSH PRIVILEGES;
EXIT;mysql -u metatron -p123 metatronCREATE TABLE history (
sl_no INT AUTO_INCREMENT PRIMARY KEY,
target VARCHAR(255) NOT NULL,
scan_date DATETIME NOT NULL,
status VARCHAR(50) DEFAULT 'active'
);
CREATE TABLE vulnerabilities (
id INT AUTO_INCREMENT PRIMARY KEY,
sl_no INT,
vuln_name TEXT,
severity VARCHAR(50),
port VARCHAR(20),
service VARCHAR(100),
description TEXT,
FOREIGN KEY (sl_no) REFERENCES history(sl_no)
);
CREATE TABLE fixes (
id INT AUTO_INCREMENT PRIMARY KEY,
sl_no INT,
vuln_id INT,
fix_text TEXT,
source VARCHAR(50),
FOREIGN KEY (sl_no) REFERENCES history(sl_no),
FOREIGN KEY (vuln_id) REFERENCES vulnerabilities(id)
);
CREATE TABLE exploits_attempted (
id INT AUTO_INCREMENT PRIMARY KEY,
sl_no INT,
exploit_name TEXT,
tool_used TEXT,
payload LONGTEXT,
result TEXT,
notes TEXT,
FOREIGN KEY (sl_no) REFERENCES history(sl_no)
);
CREATE TABLE summary (
id INT AUTO_INCREMENT PRIMARY KEY,
sl_no INT,
raw_scan LONGTEXT,
ai_analysis LONGTEXT,
risk_level VARCHAR(50),
generated_at DATETIME,
FOREIGN KEY (sl_no) REFERENCES history(sl_no)
);Metatron needs two terminal tabs to run.
ollama run metatron-qwenWait until you see the >>> prompt. This means the model is loaded into memory and ready. You can leave this terminal running in the background.
cd ~/METATRON
source venv/bin/activate
python metatron.py1. Main menu appears:
[1] New Scan
[2] View History
[3] Exit
2. Select [1] New Scan β enter your target:
[?] Enter target IP or domain: 192.168.1.1
or
[?] Enter target IP or domain: example.com
3. Select recon tools to run:
[1] nmap
[2] whois
[3] whatweb
[4] curl headers
[5] dig DNS
[6] nikto
[a] Run all (except nikto)
[n] Run all + nikto (slow)
4. Metatron runs the tools, feeds results to the AI, and prints the analysis.
5. Everything is saved to MariaDB automatically.
6. After the scan you can edit or delete any result.
METATRON/
βββ metatron.py β main CLI entry point
βββ db.py β MariaDB connection and all CRUD operations
βββ tools.py β recon tool runners (nmap, whois, etc.)
βββ llm.py β Ollama interface and AI tool dispatch loop
βββ search.py β DuckDuckGo web search and CVE lookup
βββ Modelfile β custom model config for metatron-qwen
βββ requirements.txt β Python dependencies
βββ .gitignore β excludes venv, pycache, db files
βββ LICENSE β MIT License
βββ README.md β this file
βββ screenshots/ β terminal screenshots for documentation
All 5 tables are linked by sl_no (session number) from the history table:
history β one row per scan session (sl_no is the spine)
β
βββ vulnerabilities β vulns found, linked by sl_no
β β
β βββ fixes β fixes per vuln, linked by vuln_id + sl_no
β
βββ exploits_attempted β exploits tried, linked by sl_no
β
βββ summary β full AI analysis dump, linked by sl_no
This tool is intended for educational purposes and authorized penetration testing only.
- Only use Metatron on systems you own or have explicit written permission to test.
- Unauthorized scanning or exploitation of systems is illegal.
- The author is not responsible for any misuse of this tool.
Soorya Thejas
- GitHub: @sooryathejas
This project is licensed under the MIT License β see the LICENSE file for details.


