Skip to main content

Advanced XSS Payload Generator with 40+ encoding techniques

Project description

๐ŸŽฏ XSS Blaster

โ–ˆโ–ˆโ•—  โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—    โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•—      โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— 
โ•šโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ•โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ•    โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘     โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ•โ•šโ•โ•โ–ˆโ–ˆโ•”โ•โ•โ•โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ•โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—
 โ•šโ–ˆโ–ˆโ–ˆโ•”โ• โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—    โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ•‘     โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—   โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—  โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•
 โ–ˆโ–ˆโ•”โ–ˆโ–ˆโ•— โ•šโ•โ•โ•โ•โ–ˆโ–ˆโ•‘โ•šโ•โ•โ•โ•โ–ˆโ–ˆโ•‘    โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘     โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•‘โ•šโ•โ•โ•โ•โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•”โ•โ•โ•  โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—
โ–ˆโ–ˆโ•”โ• โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘    โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘  โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘  โ–ˆโ–ˆโ•‘
โ•šโ•โ•  โ•šโ•โ•โ•šโ•โ•โ•โ•โ•โ•โ•โ•šโ•โ•โ•โ•โ•โ•โ•    โ•šโ•โ•โ•โ•โ•โ• โ•šโ•โ•โ•โ•โ•โ•โ•โ•šโ•โ•  โ•šโ•โ•โ•šโ•โ•โ•โ•โ•โ•โ•   โ•šโ•โ•   โ•šโ•โ•โ•โ•โ•โ•โ•โ•šโ•โ•  โ•šโ•โ•

Advanced XSS Payload Generator with 40+ Encoding Techniques

Python 3.10+ License: MIT Tests Coverage

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 (&#65;)
    
    # 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:

  1. Fork the repository
  2. Create a feature branch
  3. Add tests for new functionality
  4. Ensure all tests pass
  5. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xssblaster-1.0.0.tar.gz (21.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

xssblaster-1.0.0-py3-none-any.whl (12.2 kB view details)

Uploaded Python 3

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

Hashes for xssblaster-1.0.0.tar.gz
Algorithm Hash digest
SHA256 78c138e784be0c73511e707044623145ce346d78d07501d7a7a742557febf640
MD5 9adb4e671d5ec05cea11c3d66c36f34a
BLAKE2b-256 13681d9e7e2ba1a5fb1346175e121523bc050da66cebe7a48de189642d618edb

See more details on using hashes here.

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

Hashes for xssblaster-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d744668c202a7fea228a48c222e897fe82f7e3fcb3935892a18707217527af37
MD5 b8c110b0f5f688c650e37ef9617d079a
BLAKE2b-256 9e62c96f44c1de6d4d5fc83ecf31ffe7055dc65c5cd00c0a1def3554367512e6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page