Share
## https://sploitus.com/exploit?id=4A147D4B-6F2A-52CA-9C2F-F20FE406DEC5
# Safeguard
**THIS TAKES TIME TO DO HUNTING ITS AI HUNTER SO IF YOU SAID LIKE HUNT ON THIS TARGET THIS WILL TAKE TIME INSTED OF THAT FOR QUICK TEST SAY IT TO DO NMAP OR ANY OTHER SIMPLE TASK**

**System Security Auditing & Monitoring Toolkit** โ€” CLI scanner, web dashboard, exploit library, and AI-powered bug bounty hunting platform.

```bash
pip install safeguard
safeguard scan              # Quick security audit
safeguard dashboard         # Web dashboard (port 5050)
safeguard hunt              # Bug bounty hunting platform (port 5050)
```

---

## Features

| Component | Description |
|-----------|-------------|
| **Scanner** | Port scanning, secrets detection, system hardening checks, filesystem auditing, CVE scanning, log analysis, Docker security audit |
| **Monitor** | Real-time file integrity monitoring, suspicious process detection |
| **Dashboard** | Flask web UI with scan results, system metrics, performance graphs, exploit library browser |
| **Hunt Platform** | Bug bounty hunting dashboard with AI chat, exploit suggestions, skill recommendations, session history |
| **Exploit Library** | 79+ CVE proof-of-concept exploits with search, filter, download, and AI-powered exploitation guidance |
| **AI Engine** | AI-driven analysis of scan results, exploit selection, and targeted hunting recommendations using 300+ offensive security skills |
| **Reporting** | Comprehensive HTML reports with port scans, secrets, CVEs, filesystem audit, Docker security, and hardening recommendations |
| **Hardening** | Auto-generated Bash hardening scripts based on scan findings (CVE, system, filesystem, Docker, logs) |

## CLI Usage

```bash
# Quick security scan
safeguard scan

# Targeted scans
safeguard scan --no-port --no-secrets                 # System checks only
safeguard scan --dir /path/to/code                    # Secrets scan in specific dir
safeguard scan --output report.html --json             # HTML + JSON export

# Vulnerability scanning
safeguard cve                                          # Check installed packages for known CVEs
safeguard logs --threshold 5                           # Analyze auth logs for brute force
safeguard docker                                       # Audit Docker security configuration

# Monitoring & integrity
safeguard monitor --paths /etc/passwd /etc/shadow      # Watch files for changes
safeguard monitor --init                               # Initialize integrity baseline
safeguard integrity                                    # Check files against baseline
safeguard processes                                    # Scan for suspicious processes

# Reporting & hardening
safeguard report --output audit.html                   # Comprehensive HTML report
safeguard harden --output harden.sh                    # Generate hardening script

# Interactive mode
safeguard interactive                                  # TUI menu

# Web UIs
safeguard dashboard                                    # Web dashboard (port 5050)
safeguard hunt                                         # Bug bounty hunting platform (port 5050)
```

## Hunt Platform

The bug bounty hunting platform (`safeguard hunt`) provides:

- **Exploit Library** โ€” Browse 79+ CVE PoCs with search, severity filter, CVSS sort, and one-click download
- **AI Chat** โ€” Conversational AI assistant (Claude Mythos persona) for security analysis and guidance
- **Auto Scan** โ€” Runs full security audit (ports, secrets, system, filesystem, CVEs, logs, Docker, integrity, processes) on launch
- **AI Analysis** โ€” Get AI-powered analysis of scan results with actionable recommendations
- **AI Hunting** โ€” Submit a target and receive AI-generated attack methodology using the exploit library and 300+ skills
- **Skill Recommendations** โ€” AI suggests relevant offensive security skills based on scan findings
- **Session History** โ€” Persisted hunting sessions with notes, timestamps, and re-analysis

### API Endpoints

