# Website Security Scanner **Repository Path**: ereddate2017/website-security-scanner ## Basic Information - **Project Name**: Website Security Scanner - **Description**: 一个基于 Python 的**四层**网站安全扫描工具,专为安全专业人员设计。 - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-05-25 - **Last Updated**: 2026-05-25 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Website Security Scanner ![Python Version](https://img.shields.io/badge/python-3.7%2B-blue.svg) ![License](https://img.shields.io/badge/license-MIT-green.svg) ![Version](https://img.shields.io/badge/version-1.0.0-orange.svg) A comprehensive **four-layer** website security scanning tool written in Python, designed for security professionals. --- ## 🎯 Features ### 🔍 Four-Layer Scanning Architecture | Layer | Name | Description | | ----------- | ------------------------------- | ---------------------------------------------------------------------------------------------- | | **Layer 1** | Information Gathering | Port scanning, directory enumeration, server fingerprinting, CMS detection | | **Layer 2** | Vulnerability Detection | 11 vulnerability types including SQLi, XSS, CSRF, Path Traversal, File Upload, XXE, SSRF, etc. | | **Layer 3** | Configuration Security Check | HTTP security headers, SSL/TLS configuration, security misconfigurations | | **Layer 4** | Sensitive Information Detection | Sensitive files, API keys, HTML comments, backup files | ### 🔒 Friendly Scan Mode Designed to be **security-scan-friendly** to avoid being blocked or flagged as malicious: - Custom User-Agent identification (`SecurityScanner/1.0.0`) - Configurable request rate limiting - Custom scan purpose headers (`X-Scanner-Purpose`, `X-Scanner-Info`) - robots.txt compliance check before scanning - Random request delays between 1-3 seconds ### 🛡️ Vulnerability Detection Coverage | Vulnerability | Severity | Description | | --------------------- | --------- | -------------------------------------------------- | | SQL Injection | 🔴 High | Detect SQL injection vulnerabilities in parameters | | XSS | 🟠 Medium | Cross-site scripting detection | | CSRF | 🟠 Medium | Cross-site request forgery detection | | Command Injection | 🔴 High | OS command injection detection | | Path Traversal | 🔴 High | Directory traversal vulnerability detection | | File Upload | 🔴 High | Malicious file upload detection | | Weak Password | 🔴 High | Common weak password detection | | XXE Injection | 🔴 High | XML External Entity injection | | SSRF | 🔴 High | Server-Side Request Forgery | | Deserialization | 🔴 High | Unsafe deserialization detection | | Authentication Bypass | 🔴 High | Authentication bypass detection | ### 📊 Report Generation - JSON formatted reports - Detailed vulnerability information - Severity ratings (High/Medium/Low) - Fix suggestions - Scan timestamp - Target information --- ## 🚀 Installation ```bash # Clone the repository git clone cd website-security-scanner # Install dependencies pip install -r requirements.txt ``` ### Requirements - Python 3.7+ - `requests` - HTTP requests - `beautifulsoup4` - HTML parsing - `colorama` - Colored output - `termcolor` - Terminal colors --- ## 📖 Usage ### Basic Scan ```bash python main.py http://target-website.com ``` ### Specify Scan Layers ```bash # Scan only vulnerability detection (Layer 2) python main.py http://target-website.com -l 2 # Scan multiple layers python main.py http://target-website.com -l 1,2,3 # Scan all layers (default) python main.py http://target-website.com -l 1,2,3,4 ``` ### Command Line Options ```bash python main.py [OPTIONS] Options: -l, --layers Specify scan layers (comma separated, e.g., 1,2,3) -s, --skip-disclaimer Skip the legal disclaimer --show-config Show current configuration --help Show this help message ``` ### Show Configuration ```bash python main.py --show-config ``` --- ## ⚙️ Configuration All scan parameters can be customized via `config.ini`: ```ini [scan] default_target = http://localhost:5000 default_layers = 1,2,3,4 timeout = 15 [friendly_scan] min_delay = 1.0 max_delay = 3.0 max_requests_per_minute = 30 user_agent = SecurityScanner/1.0.0 [vulnerability] enable_sql_injection = true enable_xss = true enable_path_traversal = true enable_file_upload = true enable_weak_password = true enable_xxe = true enable_ssrf = true enable_deserialization = true enable_auth_bypass = true [report] output_directory = ./reports show_console_report = true include_suggestions = true ``` ### Configuration Options | Section | Option | Description | | ----------------- | ------------------------- | ----------------------------------------------- | | `[scan]` | `default_target` | Default target URL | | `[scan]` | `default_layers` | Default scan layers | | `[scan]` | `timeout` | Request timeout in seconds | | `[friendly_scan]` | `min_delay` | Minimum request delay | | `[friendly_scan]` | `max_delay` | Maximum request delay | | `[friendly_scan]` | `max_requests_per_minute` | Rate limit | | `[vulnerability]` | `enable_*` | Enable/disable specific vulnerability detection | | `[report]` | `output_directory` | Report output directory | --- ## 🧪 Test Server A built-in test server is available for testing and demonstration: ```bash cd test_server python app.py ``` **Test Server Endpoints:** | Endpoint | Description | | ------------------------ | ------------------------------------ | ----- | ------------------ | | `/` | Home page | | `/set-level?level=low | medium | high` | Set security level | | `/randomize` | Randomize vulnerability states | | `/security-status` | Check current security configuration | | `/file-view?file=` | Path traversal test | | `/upload` | File upload test | | `/xxe-test` | XXE injection test | | `/fetch-url?url=` | SSRF test | | `/deserialize` | Deserialization test | | `/auth-test` | Authentication bypass test | **Security Levels:** - **Low**: All vulnerabilities enabled - **Medium**: Some vulnerabilities enabled - **High**: Minimal vulnerabilities enabled --- ## 📁 Project Structure ``` website-security-scanner/ ├── main.py # Main entry point ├── config.ini # Configuration file ├── requirements.txt # Dependencies ├── reports/ # Scan reports directory ├── scanner/ │ ├── __init__.py │ ├── config.py # Configuration manager │ ├── friendly_scan.py # Friendly scan utilities │ ├── info_gathering.py # Layer 1: Information gathering │ ├── vulnerability_scanner.py # Layer 2: Vulnerability detection │ ├── config_checker.py # Layer 3: Configuration check │ ├── sensitive_info.py # Layer 4: Sensitive info detection │ ├── progress_bar.py # Progress bar utility │ ├── fix_suggestions.py # Fix suggestions database │ └── data/ │ ├── directories.txt # Directory wordlist │ └── sensitive_files.txt # Sensitive files list └── test_server/ └── app.py # Test server application ``` --- ## 📝 Example Report Output ```json { "scan_time": "2024-01-15 10:30:00", "target": "http://localhost:5000", "total_vulnerabilities": 3, "vulnerabilities": [ { "type": "Path Traversal", "url": "http://localhost:5000/file-view", "parameter": "file", "payload": "../../etc/passwd", "severity": "High", "suggestion": "Use path normalization and validate user input against a whitelist of allowed paths." } ], "scan_summary": { "layer_1_completed": true, "layer_2_completed": true, "layer_3_completed": true, "layer_4_completed": true, "total_time": "2 minutes 30 seconds" } } ``` --- ## 🔗 OpenClaw Platform Integration This tool provides a **skill interface** for the OpenClaw platform, allowing seamless integration with OpenClaw's ecosystem. ### Skill Information | Attribute | Value | | -------------- | -------------------------------------------------------------------- | | **Skill Name** | `openclaw` | | **Skill Path** | `.trae/skills/openclaw/SKILL.md` | | **Purpose** | Provides website security scanning capabilities to OpenClaw platform | ### Integration Details The `openclaw` skill serves as a **bridge** between this standalone security scanner and the OpenClaw platform: 1. **Skill Structure**: ``` .trae/ └── skills/ └── openclaw/ └── SKILL.md ``` 2. **Skill Description**: ```markdown --- name: "openclaw" description: "Website Security Scanner Skill - Provides an interface for OpenClaw platform to invoke a standalone website security scanning tool." --- ``` 3. **Invocation**: - The OpenClaw platform can invoke this skill when users request website security scanning - The skill calls the underlying scanner programmatically - Results are returned to the OpenClaw platform for presentation ### Usage via OpenClaw When this tool is integrated with OpenClaw: - Users can request website security scans through the OpenClaw interface - The platform automatically invokes this tool's scanning capabilities - Scan results are displayed within the OpenClaw platform interface **Note**: This tool remains fully functional as a standalone application and does not require OpenClaw to operate. --- ## 🔗 Hermes Platform Integration This tool also provides a **skill interface** for the Hermes platform, allowing seamless integration with Hermes' ecosystem. ### Skill Information | Attribute | Value | | -------------- | ------------------------------------------------------------------ | | **Skill Name** | `hermes` | | **Skill Path** | `.trae/skills/hermes/SKILL.md` | | **Purpose** | Provides website security scanning capabilities to Hermes platform | ### Integration Details The `hermes` skill serves as a **bridge** between this standalone security scanner and the Hermes platform: 1. **Skill Structure**: ``` .trae/ └── skills/ └── hermes/ └── SKILL.md ``` 2. **Skill Description**: ```markdown --- name: "hermes" description: "Website Security Scanner Skill - Provides an interface for Hermes platform to invoke a standalone website security scanning tool." --- ``` 3. **Invocation**: - The Hermes platform can invoke this skill when users request website security scanning - The skill calls the underlying scanner programmatically - Results are returned to the Hermes platform for presentation ### Usage via Hermes When this tool is integrated with Hermes: - Users can request website security scans through the Hermes interface - The platform automatically invokes this tool's scanning capabilities - Scan results are displayed within the Hermes platform interface **Note**: This tool remains fully functional as a standalone application and does not require Hermes to operate. --- ## ⚠️ Legal Warning **IMPORTANT:** Only scan websites you own or have **explicit written permission** to test. Unauthorized scanning of websites may violate laws in your country or region, including the Computer Fraud and Abuse Act (CFAA) in the United States. This tool is intended for **ethical security testing** and **educational purposes** only. The authors are not responsible for any misuse or damage caused by this tool. --- ## 📄 License MIT License - See LICENSE file for details. --- ## 🤝 Contributing Contributions are welcome! Please feel free to submit issues and pull requests. --- **Disclaimer:** This tool is for educational purposes only. Always obtain proper authorization before scanning any system.