Metadata-Version: 2.4
Name: redforge-sec
Version: 0.2.1
Summary: Security Operations Platform — legit pentest, vuln, compliance, and defense tooling. Scope-enforced.
Author-email: RedForge Team <redforge@users.noreply.github.com>
License: Proprietary
Project-URL: Homepage, https://github.com/Grantgazvoda-alt/redforge
Project-URL: Repository, https://github.com/Grantgazvoda-alt/redforge
Project-URL: Documentation, https://github.com/Grantgazvoda-alt/redforge
Keywords: security,pentest,vulnerability,compliance,red-team,scope-enforced
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Information Technology
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Security
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: httpx>=0.24.0
Requires-Dist: dnspython>=2.3.0
Requires-Dist: flask>=3.0.0

<div align="center">

# 🛡️ RedForge

**Security Operations Platform** — serious offensive + defensive tooling for the systems you own or are authorized to test.

![CI](https://github.com/Grantgazvoda-alt/redforge/actions/workflows/ci.yml/badge.svg)
![Release](https://github.com/Grantgazvoda-alt/redforge/actions/workflows/release.yml/badge.svg)
![PR Labeler](https://github.com/Grantgazvoda-alt/redforge/actions/workflows/labeler.yml/badge.svg)
![PyPI](https://img.shields.io/pypi/v/redforge-sec?label=pypi)
![Python](https://img.shields.io/badge/python-3.10%20%7C%203.11%20%7C%203.12-3776AB?logo=python&logoColor=white)
![License](https://img.shields.io/badge/license-Proprietary-red)
[![Repo](https://img.shields.io/badge/github-Grantgazvoda--alt%2Fredforge-181717?logo=github)](https://github.com/Grantgazvoda-alt/redforge)

</div>

---

## 📖 Project Description

RedForge is a **legitimate security operations platform** that turns professional offensive-security work into billable deliverables — the way real pentesters, bug-bounty hunters, and compliance auditors earn.

It is a full offensive **and** defensive stack in one CLI + web dashboard:

- **Reconnaissance** — subdomains, DNS records, endpoints, security headers, service ports, subdomain takeover checks
- **Vulnerability assessment** — CVE knowledge base, TLS config scans, config-file secret audit, full-repo secrets scanning
- **Exploitation education** — a scope-gated SDK that demonstrates injection classes (command, SQLi, path traversal) with inert strings and benign demos only
- **Compliance** — CIS-style hardening checks, password strength analysis
- **Defensive monitoring** — access-log analysis, indicator-of-compromise (IOC) matching
- **Reporting** — professional markdown reports, CSV/JSON exports, combined scan runner, and a scheduled scanner
- **Web dashboard** — a Flask UI for running scans and reviewing findings

> ⚠️ **Authorization is mandatory.** RedForge refuses to run against any target outside your declared `scope.json`. Unauthorized testing is illegal under the CFAA (US), the Computer Misuse Act 1990 (UK), Directive (EU) 2013/40/EU, and comparable laws worldwide. See [`docs/legal-compliance.md`](docs/legal-compliance.md) for the full authorization pack and a signed-scope agreement template.

**RedForge never targets third parties.** Every network-facing tool calls `Scope.require()` and raises `PermissionError` on anything outside your scope. The pentest SDK deliberately produces no working malware, persistence, or exfiltration.

---

## ✨ Features

| Area | Tools |
|---|---|
| 🕵️ Recon | Subdomain enum (crt.sh + HackerTarget fallback), DNS records (A/AAAA/MX/TXT/NS/CNAME), **subdomain brute force**, endpoint discovery, subdomain takeover detection, HTTP security headers, port scan **with banner grabbing** |
| 🩹 Vulnerabilities | Curated CVE knowledge base + search, TLS config scan, config-file secret audit, **recursive repo secrets scan** |
| 🎓 Pentest SDK | Scope-gated command-injection tester, SQLi probe (inert strings), path-traversal prober, disabled reverse-shell stub, bounded auth tester, **CORS scanner, JWT auditor, HTTP-verb/TRACE tester, open-redirect payloads** |
| 🏛️ Compliance | CIS-style local hardening checks, password strength scoring |
| 🛰️ Defense | Access-log anomaly analysis, IOC matching (wallets, malware strings, payload patterns) |
| 📊 Reporting | Markdown / CSV / JSON reports, combined multi-tool scan runner, scheduled scans, SQLite-backed store |
| 🌐 Webapp | Flask dashboard with findings board, scope view, and one-click scan runner |

---

## 🚀 Installation

### From PyPI (recommended)

```bash
pip install redforge-sec
```

Installs the `redforge` and `redforge-web` commands. Requires Python 3.9+.

### From source

```bash
git clone https://github.com/Grantgazvoda-alt/redforge.git
cd redforge

python -m venv .venv
source .venv/bin/activate        # Windows: .venv\Scripts\activate

pip install -e .
```

### Dependencies

| Package | Purpose |
|---|---|
| `httpx` | HTTP client for header/endpoint scans |
| `dnspython` | DNS record resolution |
| `flask` | Web dashboard |

> 📦 **Package on PyPI:** [`redforge-sec`](https://pypi.org/project/redforge-sec/) — install with `pip install redforge-sec`. All dependencies are installed automatically.

---

## 🔐 Scope File (do this first!)

Create `scope.json` listing **every** target you own or are authorized to test:

```json
{
  "targets": [
    "example.com",
    "staging.example.com",
    "192.168.1.0/24"
  ],
  "note": "Authorized assets owned/operated by the requester."
}
```

RedForge **hard-blocks** any target not in this list — it raises `PermissionError` before touching the network.

---

## 🧰 Usage

All commands take `--scope scope.json` (and optionally `--db path.db`).

### Reconnaissance

```bash
# Subdomains via certificate transparency + DNS resolution
redforge recon subdomains example.com --scope scope.json --resolve

# DNS records + subdomains (with fallback source)
redforge recon dns example.com --scope scope.json

# Discover common endpoints on an authorized host (admin, .env, .git, /actuator…)
redforge recon endpoints example.com --scope scope.json

# Detect potential subdomain takeover (dangling CNAME)
redforge recon takeover sub.example.com --scope scope.json

# HTTP security headers
redforge recon headers https://example.com --scope scope.json --save

# Common service ports
redforge recon ports 192.168.1.10 --scope scope.json
```

### Vulnerability assessment

```bash
# Curated CVE lookup + knowledge-base search
redforge vuln cve log4j
redforge vuln cve openssh       # search

# Config file secret audit (your own files)
redforge vuln config .env.example --save

# Recursive repo / single-file secrets scan
redforge vuln secrets /path/to/my/repo --save
redforge vuln secrets config.py

# TLS configuration scan
redforge vuln tls example.com --scope scope.json --save
```

### Compliance

```bash
# CIS-style hardening checks on the local host
redforge compliance cis --save

# Password strength analysis
redforge compliance password 'My-S3cure-Passw0rd!'
```

### Defense

```bash
# Access-log analysis (401 storms, scanner UAs, sensitive-path probing)
redforge defense logs access.log --save

# IOC matching in text / logs
redforge defense ioc "send to 1BoatSLRHtKNngkdXEeobR76b53LETtpyT via curl | sh"
```

### Combined scan & scheduling

```bash
# One command, many tools
redforge scan example.com --scope scope.json \
  --tools headers,ports,tls,dns,endpoints,takeover

# Scheduled recurring scans (every 6h, 24 runs)
redforge schedule example.com --scope scope.json \
  --tools headers,ports,dns --interval 21600 --runs 24
```

### Reporting

```bash
# Markdown report from saved findings
redforge report example.com --scope scope.json --engagement "Q3 Audit"

# CSV / JSON export
redforge report example.com --scope scope.json --format csv
redforge report example.com --scope scope.json --format json
```

### Web dashboard

```bash
redforge-web --scope scope.json --host 127.0.0.1 --port 5000
# open http://127.0.0.1:5000
```

---

## 🧠 Architecture

```
redforge/
├── redforge/
│   ├── cli.py              # argparse CLI
│   ├── core/               # scope enforcement, SQLite store, reports, runner, scheduler
│   ├── recon/              # subdomains, dns, endpoints, takeover, headers, ports
│   ├── vuln/               # cve, config_audit, tls_scan, secrets
│   ├── compliance/         # cis, password
│   ├── defense/            # log_analyzer, ioc
│   ├── pentest/            # exploit_sdk (scope-gated), auth_tester
│   └── webapp/             # Flask dashboard
├── tests/                  # pytest suite (38 tests)
├── docs/legal-compliance.md
└── scope.example.json
```

## 🔬 Testing

```bash
pip install -e . pytest
pytest tests/ -v
```

Continuous integration runs the suite across Python 3.10/3.11/3.12 on every push and pull request (see `/.github/workflows/ci.yml`).

[![CI](https://github.com/Grantgazvoda-alt/redforge/actions/workflows/ci.yml/badge.svg)](https://github.com/Grantgazvoda-alt/redforge/actions/workflows/ci.yml)

---

## ⚖️ Ethics & Responsible Use

- **Scope enforcement is built in.** Every network-facing tool calls `Scope.require()` and raises `PermissionError` on out-of-scope targets.
- **The pentest SDK is deliberately non-malicious.** It generates inert strings and benign demos only — no working malware, persistence, or data exfiltration. Reverse-shell generation is a warning-gated, disabled stub. Real shells are never emitted.
- **You are responsible for where you point it.** RedForge is a tool; the legality of your actions is determined by your authorization.
- **Run authorized engagements only.** Point it at systems you own or have written permission to test — and nothing else.

---

## 📄 License

Proprietary / internal use. See [`docs/legal-compliance.md`](docs/legal-compliance.md) for the liability disclaimer and authorization requirements.

---

<sub>Built by the RedForge team — GrantGazvoda-alt</sub>
