Sploitus

Exploit for MCATester

githubexploit Β· 2026-06-24

Exploit Code

README368 lines
## https://sploitus.com/exploit?id=59505BC0-DE3A-56CF-96BF-33C4639271E6
# MCATester β€” AI-Powered OSINT & Vulnerability Discovery Platform

> Built during a security research internship at the National e-Governance Division (NeGD), MeitY, New Delhi.

[![Python](https://img.shields.io/badge/Python-3.12-blue)](https://python.org)
[![FastAPI](https://img.shields.io/badge/FastAPI-0.100%2B-green)](https://fastapi.tiangolo.com)
[![Groq](https://img.shields.io/badge/AI-Groq%20LLaMA%203.3%2070B-orange)](https://groq.com)
[![License](https://img.shields.io/badge/License-MIT-yellow)](LICENSE)

MCATester is a full-stack OSINT and vulnerability discovery platform that turns passive reconnaissance into **confirmed, zero-false-positive security findings** β€” with an AI decision layer that makes the scanner adaptive rather than just automated.

---

## The core problem it solves

Most scanners produce noise. Running gobuster + nikto + sqlmap on a real target produces hundreds of raw results requiring hours of manual filtering. MCATester produces clean findings β€” a SQLi finding means the database actually executed a sleep command, an XSS finding means the payload was reflected unescaped in the HTML response.

**On mca.gov.in (before vs after noise reduction):**

```
First version:  68 findings β€” 61 false positives (all 403 responses)
Current version: 11 findings β€” 0 false positives
```

The key insight: 403 responses are ambiguous. A WAF returning 403 on `/admin` doesn't mean admin exists. Content confirmation β€” checking what the 403 response body actually contains β€” eliminates this entire class of false positive.

---

## Real findings β€” Ministry of Corporate Affairs, India

Discovered during authorized research on `mca.gov.in`:

```
CRITICAL  CVE-2023-27997  CVSS 9.8
          vpnv3.mca.gov.in:4111 β€” Fortinet SSL VPN pre-auth heap overflow
          Unauthenticated remote code execution, no credentials required

CRITICAL  CVE-2022-40684  CVSS 9.8
          Fortinet authentication bypass β€” full admin access without credentials
          Affected: FortiOS 7.0.0-7.0.6, 7.2.0-7.2.1

CRITICAL  CVE-2018-13379  CVSS 9.1
          Fortinet path traversal β€” VPN session credentials readable
          via /remote/fgt_lang without authentication

HIGH      Unauthenticated File-Serving API
          pminternship.mca.gov.in/mca-api/files/get-file-by-path
          No auth required to request arbitrary file paths

HIGH      CVE-2023-24486  CVSS 8.8
          GroupWise WebAccess XSS + session hijack
          mail.mca.gov.in β€” active groupware installation
```

Responsibly disclosed to CERT-In (`incident@cert-in.org.in`) with full PDF report.

---

## Confirmed findings on demo.testfire.net (deliberately vulnerable lab)

```
CRITICAL  SQL Injection β€” Time-based blind (PostgreSQL confirmed)
          URL    : http://demo.testfire.net/search.jsp
          Payload: '; SELECT pg_sleep(3)--
          Evidence: 3.8s response vs 0.6s baseline

CRITICAL  Swagger/OpenAPI UI exposed publicly
          URL    : http://demo.testfire.net/swagger/properties.json
          Email leaked: jsmtih@altoromutual.com

HIGH      Reflected XSS
          URL    : http://demo.testfire.net/search.jsp
          Payload:  reflected unescaped in HTML response

[AI-Agent] Risk: CRITICAL (score: 9.5/10)
[AI-Agent] β†’ Remove public Swagger access
[AI-Agent] β†’ Patch CVE-2025-24813 (Tomcat partial PUT RCE, CVSS 9.8)
[AI-Agent] β†’ Fix SQLi with parameterized queries
```

---

## Architecture

```
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                     MCATester β€” 16 Stage Pipeline               β”‚
β”‚                                                                 β”‚
β”‚  Stage 1   DNS + Whois + Subdomain Enum (crt.sh/VT/HT)        β”‚
β”‚  Stage 2   Recursive Asset Discovery (parallel, 20 threads)    β”‚
β”‚  Stage 3   Subdomain Takeover Detection (20 services)          β”‚
β”‚  Stage 4   Threat Intel (urlscan / AbuseIPDB / OTX)           β”‚
β”‚  Stage 5   Tech Stack Detection (WhatWeb + headers)            β”‚
β”‚  Stage 6   AI Context Injector β€” Gemini generates dork queries β”‚
β”‚  Stage 7   Google Dorking (20+ categories, DDG + Serper)       β”‚
β”‚  Stage 8   Fetch + Content Confirmation (35 patterns)          β”‚
β”‚  Stage 9   Active Probing + WAF Detection                      β”‚
β”‚  Stage 10  Attack Chain Orchestrator                           β”‚
β”‚  Stage 11  Header Security Analysis                            β”‚
β”‚  Stage 12  Payload Injection (SQLi / XSS / Traversal)         β”‚
β”‚  Stage 13  CVE Correlation + NVD Enrichment                   β”‚
β”‚  Stage 14  AI Decision Engine (Groq) ← 5 decision points      β”‚
β”‚  Stage 15  Gemini Report Generation                            β”‚
β”‚  Stage 16  PDF Export + Webhook Alerts                         β”‚
β”‚                                                                 β”‚
β”‚  FastAPI backend + SQLite + Real-time dashboard                 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
```

The AI Decision Engine (Stage 14) is not just report-writing β€” it makes actual decisions at 5 points: target triage, URL prioritization, injection targeting, CVE exploitability assessment, and final risk ranking.

---

## How MCATester compares

| Capability | MCATester | Nikto | gobuster | Burp Suite Free |
|---|:---:|:---:|:---:|:---:|
| Zero false positives | βœ“ | βœ— | βœ— | Manual |
| CVE correlation | βœ“ | Partial | βœ— | βœ— |
| SQLi/XSS confirmation | βœ“ | βœ— | βœ— | Manual |
| Subdomain takeover | βœ“ | βœ— | βœ— | βœ— |
| AI risk scoring | βœ“ | βœ— | βœ— | βœ— |
| Attack chain orchestration | βœ“ | βœ— | βœ— | Manual |
| Real-time dashboard | βœ“ | βœ— | βœ— | βœ“ |
| PDF report | βœ“ | βœ— | βœ— | Pro only |
| Drift detection | βœ“ | βœ— | βœ— | βœ— |
| Webhook alerts | βœ“ | βœ— | βœ— | βœ— |

---

## Features

### Passive Recon
- DNS (A/MX/NS/TXT/SOA/Reverse), Whois
- Subdomain enumeration β€” VirusTotal, crt.sh, HackerTarget, sublist3r (45+ subdomains found on real targets)
- GitHub recon β€” repositories referencing the target
- Threat intelligence β€” urlscan.io, AbuseIPDB, OTX AlienVault
- Email discovery + Holehe registration checking (400+ sites)
- IP intelligence β€” ASN, ISP, geolocation

### Active Discovery
- Parallel recursive asset scanning (28 assets in 3 min)
- WhatWeb tech stack fingerprinting
- 66+ path probes with WAF detection
- AI-targeted probing β€” Gemini generates paths specific to detected tech stack
- Subdomain takeover detection (20 services: GitHub Pages, Heroku, Netlify, Vercel, AWS S3, Azure, Shopify, HubSpot, Zendesk...)

### Vulnerability Confirmation
- **SQL Injection** β€” error-based + time-based blind, auto-detects MySQL/MSSQL/PostgreSQL
- **Reflected XSS** β€” safe payload reflection detection
- **Path Traversal** β€” file API parameter testing with content confirmation
- **WAF pre-check** β€” if WAF blocks all pages, skip injection (saves ~3 min on hardened targets)
- **Content Confirmation** β€” 35 signatures, kills 403 false positives

### Attack Chain Orchestrator
When one finding is confirmed, automatically fires follow-up probes:
- Swagger found β†’ probe 12 API endpoints
- VPN login found β†’ probe Fortinet-specific paths
- File API found β†’ test 10 traversal payloads (deduplicated by base endpoint)
- Webmail found β†’ probe 7 credential paths

### CVE Intelligence
- Static knowledge base β€” Fortinet, Lotus Domino, GroupWise, Tomcat, Apache, nginx, WordPress, PHP
- NVD API enrichment for confirmed CVEs
- Auto-matches detected tech stack to CVE database
- AI exploitability assessment with confidence levels

### AI Decision Engine (Groq)
5 real decisions per scan β€” not just report formatting:

```
Decision 1: Target triage
  β†’ Classifies as government/enterprise/SaaS
  β†’ Identifies high-value subdomains to prioritize

Decision 2: URL ranking
  β†’ Ranks 40+ discovered URLs by exploitation potential
  β†’ VPN login page > generic content page

Decision 3: Injection targeting
  β†’ Selects which pages are worth injection testing
  β†’ Skips pages with no injectable parameters

Decision 4: CVE exploitability
  β†’ Assesses if correlated CVEs are likely exploitable
  β†’ Considers service accessibility + version ranges

Decision 5: Final risk assessment
  β†’ Risk score (0-10)
  β†’ Executive summary (2-3 sentences for management)
  β†’ Technical summary (attack vectors for security team)
  β†’ Specific immediate actions
```

### Dashboard & Reporting
- Real-time web dashboard β€” live scan status, severity donut, risk trend chart
- Attack Chains page β€” findings grouped by CVE Intelligence / Active Exploitation / Infrastructure
- Alerts page β€” all CRITICAL/HIGH findings across all scans, grouped by target with timestamps
- Drift detection β€” scan-over-scan comparison, flags new/resolved/changed findings
- PDF report β€” VAPT-style with findings, evidence, CVSS scores, remediation steps
- Webhooks β€” Slack, Discord, Telegram for HIGH+ findings

---

## Installation

**Requirements:** Python 3.10+, Linux or WSL2, nmap

```bash
git clone https://github.com/yourusername/MCATester.git
cd MCATester

python -m venv venv
source venv/bin/activate

pip install -r requirements.txt

# Optional but improves results significantly
pip install groq
sudo apt install nmap whatweb
```

### API Keys (`.env`)

```bash
cp .env.example .env
# Edit .env with your keys
```

| Key | Where to get | Cost |
|---|---|---|
| `GEMINI_API_KEY` | aistudio.google.com | Free (15 req/min) |
| `SERPER_API_KEY` | serper.dev | Free (2500/month) |
| `VIRUSTOTAL_API_KEY` | virustotal.com | Free (500/day) |
| `GROQ_API_KEY` | console.groq.com | Free (fast) |
| `SHODAN_API_KEY` | shodan.io | $49/year |

---

## Usage

### CLI

```bash
# Full scan β€” all 16 stages
python osint_agent.py mca.gov.in

# Passive only β€” no active probing or injection
python osint_agent.py mca.gov.in --passive

# Skip recursive discovery (faster β€” ~5 min vs ~10 min)
python osint_agent.py mca.gov.in --no-recursive
```

### Dashboard

```bash
python server.py
# Open http://localhost:8000
```

Enter domain β†’ Start Scan β†’ watch results populate in real time.

---

## Scan performance

```
mca.gov.in (45 subdomains, WAF protected):
  Total time    : ~10 minutes
  Findings      : 11 (zero false positives)
  False positives: 0 (was 61 in v1)

demo.testfire.net (no WAF, vulnerable):
  Total time    : ~12 minutes
  Findings      : 15 (confirmed SQLi + XSS + CVEs)

Time breakdown (approximate):
  Subdomain enum        : 2 min  (crt.sh + VirusTotal sequential)
  Recursive discovery   : 3 min  (28 assets parallel)
  Dorking               : 2 min  (DDG + Serper)
  Payload injection     : 0 min  (WAF pre-check skips on mca.gov.in)
                          3 min  (full testing on demo.testfire.net)
  CVE + AI decisions    : 1 min  (5 Groq calls)
  Other stages          : 2 min
```

---

## Project structure

```
MCATester/
β”œβ”€β”€ osint_agent.py           # Main pipeline β€” 16 stages, CLI entry
β”œβ”€β”€ server.py                # FastAPI backend β€” scan management + API
β”œβ”€β”€ orchestrator.py          # Attack chain engine
β”œβ”€β”€ ai_decision_engine.py    # Groq LLM β€” 5 decision points per scan
β”œβ”€β”€ ai_context_injector.py   # Gemini β€” targeted dork + path generation
β”œβ”€β”€ cve_correlation.py       # CVE matching + NVD API enrichment
β”œβ”€β”€ payload_injector.py      # SQLi/XSS/traversal with WAF pre-check
β”œβ”€β”€ subdomain_takeover.py    # Dangling CNAME β€” 20 services
β”œβ”€β”€ recursive_discovery.py   # Parallel subdomain + port scanner
β”œβ”€β”€ delta_detection.py       # Scan-over-scan diff
β”œβ”€β”€ content_confirmation.py  # 35-pattern false-positive eliminator
β”œβ”€β”€ webhooks.py              # Slack/Discord/Telegram alerts
β”œβ”€β”€ osint_features.py        # PDF report generator
β”œβ”€β”€ osint_identity.py        # IP intel + Holehe
β”œβ”€β”€ search.py                # DDG/Serper wrapper
β”œβ”€β”€ static/
β”‚   └── index.html           # Real-time dashboard SPA
β”œβ”€β”€ requirements.txt
β”œβ”€β”€ .env.example
└── README.md
```

---

## Responsible use

**Only test systems you own or have explicit written permission to test.**

Built-in safety measures:
- Warning banner on every CLI run
- `--passive` mode disables all active testing
- Injection payloads are read-only diagnostics β€” no write operations
- Rate limiting (1s between requests)
- WAF pre-check skips injection when target is hardened
- 403 responses never reported as findings

For disclosures: India β†’ CERT-In `incident@cert-in.org.in`

---

## Tech stack

| Layer | Technology |
|---|---|
| Pipeline | Python 3.12 |
| Backend API | FastAPI + SQLite |
| Frontend | Vanilla JS + CSS custom properties |
| AI decisions | Groq β€” llama-3.3-70b-versatile |
| AI context | Google Gemini 2.5 Flash |
| PDF generation | ReportLab |
| Port scanning | Shodan InternetDB + nmap fallback |
| Tech detection | WhatWeb + header inference |
| Subdomain data | crt.sh + VirusTotal + HackerTarget |

---

## Roadmap

- [ ] Screenshot capture β€” Playwright screenshots of all discovered assets
- [ ] Scheduled scanning β€” 24h autonomous monitoring with drift alerts
- [ ] nuclei integration β€” template-based CVE confirmation
- [ ] Multi-target mode β€” scan an entire organization at once
- [ ] SARIF export β€” GitHub Security tab integration

---

## Author

**SANKARAYOUGI SRIVASTESWAR** β€” B.Tech Computer Science, VIT-AP University  
Security research intern, National e-Governance Division (NeGD), MeitY, New Delhi

---

*For authorized security testing and research only. The author is not responsible for misuse.*