This repository contains tools and payloads for demonstrating SQL injection attacks that bypass filters using XML encoding techniques. The materials are designed for educational purposes and security research.
This repository is designed to work with the PortSwigger Web Security Academy lab:
Lab: SQL injection with filter bypass via XML encoding
Link: https://portswigger.net/web-security/sql-injection/lab-sql-injection-with-filter-bypass-via-xml-encoding
Youtube link: https://youtu.be/BgrF-mWw9Zk?si=izERzq2pAcw3J6rd
hex_encoder.py
- HTML hex entity encoder/decoder utilitypayloads.txt
- SQL injection payloads for testingpost.js
- JavaScript code for making XML POST requests
A Python utility that converts text to HTML hex entities (&#xHH;
format) and vice versa. This tool is useful for encoding payloads to bypass input filters.
- Encode text to HTML hex entities
- Decode HTML hex entities back to text
- Interactive demo mode
- Command-line interface
- File input/output support
Interactive Mode:
python3 hex_encoder.py
Command Line:
# Encode text
python3 hex_encoder.py encode -i "Hello World"
# Decode entities
python3 hex_encoder.py decode -i "Hello"
# Show character mapping
python3 hex_encoder.py demo -i "SQL"
# Process files
python3 hex_encoder.py encode -f input.txt -o output.txt
Contains common SQL injection payloads for:
- Discovering table column counts using UNION SELECT
- Extracting data from user tables
- Concatenating username and password fields
JavaScript code demonstrating how to send XML POST requests that can be used to test XML-based endpoints for injection vulnerabilities.
This repository is intended for:
- Security research and education
- Penetration testing practice
- Understanding XML encoding bypass techniques
- Learning about SQL injection mitigation
IMPORTANT: These tools and techniques should only be used on systems you own or have explicit permission to test. Unauthorized access to computer systems is illegal and unethical.
- Use only on authorized targets
- Respect responsible disclosure practices
- Follow applicable laws and regulations
- Use for educational and defensive purposes only
This project is for educational purposes. Please use responsibly and in accordance with applicable laws.