Advanced Web Vulnerability Scanner (XSS-focused)
A lightweight, Selenium-backed XSS testing utility that injects payloads into query parameters, path segments and fragments (optionally), validates the result using a real browser (Chrome via Chromedriver), and can send Telegram alerts when an alert() popup is triggered.
⚠️ IMPORTANT — Legal & Ethical NoticeThis tool is intended for use on systems you own or have explicit permission to test. Unauthorized scanning or exploitation of websites is illegal and unethical. Always obtain written permission before testing third-party systems.
PAYLOADplaceholder substitution in target URLs- Parameter injection (query string)
- Optional path / fragment injection (
--path) - Real browser validation using Selenium + ChromeDriver (headless by default)
- Optional Telegram alerting for confirmed XSS with basic URL encoding
- Multi-threaded scanning using Python
concurrent.futures - Pretty console output with
richand colored status viacolorama
- Python 3.8+
- Google Chrome (matching your Chromedriver version)
- Chromedriver (binary accessible by the script)
Python packages (install via pip):
pip install selenium requests colorama richxss_hunter_pro.py— main scanner script (the code you provided)payloads.txt— newline-delimited list of XSS payloads (example below)targets.txt— optional, newline-delimited list of target URLs. URLs may contain the literalPAYLOADplaceholder.
'";alert(1);//
"><img src=x onerror=alert(1)>
<script>confirm(1)</script>
(Use a curated list appropriate to your targets.)
Basic usage (single URL):
python xss_hunter_pro.py --url "https://example.com/search?q=PAYLOAD" --payload payloads.txtUsing a file with multiple targets:
python xss_hunter_pro.py --url targets.txt --payload payloads.txtEnable path / fragment injection (when PAYLOAD placeholder is not present):
python xss_hunter_pro.py --url targets.txt --payload payloads.txt --pathChange number of concurrent threads (default 10):
python xss_hunter_pro.py --url targets.txt --payload payloads.txt --thread 20-
Chromedriver path: The script uses
Service('./chromedriver')by default. Either place thechromedriverbinary in the same folder, or modify theService()path insetup_browser()to point to the binary location on your machine. -
Headless toggle: The script configures Chrome to run headless. If you want to debug visually, remove or comment out
chrome_options.add_argument("--headless")insetup_browser(). -
Timeouts: HTTP requests use a short timeout (
requests.get(..., timeout=5)) and Selenium waits for an alert with 5 seconds. Increase these values if you target slow hosts or complex pages. -
Telegram: Replace
your_telegram_BOT_IDandyour_CHAT_IDin the script with your bot token and chat id to enable notifications. The script encodes some characters for URL-safe Telegram messages but keep in mind very long URLs or special characters may still needurllib.parse.quote_plus()for robust encoding. -
Resource usage: Running many concurrent Selenium-driven browser instances is resource-heavy. Consider lowering
--threador using a single driver cycle per thread if system memory/CPU is limited.
- Add randomized
User-Agentstrings and request headers for HTTP request pre-checks. - Reuse browser instances per thread (pool of drivers) rather than creating a new Chrome process for every test case to reduce overhead.
- Add more robust Telegram encoding using
urllib.parse.quote_plus()and send additional context (payload, param name, snapshot link). - Add logging to a file (CSV/JSON) with discovered issues, timestamps, and response snapshots.
- Provide an option to take screenshots of successful pages for manual triage.
- Add integration with Burp/OWASP ZAP for deeper analysis.
- Confirm you have explicit permission to test the targets.
- Ensure Chromedriver version matches your installed Chrome browser.
- Test a single URL locally to confirm Selenium and Chromedriver are working.
- Adjust timeouts and thread count to match target performance and your machine capacity.
Feel free to fork and improve this repo. Add an appropriate OSS license (MIT/Apache-2.0) depending on how you want to distribute it.
If you'd like, I can also:
- Generate a
requirements.txtfor you - Produce a sample
payloads.txtwith a curated list - Convert the script into a more efficient worker-pool that reuses browser instances
Tell me which of these you want next and I will prepare it.