iqbalmh18

pexes

by iqbalmh18
Other
v?
MIT

Overview

Summary generated from the README

PeXeS is a standalone Python 3.10+ command-line tool that scans websites for cross-site scripting vulnerabilities using Playwright. It verifies findings by detecting dialogs, console output and network activity, and scores confidence to reduce false positives. It is not a Payload CMS plugin and does not integrate with Payload; it needs Python and Playwright browsers.

Features

  • Scans URL, form, DOM, event handler and API JSON contexts
  • Verifies execution through dialog, console and network monitoring
  • Confidence scoring with CSP detection to filter false positives
  • WAF detection and evasion techniques
  • Captures screenshots and DOM snapshots as evidence
  • Reports in JSON, HTML, Markdown and CSV with resumable scans

Use cases

  • Test a website for reflected and DOM-based XSS during a security review
  • Scan authenticated pages using custom headers and cookies
  • Generate XSS vulnerability reports for bug bounty work

From the author

PeXeS - XSS scanner powered by Playwright.

2

Stars

0

Forks

0

Open Issues

1 years ago

Last Updated

0

Weekly Downloads

v

npm Version

Dependencies

GitHub stars

20 since Sep 7

Show data
GitHub stars by day (UTC)
DateStars
Dec 6, 20262
Dec 5, 20262
Dec 4, 20262
Dec 3, 20262
Dec 2, 20262
Dec 1, 20262
Nov 30, 20262
Nov 29, 20262
Nov 28, 20262
Nov 27, 20262
Nov 26, 20262
Nov 25, 20262
Nov 24, 20262
Nov 23, 20262
Nov 22, 20262
Nov 21, 20262
Nov 20, 20262
Nov 19, 20262
Nov 18, 20262
Nov 17, 20262
Nov 16, 20262
Nov 15, 20262
Nov 14, 20262
Nov 13, 20262
Nov 12, 20262
Nov 11, 20262
Nov 10, 20262
Nov 9, 20262
Nov 8, 20262
Nov 7, 20262
Nov 6, 20262
Nov 5, 20262
Nov 4, 20262
Nov 3, 20262
Nov 2, 20262
Nov 1, 20262
Oct 31, 20262
Oct 30, 20262
Oct 29, 20262
Oct 28, 20262
Oct 27, 20262
Oct 26, 20262
Oct 25, 20262
Oct 24, 20262
Oct 23, 20262
Oct 22, 20262
Oct 21, 20262
Oct 20, 20262
Oct 19, 20262
Oct 18, 20262
Oct 17, 20262
Oct 16, 20262
Oct 15, 20262
Oct 14, 20262
Oct 13, 20262
Oct 12, 20262
Oct 11, 20262
Oct 10, 20262
Oct 9, 20262
Oct 8, 20262
Oct 7, 20262
Oct 6, 20262
Oct 5, 20262
Oct 4, 20262
Oct 3, 20262
Oct 2, 20262
Oct 1, 20262
Sep 30, 20262
Sep 29, 20262
Sep 28, 20262
Sep 27, 20262
Sep 26, 20262
Sep 25, 20262
Sep 24, 20262
Sep 23, 20262
Sep 22, 20262
Sep 21, 20262
Sep 20, 20262
Sep 19, 20262
Sep 18, 20262
Sep 17, 20262
Sep 16, 20262
Sep 15, 20262
Sep 14, 20262
Sep 13, 20262
Sep 12, 20262
Sep 11, 20262
Sep 10, 20262
Sep 9, 20262
Sep 8, 20262
Sep 7, 20262
npm weekly downloads

Trends appear after 7 days of data. Daily snapshots have not started yet.

Each point is npm's rolling 7-day download count.

Health Score

17/100Poor

Composite score based on GitHub activity, stars, npm downloads, publish recency, dependency count, and package size.

Badge for your README

