Skill: wodtianhao/url-security-scanner (version 1.0.0)

--- name: url-security-scanner description: Comprehensive URL security scanner that checks SSL/TLS certificates, HSTS, CSP headers, sensitive information leaks, open ports, service versions, privacy policy links, and unauthorized access. Use when you need to scan a list of URLs for security compliance and vulnerabilities. --- # URL Security Scanner A comprehensive security scanner for URL lists that performs multiple security checks and generates detailed reports. ## Features ### 1. SSL/TLS Certificate Analysis - Certificate validity period - Issuer information - Certificate chain validation - TLS protocol versions supported ### 2. Security Headers Check - HSTS (HTTP Strict Transport Security) - CSP (Content Security Policy) - X-Frame-Options - X-Content-Type-Options - Referrer-Policy ### 3. Information Leak Detection - API keys in JavaScript/CSS files - Email addresses in source code - Sensitive paths and endpoints - Version information disclosure ### 4. Port Scanning - Common vulnerable ports (22, 3306, 8080, etc.) - Service banner grabbing - Open port detection ### 5. Service Identification - Web server versions (Nginx, Apache, IIS) - Application frameworks - Programming language detection ### 6. Privacy Compliance - Privacy policy link detection - Terms of service links - Cookie policy compliance ### 7. Unauthorized Access Testing - Common admin paths (/admin, /wp-admin, etc.) - Default credentials testing - Directory traversal attempts ## Quick Start ### Basic Usage ```bash # Scan URLs from a file python url_security_scanner.py --file urls.txt # Scan single URL python url_security_scanner.py --url https://example.com # Custom output format python url_security_scanner.py --file urls.txt --output csv ``` ### Advanced Options ```bash # Specify ports to scan python url_security_scanner.py --file urls.txt --ports 22,80,443,3306,8080 # Enable aggressive scanning python url_security_scanner.py --file urls.txt --aggressive # Set timeout and retry options python url_security_scanner.py --file urls.txt --timeout 10 --retries 3 ``` ## Installation ### Python Dependencies ```bash pip install requests beautifulsoup4 python-whois sslscan ``` ### Required Tools - nmap (for port scanning) - sslscan (for SSL/TLS analysis) - nuclei (for vulnerability scanning) - optional ## Usage Examples ### Example 1: Basic URL Scan ```python from url_security_scanner import URLSecurityScanner scanner = URLSecurityScanner() results = scanner.scan_urls_from_file('urls.txt') scanner.generate_report(results, 'security_report.md') ``` ### Example 2: Custom Configuration ```python from url_security_scanner import URLSecurityScanner config = { 'timeout': 15, 'user_agent': 'Mozilla/5.0 (Security Scanner)', 'check_ports': [22, 80, 443, 3306, 8080, 8443], 'admin_paths': ['/admin', '/wp-admin', '/administrator', '/backend'], 'aggressive_mode': False } scanner = URLSecurityScanner(config) results = scanner.scan_url('https://example.com') ``` ### Example 3: Batch Processing ```bash # Process multiple URL files for file in urls_*.txt; do python url_security_scanner.py --file "$file" --output "report_${file%.txt}.md" done ``` ## Output Formats ### 1. Markdown Report ```markdown # Security Scan Report ## Target: https://example.com ### SSL/TLS Status - ✅ Certificate valid until: 2024-12-31 - ✅ HSTS enabled: Yes - ⚠️ CSP header missing ### Port Scan Results - ✅ 443/tcp open (HTTPS) - ❌ 22/tcp open (SSH - should be restricted) - ✅ 80/tcp open (HTTP) ### Security Findings - 🔍 Found potential API key in JavaScript file - ✅ Privacy policy link found - ❌ Admin panel accessible without authentication ``` ### 2. CSV Export ```csv URL,SSL_Valid,HSTS_Enabled,CSP_Present,Open_Ports,Admin_Access,Privacy_Link,Risk_Level https://example.com,Yes,Yes,No,"443,80",Yes,Yes,Medium ``` ### 3. JSON Output ```json { "target": "https://example.com", "scan_timestamp": "2024-01-15T10:30:00Z", "ssl": { "valid": true, "expires": "2024-12-31", "issuer": "Let's Encrypt" }, "security_headers": { "hsts": true, "csp": false, "x_frame_options": true }, "ports": [ {"port": 443, "status": "open", "service": "https"}, {"port": 22, "status": "open", "service": "ssh"} ], "findings": [ {"type": "information_leak", "severity": "medium", "description": "API key found in JS file"} ] } ``` ## Integration with Existing Tools ### Use with nmap ```bash # Extract domains from scan results nmap -sL -n SUBNET | grep "Nmap scan report" | awk '{print $5}' > urls.txt python url_security_scanner.py --file urls.txt ``` ### Use with nuclei ```bash # First scan with URL security scanner python url_security_scanner.py --file urls.txt --output json # Then run nuclei on vulnerable targets nuclei -l vulnerable_urls.txt -t cves/ -t exposures/ ``` ## Best Practices ### 1. Rate Limiting - Add delays between requests to avoid overwhelming targets - Respect robots.txt and rate limit headers - Use rotating user agents if needed ### 2. Error Handling - Implement retry logic for transient failures - Log errors for debugging - Continue scanning other URLs if one fails ### 3. Reporting - Include timestamp and scanner version in reports - Categorize findings by severity - Provide actionable recommendations - Include false positive notes ### 4. Compliance - Only scan authorized targets - Obtain proper permissions - Follow responsible disclosure practices - Respect privacy and data protection laws ## Configuration File Create `config.yaml` for persistent settings: ```yaml scanner: timeout: 10 user_agent: "SecurityScanner/1.0" max_retries: 3 security: check_ports: [22, 80, 443, 3306, 8080, 8443] admin_paths: - /admin - /wp-admin - /administrator - /backend - /manage output: default_format: markdown include_timestamp: true severity_colors: true notifications: webhook_url: "" email_alerts: false ``` ## Troubleshooting ### Common Issues 1. **SSL Certificate Errors** ```bash # Disable SSL verification (not recommended for production) python url_security_scanner.py --file urls.txt --no-ssl-verify ``` 2. **Timeout Issues** ```bash # Increase timeout python url_security_scanner.py --file urls.txt --timeout 30 ``` 3. **Port Scanning Blocked** ```bash # Use less aggressive scanning python url_security_scanner.py --file urls.txt --stealth ``` ## License This tool is for authorized security testing only. Users are responsible for complying with all applicable laws and regulations.

path: requirements.txt
content: requests>=2.28.0
beautifulsoup4>=4.11.0
lxml>=4.9.0
python-whois>=0.8.0

Security scan verdicts — ClawScan: suspicious | static analysis: malicious | VirusTotal: suspicious | SkillSpector:  ()