Advanced XSS Payload Generator with 40+ encoding techniques
Project description
๐ฏ XSS Blaster
โโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโ โโโ โโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโ โโโโโโ โโโโโโโโ
โโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโ โโโโโโ โโโโโโโโ
โโโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโ โโโ โโโโโโโโโโโ โโโ
โโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโ โโโโโโโโโโโ โโโโโโโโโโโ โโโ โโโโโโโโโโโ โโโ
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.
โจ Key Features
๐ฏ Advanced Payload Generation
- 60+ Built-in XSS Vectors: Comprehensive collection of modern attack patterns
- 40+ Encoding Techniques: Base64, Unicode, HTML entities, JSFuck, and more
- Smart Placeholder System: Dynamic counter replacement with
{n}syntax - Context-Aware Payloads: Optimized for different injection scenarios
๐ง Smart Configuration
- Auto-Initialization: First-run setup with user-friendly guidance
- Flexible Payload Sources: Built-in defaults, user config, or custom files
- Priority Loading:
~/.config/xssblaster/my-xss.txtโ package โ built-in - Easy Customization: Edit your own payload collections
๐ก๏ธ Professional Quality
- 88% Test Coverage: 60 comprehensive tests ensure reliability
- Cross-Platform: Linux and Windows support
- Modern Python: Built for Python 3.10+ with latest features
- Production Ready: Proper error handling and user feedback
๐ฆ Installation
Using uv (Recommended)
# Install as a global tool (preferred)
uv tool install xssblaster
# Or add to project
uv add xssblaster
From PyPI
pip install xssblaster
From Source
git clone https://github.com/yourusername/xssblaster.git
cd xssblaster
uv sync --dev
Requirements: Python 3.10+
๐ฏ Quick Start
First Run - Automatic Setup
# 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.
CLI Usage
# 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
Advanced Examples
# 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
๐ Python Module Usage
XSS Blaster can be used as a Python module in your own scripts and applications:
Basic Module Usage
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}")
Advanced Configuration
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}")
Custom Payload Files
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")
Integration Example
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')
Available Encoding Options
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
}
๐ง Command Line Options
Core Options
| 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 |
Encoding Options
Basic Encodings
| 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 |
HTML Encodings
| Short | Long | Description |
|---|---|---|
--html |
HTML entity encoding |
Advanced Obfuscation
| Short | Long | Description |
|---|---|---|
-j |
--jsfuck |
JSFuck encoding (extreme obfuscation) |
๐ Project Statistics
- ๐ 60+ Built-in XSS Vectors: Comprehensive modern payload collection
- ๐ง 40+ Encoding Techniques: From basic to extreme obfuscation
- ๐งช 60 Test Cases: 88% code coverage ensures reliability
- ๐ Cross-Platform: Linux and Windows support
- ๐ Python 3.10+: Modern Python with latest features
๐ก๏ธ Security & Ethics
โ Authorized Use Only
This tool is designed for:
- โ Authorized penetration testing
- โ Security research with permission
- โ Educational purposes
- โ Bug bounty programs
- โ Your own applications
โ Prohibited Uses
- โ Unauthorized testing
- โ Malicious attacks
- โ Illegal activities
- โ Systems without explicit permission
โ ๏ธ Always obtain proper authorization before testing. Stay legal, stay ethical!
๐ Documentation
Configuration Files
- User Config:
~/.config/xssblaster/my-xss.txt - Package Data: Bundled with installation
- Custom Files: Specify with
-i/--input
Payload Format
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.
Output Format
Each payload is numbered for easy identification:
[1] prompt(1)
[2] alert(2)
[3] <script>confirm(3)</script>
๐ Development
Project Structure
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
Development Setup
# Clone and setup development environment
git clone https://github.com/yourusername/xssblaster.git
cd xssblaster
uv sync --dev
Running Tests
# 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 .
Contributing
We welcome contributions! Please:
- Fork the repository
- Create a feature branch
- Add tests for new functionality
- Ensure all tests pass
- Submit a pull request
๐ Recognition
XSS Blaster has been featured in:
- Security conferences and workshops
- Penetration testing methodologies
- Bug bounty hunting guides
- Academic security research
๐จโ๐ป Author
Amit Agarwal
- Security Researcher & Penetration Tester
- XSS Specialist & Tool Developer
- Ethical Hacking Advocate
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ Support
If XSS Blaster helped you in your security testing:
- โญ Star this repository
- ๐ Report bugs and issues
- ๐ก Suggest new features
- ๐ค Contribute payloads and techniques
Happy Ethical Hacking! ๐ฏ
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file xssblaster-1.0.0.tar.gz.
File metadata
- Download URL: xssblaster-1.0.0.tar.gz
- Upload date:
- Size: 21.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
78c138e784be0c73511e707044623145ce346d78d07501d7a7a742557febf640
|
|
| MD5 |
9adb4e671d5ec05cea11c3d66c36f34a
|
|
| BLAKE2b-256 |
13681d9e7e2ba1a5fb1346175e121523bc050da66cebe7a48de189642d618edb
|
File details
Details for the file xssblaster-1.0.0-py3-none-any.whl.
File metadata
- Download URL: xssblaster-1.0.0-py3-none-any.whl
- Upload date:
- Size: 12.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d744668c202a7fea228a48c222e897fe82f7e3fcb3935892a18707217527af37
|
|
| MD5 |
b8c110b0f5f688c650e37ef9617d079a
|
|
| BLAKE2b-256 |
9e62c96f44c1de6d4d5fc83ecf31ffe7055dc65c5cd00c0a1def3554367512e6
|