A modular security scanning toolkit. Applying concepts learned in SEC542: Web App Penetration Testing and Ethical Hacking.
- requests + BeautifulSoup (basic discovery)
- Typer CLI with organized modes/ directory
- Async DAST (Playwright + asyncio) with basic test suite
py-scan/
├── main.py # CLI entry point
├── modes/ # Scanning modules
│ ├── scanner.py # Web discovery
│ ├── web_check.py # Security headers
│ ├── forensics.py # EXIF & PII analysis
│ ├── dns_recon.py # DNS reconnaissance
│ ├── port_scanner.py # TCP port scanning
│ ├── brute.py # SSH Brute force
│ ├── network.py # Packet crafting (scapy)
│ └── engine.py # Async DAST engine (playwright)
└── tests/ # Test suite
- Create virtual environment:
python3 -m venv .venv
- Initialize virtual environment:
source .venv/bin/activate
- Install packages:
pip install .
- Scan for links/forms:
python3 main.py scan https://www.scrapethissite.com/pages/forms/
- Check security headers/files:
python3 main.py test-web https://www.scrapethissite.com/pages/forms/
- Resolve DNS records:
python3 main.py dns google.com
- Scan common TCP ports:
python3 main.py scan-ports 127.0.0.1
May need to re-run the setup commands with sudo for this to work.
- Ping target with ICMP:
sudo python3 main.py ping 8.8.8.8
- TCP SYN scan (raw sockets):
sudo python3 main.py syn-scan 192.168.1.1
- Craft custom packet:
sudo python3 main.py craft "IP(dst='8.8.8.8')/ICMP()"sudo python3 main.py craft "IP(dst='1.1.1.1')/TCP(dport=80)"
Security Warning: Only use on systems you own or have explicit permission to test
-
SSH brute force:
python3 main.py brute-ssh 192.168.1.10 data/users.txt data/pass.txt --delay 1 --stop-on-success
-
SMB brute force:
python3 main.py brute-smb 192.168.1.10 data/users.txt data/pass.txt --delay 0.5
-
Generate wordlist:
python3 main.py wordlist "admin,root,user" output.txt --patterns "123,\!,2024"
-
Quick service reconnaissance:
python3 main.py quick-check-services 192.168.1.10
Uses Playwright for browser automation - scans JavaScript-heavy applications
- Run DAST scan (async crawling with XSS detection):
python3 main.py dast https://example.compython3 main.py dast https://example.com --depth 3 --workers 5 --headless falsepython3 main.py dast https://example.com --max-pages 100 --output-dir ./scan-results
Generates HTML report with findings. Report includes:
- XSS vulnerabilities (reflected, DOM-based, stored)
- Full page HTML capture for evidence
- Screenshots of vulnerable pages
- Severity classifications (Critical, High, Medium, Low)
- Extract EXIF data:
python3 main.py forensics exif assets/test-img-1.jpgpython3 main.py forensics exif assets/test-img-2.jpg
- Scan for PII:
python3 main.py forensics pii assets/test-txt-1.txtpython3 main.py forensics pii assets/test-txt-2.txt
- Extract strings from binary:
python3 main.py forensics strings assets/test-img-1.jpg | headpython3 main.py forensics strings assets/test-img-2.jpg | head
- Install development dependencies:
pip install -e ".[dev]"
- Run quality checks (linting, types, tests):
- ``./scripts/check.sh`
- Auto-format code:
- ``./scripts/format.sh`
- Run specific test modules:
pytest tests/test_dns.pyorpytest tests/test_ports.py...
Note: All code should pass
./scripts/check.shbefore being committed.
- Pre-commit hooks for ruff, mypy, and pytest
- Enhanced DAST patterns for additional vulnerability classes
- Functional directory reorganization (web/, network/, forensics/, exploit/)