| Route | Method | Description |
|-------|--------|-------------|
| `/api/ping` | GET | Health check |
| `/api/config` | GET/POST | Get/set AI config |
| `/api/scan/status` | GET | Current scan status |
| `/api/scan/start` | POST | Trigger a new scan |
| `/api/exploits` | GET | List exploits (search, severity, sort params) |
| `/api/exploits/` | GET | Exploit detail + source code |
| `/api/exploits//download` | GET | Download PoC script |
| `/api/exploits/refresh` | GET | Rebuild exploit index from headers |
| `/api/ai/chat` | POST | Send message to AI |
| `/api/ai/analyze` | POST | Analyze scan results via AI |
| `/api/ai/hunt` | POST | AI-driven target hunting |
| `/api/ai/suggest-exploit` | POST | AI suggests how to weaponize a CVE |
| `/api/ai/skills-recommend` | POST | AI recommends skills from scan data |
| `/api/ai/clear` | POST | Clear AI conversation history |
| `/api/skills` | GET | List available skills (optional category filter) |
| `/api/skills/tree` | GET | Skills categorized as tree |
| `/api/skills/search` | GET | Full-text skill search |
| `/api/dashboard/stats` | GET | Aggregate stats for dashboard |
| `/api/performance` | GET | Live CPU/memory/disk/network metrics |
| `/api/history` | GET | Hunt session history |
| `/api/findings/ai` | GET | Latest AI findings |

## Exploit Library

The exploit library lives at `safeguard/dashboard/exploits/` and contains **79 CVE PoCs** organized as:

```
exploits/
โ”œโ”€โ”€ .exploit_index.json          # Auto-generated metadata index
โ”œโ”€โ”€ CVE-2024-45409/
โ”‚   โ””โ”€โ”€ poc/poc.py
โ”œโ”€โ”€ CVE-2025-14931/
โ”‚   โ””โ”€โ”€ poc/poc.py
โ”œโ”€โ”€ CVE-2025-47812/
โ”‚   โ””โ”€โ”€ poc/poc.py               # Wing FTP 7.4.3 unauthenticated RCE (CVSS 10.0)
โ””โ”€โ”€ ... (76 more CVE directories)
```

Each PoC includes an EIP-style header that `parse_poc_header()` uses to extract metadata (CVE, title, CVSS, vendor, product, platform, type, author, date). The index is regenerated on demand via `GET /api/exploits/refresh`.

## Architecture

```
safeguard/
โ”œโ”€โ”€ cli.py                    # CLI entry point (argparse + rich TUI)
โ”œโ”€โ”€ scanner/
โ”‚   โ”œโ”€โ”€ network.py            # Port scanning (TCP connect, banner grab)
โ”‚   โ”œโ”€โ”€ secrets.py            # Regex-based secret/password detection
โ”‚   โ”œโ”€โ”€ system_check.py       # OS hardening checks (SSH, firewall, etc.)
โ”‚   โ”œโ”€โ”€ filesystem.py         # SUID/SGID/world-writable audit
โ”‚   โ”œโ”€โ”€ cve_check.py          # Package-level CVE matching
โ”‚   โ”œโ”€โ”€ log_analyzer.py       # Auth log brute force analysis
โ”‚   โ”œโ”€โ”€ docker_audit.py       # Docker security configuration audit
โ”‚   โ””โ”€โ”€ hardening.py          # Hardening script generation
โ”œโ”€โ”€ monitor/
โ”‚   โ”œโ”€โ”€ file_integrity.py     # File integrity monitoring
โ”‚   โ””โ”€โ”€ process_watcher.py    # Suspicious process detection
โ”œโ”€โ”€ dashboard/
โ”‚   โ”œโ”€โ”€ hunt_app.py           # Flask hunt platform (routes)
โ”‚   โ”œโ”€โ”€ app.py                # Flask dashboard (routes)
โ”‚   โ”œโ”€โ”€ engine.py             # Scan orchestration + caching
โ”‚   โ”œโ”€โ”€ exploit_index.py      # Exploit library index builder
โ”‚   โ”œโ”€โ”€ ai_engine.py          # AI chat/analysis/hunt engine
โ”‚   โ”œโ”€โ”€ skills_bridge.py      # Skill discovery bridge
โ”‚   โ”œโ”€โ”€ exploits/             # 79 CVE PoC scripts
โ”‚   โ”œโ”€โ”€ templates/            # Jinja2 HTML templates
โ”‚   โ””โ”€โ”€ static/               # Icons, assets
โ”œโ”€โ”€ report/
โ”‚   โ””โ”€โ”€ html_report.py        # HTML report generator
โ””โ”€โ”€ utils/
    โ””โ”€โ”€ helpers.py            # Shared utilities
```

## Dependencies

| Package | Required For |
|---------|-------------|
| `rich>=13.0.0` | CLI output formatting, tables, progress bars |
| `cryptography>=41.0.0` | Cryptographic operations |
| `flask>=2.0.0` | Web dashboard and hunt platform |

## Installation

```bash
# From source
git clone 
cd safeguard
pip install -e .

# Or with dev dependencies
pip install -e ".[dev]"
```

## License

MIT