Dark web HTML pages can contain various types of malicious code that could harm your system:
-
JavaScript Malware - Executable code that can:
- Steal browser data and cookies
- Download additional malware
- Execute system commands
- Install keyloggers
- Run cryptominers
- Steal cryptocurrency wallets
-
HTML Injection Attacks - Malicious scripts embedded in HTML
-
Drive-by Downloads - Automatic malware downloads
-
Cross-Site Scripting (XSS) - Malicious scripts
-
Data Exfiltration - Stealing system information
-
Encoded Malware - Base64, URL-encoded, or hex-encoded malicious content
The tool now includes a comprehensive security scanner that:
- JavaScript execution (
<script>,eval(),exec()) - Suspicious URLs (
javascript:,data:,file://) - Event handlers (
onload,onclick,onerror) - Encoded content (Base64, URL-encoded, hex)
- Suspicious attributes and iframes
- Removes all
<script>tags - Removes all
<iframe>,<object>,<embed>tags - Strips event handlers (
on*attributes) - Removes encoded malicious content
- Creates safe copies in
data/safe_files/
- Maximum file size: 10MB
- Prevents processing of suspiciously large files
Original File β Security Scan β Threat Detection β Sanitization β Safe Processing
# Security scanning is enabled by default
python src/main.py
# To disable security scanning (NOT RECOMMENDED)
# Edit src/main.py and set: ENABLE_SECURITY_SCAN = False- Upload HTML files
- Security scanning is enabled by default
- View security reports in expandable sections
- Download sanitized versions automatically
python test_security_scanner.pyENABLE_SECURITY_SCAN = True # β
RECOMMENDED
ENABLE_SECURITY_SCAN = False # β DANGEROUS- Run in a virtual machine
- Use containerized environment
- Isolate from production systems
- Only process files from trusted sources
- Verify file integrity with hashes
- Keep original files separate from processed files
- Update dependencies regularly
- Monitor for new threat patterns
- Keep security scanner updated
<script>
alert('This is malicious!');
eval('alert("More malicious code")');
document.location = 'javascript:alert("XSS")';
</script><!-- Base64 encoded -->
<script>eval(atob('YWxlcnQoIk1hbGljaW91cyBjb250ZW50ISIp'))</script>
<!-- URL encoded -->
<p>%3Cscript%3Ealert('XSS')%3C/script%3E</p>
<!-- Hex encoded -->
<p>\x3Cscript\x3Ealert('XSS')\x3C/script\x3E</p><img src="x" onerror="alert('XSS via onerror')">
<a href="javascript:alert('XSS via href')">Click me</a>The tool generates detailed security reports showing:
- Threat Detection: Number and types of threats found
- File Statistics: Original vs sanitized file sizes
- Sanitization Results: What was removed/cleaned
- Safety Status: Whether file is safe to process
π SECURITY SCAN REPORT
File: malicious_test.html
Safe: β NO
Threats Detected: 3
π¨ THREATS FOUND:
1. javascript_execution: 3 matches found
2. suspicious_attributes: 2 matches found
3. Encoded content detected: 1 instances
π STATISTICS:
Original size: 1250 characters
Sanitized size: 450 characters
Size reduction: 800 characters
- Check file size - Suspiciously large files may contain malware
- Verify source - Only process files from trusted sources
- Check file type - Ensure files are actually HTML
- Scan with antivirus - Use additional security tools
- Review security reports - Check what threats were detected
- Verify sanitized files - Ensure malicious content was removed
- Monitor system - Watch for unusual activity
- Clean up - Remove original files if no longer needed
- The security scanner provides protection but cannot guarantee 100% safety
- New malware variants may not be detected immediately
- Always use additional security measures
- Processing dark web content inherently carries risks
- The tool is designed for forensic analysis, not general web browsing
- Always use in isolated environments
- Stop processing immediately
- Isolate the system - Disconnect from network
- Scan with antivirus - Use multiple tools
- Check system integrity - Monitor for unusual activity
- Report incidents - Document what happened
- Disconnect from network
- Take system snapshot - For forensic analysis
- Contact IT security - If in organizational environment
- Consider system reimage - If necessary
- Monitor GitHub for security updates
- Update dependencies regularly
- Report new threat patterns
- Check security reports for details
- Review logs for error messages
- Test with known safe files first