Webscreenshot
Webscreenshot is a Python-based tool that captures web application screenshots using available rendering engines (Selenium, PhantomJS, CasperJS). It supports batch processing of URL lists with various output formats.
Installation
Linux/Ubuntu
# Install Python and dependencies
sudo apt update
sudo apt install python3 python3-pip git
# Clone repository
git clone https://github.com/maaaaz/webscreenshot.git
cd webscreenshot
# Install requirements
pip3 install -r requirements.txt
# Install browser drivers
sudo apt install firefox geckodriver
macOS
# Install with Homebrew
brew install python3
# Clone and setup
git clone https://github.com/maaaaz/webscreenshot.git
cd webscreenshot
# Install requirements
pip3 install -r requirements.txt
Rendering Engines
# Install Firefox (recommended)
sudo apt install firefox-geckodriver
# Or Chrome/Chromium
sudo apt install chromium-browser
# Optional: PhantomJS (deprecated but supported)
wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2
tar -xjf phantomjs-2.1.1-linux-x86_64.tar.bz2
sudo mv phantomjs-2.1.1-linux-x86_64/bin/phantomjs /usr/local/bin/
Basic Usage
# Single URL
python3 webscreenshot.py -u http://example.com
# Multiple URLs from file
python3 webscreenshot.py -l urls.txt
# With custom output directory
python3 webscreenshot.py -l urls.txt -o ./screenshots
# Show help
python3 webscreenshot.py -h
Input Methods
Single URL
# HTTP
python3 webscreenshot.py -u http://example.com
# HTTPS with custom port
python3 webscreenshot.py -u https://example.com:8443
# With credentials
python3 webscreenshot.py -u "http://user:pass@example.com"
URL List File
# Create URL list
cat > targets.txt << EOF
http://10.0.0.1
http://10.0.0.2:8080
https://10.0.0.3
http://10.0.0.4:3000
EOF
# Process list
python3 webscreenshot.py -l targets.txt -o results/
# With error logging
python3 webscreenshot.py -l targets.txt -o results/ > scan.log 2>&1
CIDR Range Input
# Scan IP range with default ports (80, 443)
python3 webscreenshot.py --cidr 192.168.1.0/24
# Specify custom ports
python3 webscreenshot.py --cidr 10.0.0.0/24 -p 8080,8443
# With timeout
python3 webscreenshot.py --cidr 172.16.0.0/16 -t 10
Rendering Engines
Firefox/Selenium
# Use Firefox (default)
python3 webscreenshot.py -l urls.txt
# Headless mode
python3 webscreenshot.py -l urls.txt --headless
# With window size
python3 webscreenshot.py -l urls.txt --window-size 1920x1080
Chrome/Chromium
# Use Chrome
python3 webscreenshot.py -l urls.txt --chrome
# Chrome headless
python3 webscreenshot.py -l urls.txt --chrome --headless
# Mobile emulation
python3 webscreenshot.py -l urls.txt --chrome --mobile
PhantomJS (Legacy)
# Use PhantomJS
python3 webscreenshot.py -l urls.txt --phantomjs
# With custom script
python3 webscreenshot.py -l urls.txt --phantomjs --script custom.js
Output Options
Screenshot Formats
# PNG (default)
python3 webscreenshot.py -l urls.txt
# PDF output
python3 webscreenshot.py -l urls.txt -f pdf
# HTML (page source)
python3 webscreenshot.py -l urls.txt -f html
# Multiple formats
python3 webscreenshot.py -l urls.txt -f png,pdf,html
Naming Convention
# Default naming
# Output: http__example.com.png
# Custom prefix
python3 webscreenshot.py -l urls.txt --prefix "site_"
# Output: site_1.png, site_2.png
# Full URL in filename
python3 webscreenshot.py -l urls.txt --full-path
# Output: http___example.com_8080.png
Directory Organization
# Specify output directory
python3 webscreenshot.py -l urls.txt -o /path/to/output
# Create subdirectories by domain
python3 webscreenshot.py -l urls.txt -o results/ --organize-by-domain
# By status code
python3 webscreenshot.py -l urls.txt -o results/ --organize-by-status
Advanced Options
Performance Configuration
# Number of parallel threads
python3 webscreenshot.py -l urls.txt -w 10
# Timeout per screenshot (seconds)
python3 webscreenshot.py -l urls.txt -t 15
# Request timeout
python3 webscreenshot.py -l urls.txt --request-timeout 20
Security Options
# Ignore SSL certificate errors
python3 webscreenshot.py -l urls.txt --no-verify-ssl
# Custom user agent
python3 webscreenshot.py -l urls.txt --user-agent "Mozilla/5.0..."
# Use proxy
python3 webscreenshot.py -l urls.txt --proxy http://proxy.example.com:8080
# Proxy with authentication
python3 webscreenshot.py -l urls.txt --proxy http://user:pass@proxy:8080
Advanced Rendering
# Wait for JavaScript to load
python3 webscreenshot.py -l urls.txt --wait-for-load
# Disable JavaScript
python3 webscreenshot.py -l urls.txt --disable-javascript
# Wait for specific element
python3 webscreenshot.py -l urls.txt --wait-for-selector "#content"
# Page load timeout
python3 webscreenshot.py -l urls.txt --page-load-timeout 30
Batch Processing Workflows
Network Reconnaissance
# 1. Discover targets with Nmap
nmap -sV -p 80,443,8000-8100 --oX targets.xml 192.168.1.0/24
# 2. Extract URLs from Nmap
grep -o '<extraports[^>]*>' targets.xml | wc -l
# 3. Generate URL list manually or automatically
cat > urls.txt << EOF
http://192.168.1.100
http://192.168.1.101:8080
https://192.168.1.102:8443
EOF
# 4. Screenshot with webscreenshot
python3 webscreenshot.py -l urls.txt -o screenshots/ -w 20
Cloud Infrastructure Scanning
# Target cloud services
cat > cloud_targets.txt << EOF
http://api-server:8000
http://admin-panel:9000
https://secure-service:443
http://db-interface:8888
EOF
python3 webscreenshot.py \
-l cloud_targets.txt \
-o cloud_screenshots \
--no-verify-ssl \
-w 15
Web Application Testing
# Screenshot multiple versions/instances
cat > web_apps.txt << EOF
http://dev.app.local
http://staging.app.local
http://prod.app.local
http://app.internal:3000
EOF
python3 webscreenshot.py \
-l web_apps.txt \
-o app_screenshots \
--window-size 1920x1080 \
--headless
Complete Scanning Script
#!/bin/bash
# Comprehensive web scanning with webscreenshot
OUTPUT_DIR="screenshots_$(date +%Y%m%d_%H%M%S)"
THREADS=10
TIMEOUT=10
# Configuration
TARGETS=(
"http://192.168.1.1"
"http://192.168.1.2:8080"
"https://192.168.1.3"
)
# Generate target list
for target in "${TARGETS[@]}"; do
echo "$target" >> targets.txt
done
# Run webscreenshot
echo "[*] Starting web screenshot scanning..."
python3 webscreenshot.py \
-l targets.txt \
-o $OUTPUT_DIR \
-w $THREADS \
-t $TIMEOUT \
--no-verify-ssl \
--headless
# Statistics
echo "[+] Scan complete!"
echo "Results: $OUTPUT_DIR"
echo "Total screenshots: $(ls -1 $OUTPUT_DIR | wc -l)"
# List results
ls -lh $OUTPUT_DIR/
Header Extraction
# Extract and save HTTP headers
python3 webscreenshot.py -l urls.txt --save-headers
# Parse captured headers
grep -r "Server:" results/ | sort | uniq -c
# Identify technologies
grep -r "X-Powered-By:" results/ | cut -d: -f2 | sort | uniq -c
Error Handling
# Verbose output
python3 webscreenshot.py -l urls.txt -v
# Debug mode
python3 webscreenshot.py -l urls.txt --debug
# Skip failed URLs
python3 webscreenshot.py -l urls.txt --skip-failed
# Log errors to file
python3 webscreenshot.py -l urls.txt --error-log errors.txt
Troubleshooting
Issue: Firefox not found
# Install Firefox
sudo apt install firefox
# Verify installation
which firefox
firefox --version
Issue: GeckoDriver not in PATH
# Install geckodriver
sudo apt install firefox-geckodriver
# Or download manually
wget https://github.com/mozilla/geckodriver/releases/download/v0.33.0/geckodriver-v0.33.0-linux64.tar.gz
tar -xzf geckodriver-*.tar.gz
sudo mv geckodriver /usr/local/bin/
Issue: Timeout on slow applications
# Increase timeout
python3 webscreenshot.py -l urls.txt -t 30
# Increase request timeout
python3 webscreenshot.py -l urls.txt --request-timeout 45
Issue: SSL certificate errors
# Ignore SSL verification
python3 webscreenshot.py -l urls.txt --no-verify-ssl
Comparison: Webscreenshot vs EyeWitness
| Feature | Webscreenshot | EyeWitness |
|---|---|---|
| URL input | Single, list, CIDR | Single, list, Nmap |
| Rendering engines | Firefox, Chrome, PhantomJS | Firefox, Chrome |
| Output formats | PNG, PDF, HTML | PNG with report |
| Report generation | Basic | Comprehensive |
| Speed | Faster | Moderate |
| Features | Simple, lightweight | Full-featured |
Performance Tips
- Use multiple threads (-w flag) for large scans
- Specify appropriate timeout values
- Use headless mode for speed
- Organize output by directory
- Clean up old screenshots regularly
Last updated: 2026-03-30 | Webscreenshot v1.4