This project aims to create a testing environment for web vulnerability scanning tools. This environment can be used to learn automated security tools, observe their features, and evaluate their effectiveness in different security testing scenarios.
The following technologies are used in this project:
- Backend: Python (Flask)
- Frontend: HTML, CSS, JavaScript
- Others: Docker (Ultra-optimized multi-stage build with Alpine Linux)
xsstrange/
├── src/ # Frontend source files
│ ├── assets/ # Static assets (CSS, JS)
│ │ └── style.css # Main stylesheet
│ ├── cases/ # Test cases
│ │ └── xss/ # XSS vulnerability test cases
│ └── index.html # Main entry point
├── templates/ # Template files
│ └── cases/ # Case templates
├── utils/ # Utility modules
│ └── template_utils.py # Template processing utilities
├── app.py # Main Flask application
├── docker-compose.yml # Docker configuration
├── Dockerfile # Ultra-optimized multi-stage Docker build
└── .dockerignore # Aggressive Docker build context exclusions
This project uses an ultra-optimized multi-stage Docker build process to achieve minimal image size:
- Builder Stage (Alpine): Installs build dependencies and Python packages in a virtual environment
- Production Stage (Alpine): Creates an ultra-minimal runtime image with only essential files
- Alpine Linux: Both stages use Alpine Linux for minimal base image size
- Aggressive Cleanup: Removes all unnecessary files (tests, docs, cache files)
- Virtual Environment: Isolates Python dependencies
- Non-root User: Enhanced security with dedicated user
- Layer Optimization: Efficient layer caching and minimal layer count
- Ultra-Small Image Size: Final image is significantly smaller than standard builds
- Enhanced Security: Non-root execution and minimal attack surface
- Fast Builds: Optimized layer caching and minimal build context
- Production Ready: Only runtime dependencies included
git clone https://github.com/gallipolixyz/xsstrange.git
cd xsstrange- Install Docker: https://docs.docker.com/get-docker/
- Install Docker Compose: https://docs.docker.com/compose/install/
# Build and start the application
docker-compose up -d --build
# Or build the image separately
docker build -t xsstrange .The application should now be running at:
- Web Interface: http://127.0.0.1:80
When you want to stop the application, run:
docker-compose down# Build with default target (production)
docker build -t xsstrange .
# Build specific stage for development
docker build --target builder -t xsstrange:builder .
# Build with no cache (for troubleshooting)
docker build --no-cache -t xsstrange .
# Show image size
docker images xsstrange- Original single-stage: ~200-300MB
- Multi-stage optimized: ~100-150MB (50%+ reduction)
- Ultra-optimized Alpine: ~50-80MB (75%+ reduction)
- Non-root user execution (appuser:1000)
- Minimal runtime dependencies
- Health checks included
- Proper file permissions
- Alpine Linux security benefits
- Aggressive
.dockerignorereduces build context - Optimized layer caching
- Minimal dependency installation
- Efficient file copying
- XSS Vulnerability Testing: Various test cases for Cross-Site Scripting vulnerabilities
- Template System: Dynamic template generation for test cases
- Ultra-Optimized Docker Build: Alpine-based multi-stage build for maximum efficiency
- If ports are already in use, modify the port mappings in
docker-compose.yml - Check logs with:
docker-compose logs -f - For build issues:
docker build --no-cache -t xsstrange . - Check image size:
docker images xsstrange - Alpine compatibility issues: Check if all dependencies support Alpine Linux
- Fork the repository
- Create your feature branch:
git checkout -b feature/xss-test-case
- Commit your changes:
git commit -m 'Add new XSS test case' - Push to the branch:
git push origin feature/xss-test-case
- Open a Pull Request to the
mainbranch
- Create a new directory in
src/cases/xss/for your test case - Add corresponding template in
templates/cases/xss/ - Update the test case documentation
# Build for development (includes build tools)
docker build --target builder -t xsstrange:dev .
# Run development container
docker run -it --rm -p 5000:5000 -v $(pwd):/app xsstrange:dev sh
# Check image layers and size
docker history xsstrange
docker images xsstrange --format "table {{.Repository}}\t{{.Tag}}\t{{.Size}}"This project is licensed under the MIT License - see the LICENSE file for details.
- GitHub: @gallipolixyz
- Project Link: https://github.com/gallipolixyz/xsstrange