Payload Directory health badge
Markdown
[![Payload Directory](https://payloaddirectory.dev/badge/1102069937-root.svg)](https://payloaddirectory.dev/plugins/1102069937-root)
HTML
<a href="https://payloaddirectory.dev/plugins/1102069937-root"><img src="https://payloaddirectory.dev/badge/1102069937-root.svg" alt="Payload Directory"></a>
Updated Nov 23, 2025Created Nov 22, 2025

README

PeXeS – Playwright XSS Scanner

Python Version License Code Style Version

PeXeS (Playwright XSS Scanner) is an advanced XSS vulnerability scanner with multi-layer execution verification and industry-leading accuracy. Powered by Playwright, it excels at detecting Cross-Site Scripting (XSS) vulnerabilities with actual execution proof through dialog detection, console monitoring, and network tracking.

Designed for security researchers and bug bounty hunters, PeXeS eliminates false positives through CSP detection and confidence scoring while maintaining high performance through smart concurrency.

Key Features

Core Detection Capabilities

  • Multi-Layer Verification: Real JavaScript execution detection via Playwright listeners
    • Dialog/Alert capture (alert, confirm, prompt)
    • Console message monitoring with execution markers
    • Network request tracking for exfiltration attempts
    • DOM mutation observation
  • Confidence Scoring: Advanced scoring system (0-100) with levels: HIGH (90-100), MEDIUM (60-89), LOW (30-59), FALSE_POSITIVE (0-29)
  • CSP Detection: Automatic Content-Security-Policy violation detection to eliminate false positives
  • False Positive Filtering: Encoding detection (HTML entities, URL encoding, JS escaping) and context analysis

Scanning Modes

  • Multi-Mode Scanning: Specialized scanners for URL, Form, DOM, Event, and API contexts
  • Smart Concurrency: Optimized tab management that scales resources dynamically for maximum efficiency
  • WAF Evasion & Detection: Built-in WAF detection and 10+ advanced evasion techniques
  • API Security: Dedicated scanner for JSON body injection with reflection-based verification (93% false positive reduction)

Advanced Features

  • Evidence Capture: Screenshots, DOM snapshots, console logs, network activity, and dialog transcripts
  • Interactive Reporting: Generate detailed JSON, HTML, Markdown, or CSV reports with built-in server
  • Resume Capability: Interrupt and resume scans without losing progress
  • Authentication: Support for custom headers and cookies

Table of Contents

Installation

Setup

PeXeS requires Python 3.10+ and Node.js (for Playwright).

git clone https://github.com/iqbalmh18/pexes.git
cd pexes
bash install.sh
2. Manual Installation
  1. Clone this repository:

    git clone https://github.com/iqbalmh18/pexes.git
    cd pexes
    
  2. Create virtual environment:

    python3 -m venv .venv
    
  3. Activate virtual environment:

    # Linux/macOS
    python3 -m venv .venv
    source .venv/bin/activate
    
    # Windows (Command Prompt)
    python -m venv .venv
    .venv\Scripts\activate
    
    # Windows (PowerShell)
    python -m venv .venv
    .venv\Scripts\Activate.ps1
    

    Install dependencies:

    pip install --upgrade pip
    pip install -e .
    

    Install Playwright browsers:

    playwright install chromium
    

Quick Start

Check if installed correctly:

pexes --version

Run a full scan against a target:

pexes scan --url https://example.com --mode all --evidence

Usage Guide

Basic Scanning

Scan a specific URL with default settings:

pexes scan --url https://example.com

Scan with visual browser + DevTools console (for debugging):

pexes scan --url https://example.com --headless false --console

Scan Modes

PeXeS supports multiple scan modes, controlled by the --mode argument:

  • all: Run all enabled scanners (default)
  • url: Scan URL parameters (Reflected XSS)
  • form: Scan HTML forms and inputs (Stored/Reflected XSS)
  • dom: Scan for DOM-based XSS sinks
  • event: Scan HTML event handlers
  • api: Scan API endpoints (JSON injection)
  • waf: Detect WAF presence only

Example:

pexes scan --url https://example.com --mode dom --evidence

Advanced Options

CLI Arguments Reference
ArgumentTypeDefaultDescription
--urlstrRequiredTarget URL to scan.
--modechoiceallScan mode: all, url, form, dom, event, api, waf.
--headlesschoicetrueRun browser in headless mode (true/false).
--consoleflagFalseOpen DevTools console (only with --headless false).
--max-tabint5Max concurrent tabs (URL scan only).
--max-payload-domint3Max payloads for DOM scanner.
--max-payload-eventint3Max payloads for Event scanner.
--proxystrNoneProxy URL (e.g., http://127.0.0.1:8080).
--evidenceflagFalseCapture screenshots and DOM snapshots.
--resumeflagFalseResume a previously interrupted scan.
--headerstrNoneCustom header (repeatable).
--cookiestrNoneCustom cookie (repeatable).
--delayfloat0.0Delay between requests (seconds).
--waf-evasionflagFalseEnable automatic WAF evasion.
--detect-wafflagFalseDetect WAF presence only.
--output-formatchoicejsonOutput format: json, html, md, csv.
--output-pathpath./reportsOutput file or directory.
Advance Usage Examples

Full Authenticated Scan with Evidence:

pexes scan --url https://example.com/dashboard \
  --mode all \
  --header "Authorization: Bearer <token>" \
  --cookie "session_id=xyz123" \
  --evidence \
  --max-tab 5

API Fuzzing with Reflection Verification:

pexes scan --url https://api.target.com/v1/user \
  --mode api \
  --proxy http://127.0.0.1:8080 \
  --output-format json

CSP-Protected Site Scan:

pexes scan --url https://google.com \
  --mode dom \
  --evidence \
  --headless true
# Automatically detects CSP blocking and filters false positives

Debugging with Console

Open browser with DevTools console for real-time monitoring:

pexes scan --url https://example.com \
  --mode dom \
  --headless false \
  --console

Note: DevTools opens in Elements tab by default (Chromium limitation). Click Console tab to view logs.

Detection Methodology

Multi-Layer Verification

PeXeS uses a comprehensive verification approach:

  1. Execution Detection (Highest Priority)

    • Dialog/Alert capture with auto-accept
    • Console message monitoring for markers
    • Network request tracking
    • DOM mutation observation
  2. Reflection Analysis

    • Context detection (HTML, JavaScript, attribute, JSON)
    • Encoding detection (HTML entities, URL, JavaScript)
    • Dangerous context identification
  3. False Positive Filtering

    • CSP violation detection from console errors
    • Payload encoding verification
    • Reflection-based confidence scoring

Confidence Scoring

Scoring Logic:

  • HIGH (90-100): Dialog triggered OR verified execution + reflection
  • MEDIUM (60-89): Reflected in executable context, no execution proof
  • LOW (30-59): Reflected but encoded/sanitized
  • FALSE_POSITIVE (0-29): Not reflected OR CSP blocking OR fully encoded

Example:

{
  "payload": "<script>alert(1)</script>",
  "confidence_score": 90,
  "confidence_level": "HIGH",
  "evidence": {
    "dialogs": [{
      "type": "alert",
      "message": "1",
      "timestamp": "2025-11-23T14:54:49.196844"
    }]
  }
}

Reporting

PeXeS generates detailed reports in JSON, HTML, Markdown, and CSV formats.

Sample JSON Report

{
  "metadata": {
    "scanner": "PeXeS",
    "version": "1.0.5",
    "target": "https://example.com",
    "date": "2025-11-23T10:00:00"
  },
  "summary": {
    "total_vulnerabilities": 4,
    "risk_level": "HIGH",
    "breakdown": {
      "url": 4,
      "dom": 0,
      "form": 0,
      "event": 0,
      "api": 0
    }
  },
  "vulnerabilities": [
    {
      "id": "XSS-001",
      "type": "Reflected XSS",
      "severity": "MEDIUM",
      "url": "https://example.com/?q=<payload>",
      "payload": "<script>alert(1)</script>",
      "confidence_score": 90,
      "confidence_level": "HIGH",
      "evidence": {
        "dialogs": [{
          "type": "alert",
          "message": "1",
          "timestamp": "2025-11-23T14:54:49.196844"
        }],
        "screenshots": ["reports/evidence/screenshot_001.png"],
        "console_logs": ["PEXES execution marker detected"]
      }
    }
  ]
}

Generate and View HTML Report:

pexes report --file ./reports/scan.json --html

This command will convert the JSON report to HTML and launch a local server to view it in your browser.

Other Formats:

pexes scan ... --output-format md --output-path report.md
pexes scan ... --output-format csv --output-path report.csv

Configuration

Manage global settings:

  • View Config: pexes config --get max_tab
  • Set Config: pexes config --set max_tab 2
  • Reset Config: pexes config --reset

Project Structure

pexes/
├── pexes/              # Main package
│   ├── browser/        # Playwright driver and browser management
│   ├── cli/            # Command-line interface arguments
│   ├── core/           # Core engine and controller
│   ├── payloads/       # XSS payload lists and management
│   ├── plugins/        # Plugin system (e.g., WAF evasion)
│   ├── reports/        # Report generation logic
│   ├── scanners/       # Vulnerability scanners (URL, DOM, API, etc.)
│   ├── utils/          # Utilities (XSS detection, evidence, logging)
│   └── main.py         # Entry point
├── reports/            # Default output directory for scan reports
├── README.md           # Documentation
├── pyproject.toml      # Project configuration and dependencies
└── requirements.txt    # Python dependencies
└── install.sh          # PeXeS installer scripts

Advanced Features

WAF Evasion

Detect WAF:

pexes scan --url https://example.com --detect-waf

Scan with Evasion:

pexes scan --url https://example.com --mode all --waf-evasion

Payload Management

  • List Payloads: pexes payload --list
  • Add Payload: pexes payload --add custom.json
  • Remove Payload: pexes payload --remove payload_name

Performance Tuning

Fast Scan (Higher FP risk):

pexes scan --url https://example.com \
  --max-payload-dom 2 \
  --max-payload-event 2 \
  --delay 0

Thorough Scan (Slower, more accurate):

pexes scan --url https://example.com \
  --max-payload-dom 10 \
  --max-payload-event 10 \
  --delay 1.0 \
  --evidence

Troubleshooting

Issue: No vulnerabilities detected on known vulnerable site

  • Ensure --evidence flag is enabled
  • Try --headless false --console to visually verify
  • Check if CSP is blocking (scanner auto-detects this)

Issue: Too many false positives

  • Update to latest version (v1.0.5+)
  • CSP detection and confidence scoring should filter these
  • Check confidence_level in reports (ignore FALSE_POSITIVE)

Issue: Scan too slow

  • Reduce max payloads: --max-payload-dom 3
  • Increase tabs: --max-tab 5 (URL scan only)
  • Disable evidence: Remove --evidence flag

License

MIT License. See LICENSE for details.

Contributing

Contributions welcome! Please submit pull requests or open issues for bugs/features.


Made with ❤️ for Security Research
Remember: With great power comes great responsibility

Similar plugins