Comprehensive security testing framework for Discourse forums
Features β’ Installation β’ Usage β’ Modules β’ Contributing
DiscourseMap is a comprehensive, modular security testing framework specifically designed for Discourse forum platforms. It combines Python-based scanning modules with Ruby exploit integration to provide thorough security assessments covering everything from basic information gathering to advanced vulnerability exploitation.
- 25+ Security Modules covering all aspects of Discourse security
- Ruby Exploit Integration with 25+ CVE-specific exploits
- Modular Architecture for easy extension and customization
- Comprehensive Coverage from reconnaissance to exploitation
- Professional Reporting with detailed findings and recommendations
- Active Development with regular updates and new features
Category | Description | Modules |
---|---|---|
Information Gathering | Reconnaissance and fingerprinting | Info, Endpoint, User |
Vulnerability Assessment | Core security testing | Vulnerability, CVE Exploits |
Authentication & Authorization | Access control testing | Auth, Session Management |
Configuration Security | Misconfigurations and hardening | Config, Network |
Cryptographic Analysis | Crypto implementation testing | Crypto, SSL/TLS |
Plugin & Theme Security | Extension security testing | Plugin, Theme Analysis |
- Multi-Vector Testing: Combines automated scanning with manual exploit techniques
- CVE Database: Integrated database of Discourse-specific vulnerabilities
- Custom Payloads: Sophisticated payload generation and testing
- Evasion Techniques: Advanced methods to bypass security controls
- Real-time Analysis: Live vulnerability detection and exploitation
- Detailed Reporting: Comprehensive reports with remediation guidance
# Install from PyPI - Simple and fast!
pip install discoursemap
# Verify installation
discoursemap --help
# Start scanning immediately
discoursemap -u https://forum.example.com
# Add the tap
brew tap ibrahmsql/discoursemap
# Install DiscourseMap
brew install discoursemap
# Using yay
yay -S discoursemap
# Using paru
paru -S discoursemap
flatpak install flathub com.github.ibrahmsql.discoursemap
# Download and run
wget https://github.com/ibrahmsql/discoursemap/releases/latest/download/DiscourseMap-1.2.2-x86_64.AppImage
chmod +x DiscourseMap-1.2.2-x86_64.AppImage
./DiscourseMap-1.2.2-x86_64.AppImage --help
# Install with pipx for isolated environment
pipx install discoursemap
# Install specific version
pip install discoursemap==1.2.2
# Upgrade to latest version
pip install --upgrade discoursemap
# System Requirements
- Python 3.8 or higher
- Ruby 2.7 or higher
- Git
- Internet connection for dependency installation
# Clone the repository
git clone https://github.com/ibrahmsql/discoursemap.git
cd discoursemap
# Install Python dependencies
pip3 install -r requirements.txt
# Install Ruby dependencies
bundle install
# Make scripts executable
chmod +x discoursemap/scanner.py
chmod +x ruby_exploit_runner.rb
# Verify installation
python3 discoursemap/scanner.py --help
# Build Docker image
docker build -t discoursemap .
# Run scanner with Docker (performance presets)
docker run --rm -v $(pwd)/reports:/app/reports discoursemap \
python3 main.py -u https://target-forum.com --fast
# Using Docker Compose with environment variables
export PERFORMANCE_MODE=fast
export MAX_THREADS=50
docker-compose run --rm discoursemap \
python3 main.py -u https://target-forum.com --fast -m info vuln
# Start scanner services
docker-compose up -d
# Interactive mode
docker run -it --rm discoursemap bash
# Install development dependencies
pip3 install -r requirements-dev.txt
# Install pre-commit hooks
pre-commit install
# Run tests
python3 -m pytest tests/
# Basic security scan
python3 discoursemap/main.py -u https://discourse.example.com
# Scan with specific modules
python3 discoursemap/main.py -u https://discourse.example.com -m info vulnerability auth
# Quick scan (legacy mode)
python3 discoursemap/main.py -u https://discourse.example.com --quick
# Scan with custom output
python3 discoursemap/main.py -u https://discourse.example.com -o json -f results.json
# Maximum Speed Preset (50 threads, 0.01s delay)
python3 discoursemap/main.py -u https://discourse.example.com --fast
# Balanced Preset (20 threads, 0.05s delay) - Recommended
python3 discoursemap/main.py -u https://discourse.example.com --balanced
# Safe Mode Preset (10 threads, 0.1s delay)
python3 discoursemap/main.py -u https://discourse.example.com --safe
# Custom performance settings
python3 discoursemap/main.py -u https://discourse.example.com -t 25 --delay 0.03
# Fast scan with specific modules
python3 discoursemap/main.py -u https://discourse.example.com --fast -m info vuln endpoint
# Performance comparison
time python3 discoursemap/main.py -u https://discourse.example.com --fast
time python3 discoursemap/main.py -u https://discourse.example.com --safe
# Scan with authentication
python3 discoursemap/scanner.py -u https://discourse.example.com \
--username admin --password secretpass
# Scan with proxy
python3 discoursemap/scanner.py -u https://discourse.example.com \
--proxy http://127.0.0.1:8080
# Scan with custom headers
python3 discoursemap/scanner.py -u https://discourse.example.com \
--headers "X-Forwarded-For: 127.0.0.1" "User-Agent: CustomBot/1.0"
# Stealth mode with delays
python3 discoursemap/scanner.py -u https://discourse.example.com \
--delay 2 --random-delay
# Run specific CVE exploits
python3 discoursemap/modules/cve_exploit_module.py \
--target https://discourse.example.com \
--cve CVE-2021-41163
# Run all Ruby exploits
ruby ruby_exploit_runner.rb https://discourse.example.com
# Run exploits with custom parameters
ruby ruby_exploit_runner.rb https://discourse.example.com \
--timeout 30 --threads 5
- Server Information: Version detection, technology stack
- Configuration Discovery: Settings, features, plugins
- User Enumeration: Active users, administrators, moderators
- Content Analysis: Categories, topics, sensitive information
- Directory Discovery: Hidden paths, admin panels, API endpoints
- File Discovery: Backup files, configuration files, logs
- API Enumeration: REST endpoints, GraphQL schemas
- Subdomain Discovery: Related domains and services
- Injection Attacks: SQL, NoSQL, LDAP, Command injection
- Cross-Site Scripting: Reflected, Stored, DOM-based XSS
- Cross-Site Request Forgery: CSRF token analysis
- Server-Side Request Forgery: SSRF testing
- XML External Entity: XXE vulnerability testing
- Insecure Deserialization: Object injection attacks
- Authentication Bypass: Login bypass techniques
- Privilege Escalation: Horizontal and vertical escalation
- Session Management: Session fixation, hijacking
- Password Policy: Weak password detection
- Account Lockout: Brute force protection testing
- OAuth/SSO Security: Third-party authentication flaws
- Weak Hashing: MD5, SHA1 detection
- Weak Encryption: DES, RC4, ECB mode detection
- JWT Vulnerabilities: Algorithm confusion, weak secrets
- Session Security: Cookie analysis, CSRF tokens
- Key Exposure: Private key leakage
- Timing Attacks: Cryptographic timing vulnerabilities
- Port Scanning: Service discovery
- SSL/TLS Analysis: Certificate validation, cipher analysis
- DNS Analysis: Zone transfers, subdomain enumeration
- CDN Detection: Content delivery network analysis
- Firewall Detection: Security control identification
- Load Balancer Analysis: Infrastructure mapping
- Configuration Files: Exposed settings, backups
- Debug Information: Error messages, stack traces
- Security Headers: HSTS, CSP, X-Frame-Options
- CORS Misconfiguration: Cross-origin policy flaws
- Default Credentials: Common username/password combinations
- Environment Variables: Sensitive data exposure
- Plugin Discovery: Installed plugins and themes
- Vulnerability Testing: Plugin-specific security flaws
- Outdated Components: Version analysis
- Dangerous Permissions: Excessive privileges
- File Access: Unauthorized file operations
- Theme Injection: Template injection vulnerabilities
- User Enumeration: Username discovery techniques
- Profile Analysis: Sensitive information exposure
- Permission Testing: Access control verification
- Social Engineering: Information gathering
- Account Takeover: Session and credential attacks
CVE | Description | CVSS | Module |
---|---|---|---|
CVE-2019-11479 | SQL Injection in search | 9.8 | CVE-2019-11479.rb |
CVE-2021-41163 | RCE via theme import | 9.8 | CVE-2021-41163.rb |
CVE-2023-49103 | Admin panel auth bypass | 9.1 | CVE-2023-49103.rb |
CVE-2024-28084 | File upload RCE | 9.8 | CVE-2024-28084.rb |
CVE-2024-42364 | SQL injection via search | 9.3 | CVE-2024-42364.rb |
CVE | Description | CVSS | Module |
---|---|---|---|
CVE-2022-31053 | SSRF via onebox preview | 8.6 | CVE-2022-31053.rb |
CVE-2024-35198 | Server-side template injection | 8.8 | CVE-2024-35198.rb |
CVE-2023-37467 | CSP nonce reuse XSS | 7.5 | discourse_cve_exploits.rb |
CVE-2021-41082 | Microsoft Exchange Server RCE | 8.8 | CVE-2021-41082.rb |
CVE | Description | CVSS | Module |
---|---|---|---|
CVE-2023-45131 | Discourse unauthenticated chat access | 6.5 | CVE-2023-45131.rb |
- XSS Exploits (
discourse_xss.rb
) - Multiple XSS vectors - SSRF Exploits (
discourse_ssrf.rb
) - Server-side request forgery - RCE Exploits (
discourse_rce.rb
) - Remote code execution - SQL Injection (
discourse_sqli.rb
) - Database injection attacks - Auth Bypass (
discourse_auth_bypass.rb
) - Authentication bypass - File Upload (
discourse_file_upload.rb
) - File upload vulnerabilities - Info Disclosure (
discourse_info_disclosure.rb
) - Information leakage - CSRF Attacks (
discourse_csrf.rb
) - Cross-site request forgery - XXE Attacks (
discourse_xxe.rb
) - XML external entity - Plugin Exploits (
discourse_plugin_exploits.rb
) - Plugin vulnerabilities
π‘οΈ DiscourseMap v2.0
π― Target: https://discourse.example.com
β° Started: 2024-12-20 10:30:15
[INFO] Starting comprehensive security scan...
[INFO] Modules loaded: info, endpoint, vulnerability, auth, crypto
π Information Gathering
βββ [β] Server: Discourse 3.1.2 (Ruby 3.0.4)
βββ [β] Plugins: 12 installed (3 outdated)
βββ [β οΈ] Admin users: 2 discovered
βββ [β] Categories: 15 public, 3 restricted
π Endpoint Discovery
βββ [β] Admin panel: /admin (protected)
βββ [β οΈ] Debug endpoint: /debug (exposed)
βββ [β] API endpoints: 45 discovered
βββ [β] Backup files: config.bak found
π‘οΈ Vulnerability Assessment
βββ [β] SQL Injection: 2 vulnerabilities found
βββ [β οΈ] XSS: 1 stored XSS in user profiles
βββ [β] CSRF: Missing tokens on 3 endpoints
βββ [β] File upload: Properly restricted
π Authentication & Authorization
βββ [β] Default credentials: admin/admin works
βββ [β οΈ] Session management: No timeout configured
βββ [β] Password policy: Strong requirements
βββ [β] Privilege escalation: Role manipulation possible
π Cryptographic Security
βββ [β οΈ] Weak hashing: MD5 found in password reset
βββ [β] SSL/TLS: Properly configured
βββ [β] JWT: Algorithm confusion vulnerability
βββ [β οΈ] Session cookies: Missing secure flag
π Scan Summary
βββ π΄ Critical: 3 vulnerabilities
βββ π‘ High: 5 vulnerabilities
βββ π Medium: 8 vulnerabilities
βββ π’ Low: 12 vulnerabilities
πΎ Report saved: discourse_scan_20241220_103015.json
β±οΈ Scan completed in 4m 32s
# DiscourseMap Configuration
# Target Configuration
target:
url: "https://discourse.example.com"
timeout: 30
retries: 3
verify_ssl: true
# Authentication
auth:
username: ""
password: ""
api_key: ""
session_cookie: ""
# Scanning Options
scan:
modules:
- info
- endpoint
- vulnerability
- auth
- crypto
- network
- config
- plugin
- user
aggressive: false
delay: 1
random_delay: true
threads: 5
# Proxy Configuration
proxy:
http: ""
https: ""
socks: ""
# Output Configuration
output:
format: "json" # json, xml, html, pdf
file: "scan_results.json"
verbose: true
colors: true
# Ruby Exploit Configuration
ruby_exploits:
enabled: true
timeout: 60
max_threads: 3
cve_filter: [] # Empty = all CVEs
# Reporting
reporting:
include_screenshots: false
include_payloads: true
risk_scoring: true
compliance_mapping: true
# Set environment variables for sensitive data
export DISCOURSE_USERNAME="admin"
export DISCOURSE_PASSWORD="secretpass"
export DISCOURSE_API_KEY="your-api-key"
export PROXY_URL="http://127.0.0.1:8080"
discoursemap/
βββ discoursemap/
β βββ modules/
β β βββ __init__.py
β β βββ info_module.py
β β βββ endpoint_module.py
β β βββ vulnerability_module.py
β β βββ auth_module.py
β β βββ crypto_module.py
β β βββ network_module.py
β β βββ config_module.py
β β βββ plugin_module.py
β β βββ user_module.py
β β βββ cve_exploit_module.py
β β βββ utils.py
β βββ scanner.py
βββ ruby_exploits/
β βββ CVE-2019-11479.rb
β βββ CVE-2021-41163.rb
β βββ CVE-2022-31053.rb
β βββ CVE-2023-49103.rb
β βββ CVE-2024-28084.rb
β βββ CVE-2024-35198.rb
β βββ CVE-2024-42364.rb
β βββ discourse_xss.rb
β βββ discourse_ssrf.rb
β βββ discourse_rce.rb
β βββ discourse_sqli.rb
β βββ discourse_auth_bypass.rb
β βββ discourse_file_upload.rb
β βββ discourse_info_disclosure.rb
β βββ discourse_csrf.rb
β βββ discourse_xxe.rb
β βββ discourse_plugin_exploits.rb
βββ CVE-2023-45131.rb
βββ CVE-2021-41082.rb
β βββ discourse_cve_exploits.rb
β βββ discourse_file_upload_exploits.rb
β βββ discourse_api_exploits.rb
β βββ discourse_privilege_escalation.rb
βββ tests/
β βββ test_modules.py
β βββ test_exploits.py
β βββ test_integration.py
βββ docs/
β βββ API.md
β βββ MODULES.md
β βββ EXPLOITS.md
βββ requirements.txt
βββ requirements-dev.txt
βββ Gemfile
βββ Dockerfile
βββ config.yaml.example
βββ TODO.md
βββ README.md
# Example: Creating a new module
class CustomModule:
def __init__(self, scanner):
self.scanner = scanner
self.results = {
'module_name': 'Custom Security Testing',
'target': scanner.target_url,
'vulnerabilities': []
}
def run_scan(self):
"""Main scanning logic"""
print(f"[*] Running custom security tests...")
# Your testing logic here
self._test_custom_vulnerability()
return self.results
def _test_custom_vulnerability(self):
"""Test for custom vulnerability"""
# Implementation here
pass
# Example: Creating a new Ruby exploit
class CustomExploit
def initialize(target_url)
@target_url = target_url
@results = []
end
def run_exploit
puts "[*] Testing custom vulnerability..."
# Your exploit logic here
test_custom_vulnerability
@results
end
private
def test_custom_vulnerability
# Implementation here
end
end
# Run all tests
python3 -m pytest tests/ -v
# Run specific test categories
python3 -m pytest tests/test_modules.py -v
python3 -m pytest tests/test_exploits.py -v
# Run with coverage
python3 -m pytest tests/ --cov=discoursemap --cov-report=html
# Run integration tests
python3 -m pytest tests/test_integration.py -v --slow
# Set up test Discourse instance
docker run -d --name discourse-test \
-p 8080:80 \
discourse/discourse:latest
# Run tests against test instance
python3 discoursemap/scanner.py -u http://localhost:8080 --test-mode
- API Reference - Complete API documentation
- Module Guide - Detailed module documentation
- Exploit Guide - Ruby exploit documentation
- Contributing Guide - How to contribute
- Security Policy - Responsible disclosure
- Changelog - Version history
We welcome contributions! Please see our Contributing Guide for details.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
- π Bug fixes and improvements
- π New security modules and tests
- π Ruby exploit modules for new CVEs
- π Documentation improvements
- π§ͺ Test coverage expansion
- π¨ UI/UX enhancements
- π§ Performance optimizations
This project is licensed under the MIT License - see the LICENSE file for details.
IMPORTANT: This tool is for educational and authorized security testing purposes only. Users are responsible for ensuring they have proper authorization before testing any systems. The developers assume no liability for misuse of this tool.
- β Only test systems you own or have explicit permission to test
- β Follow responsible disclosure practices
- β Respect rate limits and avoid DoS conditions
- β Use in compliance with local laws and regulations
- β Do not use for malicious purposes
- β Do not test systems without authorization
- Discourse Team for creating an amazing platform
- Security Researchers who discovered and reported vulnerabilities
- Open Source Community for tools and libraries used
- Contributors who help improve this project
- π Bug Reports: GitHub Issues
- π‘ Feature Requests: GitHub Discussions
- π Security Issues: [email protected]
- π§ Email: [email protected]