METATRON README

The project's README from github.com/sooryathejas/METATRON. As one markdown file: README.md.

METATRON

AI-powered penetration testing assistant using local LLM on linux (Parrot OS)

🔱 METATRON

AI-Powered Penetration Testing Assistant

Metatron Banner


📌 What is Metatron?

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.


✨ Features

Metatron allows you to export scan results into clean, shareable report formats by selecting '2.view history'->select slno and export

📄 PDF — professional vulnerability reports 🌐 HTML — browser-viewable reports

🖥️ Screenshots

Main Menu
Main Menu

Scan Running
Recon tools running on target

AI Analysis
metatron-qwen analyzing scan results

Results
Vulnerabilities saved to database

Export Menu
Export scan results as PDF and or HTML

---

🧱 Tech Stack

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)

⚙️ Installation

1. Clone the repository

git clone https://github.com/sooryathejas/METATRON.git
cd METATRON

2. Create and activate virtual environment

python3 -m venv venv
source venv/bin/activate

3. Install Python dependencies

pip install -r requirements.txt

4. Install system tools

sudo apt install nmap whois whatweb curl dnsutils nikto

🤖 AI Model Setup

Step 1 — Install Ollama

curl -fsSL https://ollama.com/install.sh | sh

Step 2 — Download the base model

ollama 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:4b

Then edit Modelfile and change the FROM line to the 4b model.

Step 3 — Build the custom metatron-qwen model

The repo includes a Modelfile that fine-tunes the base model with pentest-specific parameters:

ollama create metatron-qwen -f Modelfile

This creates your local metatron-qwen model with:

Step 4 — Verify the model exists

ollama list

You should see metatron-qwen in the list.


🗄️ Database Setup

Step 1 — Make sure MariaDB is running

sudo systemctl start mariadb
sudo systemctl enable mariadb

Step 2 — Create the database and user

mysql -u root
CREATE DATABASE metatron;
CREATE USER 'metatron'@'localhost' IDENTIFIED BY '123';
GRANT ALL PRIVILEGES ON metatron.* TO 'metatron'@'localhost';
FLUSH PRIVILEGES;
EXIT;

Step 3 — Create the tables

mysql -u metatron -p123 metatron
CREATE 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)
);

🚀 Usage

Metatron needs two terminal tabs to run.

Terminal 1 — Load the AI model

ollama run metatron-qwen

Wait until you see the >>> prompt. This means the model is loaded into memory and ready. You can leave this terminal running in the background.

Terminal 2 — Launch Metatron

cd ~/METATRON
source venv/bin/activate
python metatron.py

Walkthrough

1. 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.


📁 Project Structure

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

🗃️ Database Schema

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

⚠️ Disclaimer

This tool is intended for educational purposes and authorized penetration testing only.


👤 Author

Soorya Thejas


📄 License

This project is licensed under the MIT License — see the LICENSE file for details.

METATRON (sooryathejas/METATRON)

Searching Database…

这是什么?Metatron 是一个基于 CLI 的 AI 渗透测试助手,它对目标运行真实的侦察工具,并让本地部署的 LLM 分析结果、提出可能的漏洞利用建议并推荐修复方案,全程不涉及云端或 API 密钥。
这是 CLI 工具,还是有图形界面?它是一个基于终端、由菜单驱动的 CLI 应用,要在两个终端标签页中运行;其输出是生成的 PDF/HTML 报告,而不是任何图形界面。
我怎样才能让它跑起来?克隆仓库,创建 Python 虚拟环境并安装 Python 和系统工具依赖,然后在启动它之前配置好 Ollama 和 MariaDB——一个终端负责加载 AI 模型并保持其运行,第二个终端启动 Metatron 本身。
在我能扫描任何目标之前,需要先安装什么?你需要 Ollama 来运行本地 metatron-qwen 模型,需要一个运行中的 MariaDB 服务器来保存扫描历史,还需要在 Parrot OS/基于 Debian 的系统上装好侦察工具 nmap、whois、whatweb、curl、dig 和 nikto。
运行 AI 模型需要性能强大的机器吗?需要——默认的 metatron-qwen 基础模型至少需要 8.4 GB 内存;如果你的机器内存不够,就必须把 Modelfile 切换到更小的 4b 变体。
它只能在 Parrot OS 上用,还是任何 Linux 都行?它是围绕 Parrot OS(一个基于 Debian 的发行版)构建的;README 并未确认对其他 Linux 发行版的支持,因此 Debian/Parrot 风格的环境是最稳妥的选择。
我的扫描数据会离开我的电脑吗?不会——分析在本地 Ollama 模型上运行,所有数据都存储在你自己的 MariaDB 数据库里;唯一的对外流量是 DuckDuckGo 搜索和 CVE 查询,这些都不需要 API 密钥。
AI 实际上会拿侦察输出做什么?它会综合分析 nmap、whois、whatweb、nikto 和 dig 的结果,识别漏洞,提出可能的利用方式,并推荐修复方案——还能通过其智能体循环在分析过程中请求运行更多工具。
我可以导出扫描结果吗?可以,从“查看历史”菜单中,你可以把任何已保存的扫描导出为专业的 PDF 报告或可在浏览器中查看的 HTML 报告。
用它扫描任何目标都合法吗?不合法——README 声明它仅用于教育目的和经授权的测试;扫描你不拥有或没有书面许可的系统属于违法行为。
驱动分析的是什么 AI 模型?一个名为 metatron-qwen 的定制微调模型,它通过 Ollama 基于 huihuiai/qwen3.5-abliterated:9b 基础模型构建,使用 16,384 token 的上下文窗口。
Size
2.1 MB
Stars
4.2K
Updated
CommitApr 11
Age
6mo
Commits · 90 Days