# xsshunter **Repository Path**: yuyang2/xsshunter ## Basic Information - **Project Name**: xsshunter - **Description**: xsshunter - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-11-18 - **Last Updated**: 2026-11-18 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # XSS Hunter Express ## *Sets up in 5 minutes and requires no maintenance* The fastest way to set up XSS Hunter to test and find blind cross-site scripting vulnerabilities. ## Requirements - Node.js 18+ (tested on Node.js 24) - A hostname (e.g. `xss.example.com`) with a DNS record pointing at your server - A reverse proxy which terminates TLS (nginx example below). XSS Hunter Express serves plain HTTP and expects HTTPS to be terminated in front of it. The production steps below assume a Linux server with systemd and nginx. The same commands work on Windows/macOS for a local test, minus systemd. ## 1. Install dependencies and build the front-end ```bash cd /opt/xsshunter-express # Front-end (the admin panel is compiled to front-end/dist) cd front-end npm install npm run build cd .. # Backend npm install ``` The backend serves the compiled panel from `front-end/dist/`; deploy that directory together with the rest of the project, or run the build on the server. ## 2. Configuration reference XSS Hunter Express is configured through environment variables: If a `.env` file exists in the project root it is loaded automatically at startup. Variables already present in the process environment take precedence, so systemd `EnvironmentFile=` or shell exports override `.env` values. | Variable | Required | Description | | ----------------------- | -------- | ------------------------------------------------------------------------------------------------- | | `HOSTNAME` | yes | Hostname used in generated payloads and screenshot links (e.g. `xss.example.com`). | | `SCREENSHOTS_DIR` | yes | Directory where payload fire screenshots are stored. Created automatically if missing; the parent directory must be writable. | | `PORT` | no | HTTP port to listen on. Defaults to `3000`. | | `BASE_PATH` | no | URL prefix if the instance is served under a subpath, e.g. `/xss`. Leave empty to serve from `/`. | | `DATABASE_FILE` | no | SQLite database file. Defaults to `./data/xsshunterexpress.sqlite`. | | `CONTROL_PANEL_ENABLED` | no | Set to `true` to expose the web admin panel. Disabled by default to minimize attack surface. | | `BCRYPT_ROUNDS` | no | bcrypt cost factor for the admin password. Defaults to `10`. | | `DEBUG_SQL` | no | Set to `true` to log every generated SQL statement. Off by default. | Payload fire reports are always written as Markdown files to `./report/` (created automatically). The filename is `_.md`; when the payload URL has no valid hostname the victim's IP address is used instead. `BASE_PATH` must match the location prefix used by your reverse proxy, and `PORT` must match `proxy_pass` in the nginx configuration. ## 3. Production deployment (Linux + systemd + nginx) ### 3.1 Copy the project ```bash sudo git clone /opt/xsshunter-express ``` If you are not using git, copy the whole project (including `front-end/dist`) to `/opt/xsshunter-express`. ### 3.2 Build ```bash cd /opt/xsshunter-express/front-end sudo npm install sudo npm run build cd /opt/xsshunter-express sudo npm install ``` ### 3.3 Create the service user and data directories ```bash sudo useradd --system --home /opt/xsshunter-express --shell /usr/sbin/nologin xsshunter sudo mkdir -p /opt/xsshunter-express/screenshots \ /opt/xsshunter-express/data \ /opt/xsshunter-express/report sudo chown -R xsshunter:xsshunter /opt/xsshunter-express ``` ### 3.4 Create the environment file Create `/etc/xsshunter-express.env`: ```bash HOSTNAME=xss.example.com PORT=3000 BASE_PATH=/xss SCREENSHOTS_DIR=/opt/xsshunter-express/screenshots DATABASE_FILE=/opt/xsshunter-express/data/xsshunterexpress.sqlite CONTROL_PANEL_ENABLED=true # DEBUG_SQL=true ``` ```bash sudo chmod 600 /etc/xsshunter-express.env sudo chown root:root /etc/xsshunter-express.env ``` The application does not read `.env` files; variables are passed by systemd (or exported in the shell when running manually). ### 3.5 Create the systemd service Create `/etc/systemd/system/xsshunter-express.service`: ```ini [Unit] Description=XSS Hunter Express After=network.target [Service] Type=simple User=xsshunter Group=xsshunter WorkingDirectory=/opt/xsshunter-express EnvironmentFile=/etc/xsshunter-express.env ExecStart=/usr/bin/node server.js Restart=on-failure RestartSec=5 NoNewPrivileges=true [Install] WantedBy=multi-user.target ``` Replace `/usr/bin/node` with the output of `command -v node` if Node.js is installed somewhere else. ```bash sudo systemctl daemon-reload sudo systemctl enable --now xsshunter-express sudo journalctl -u xsshunter-express -f ``` On the first start the SQLite schema is created and a random admin password is printed to the log. Save it — it is printed only once. If it is lost, delete the database file (this also deletes all collected data) and restart to generate a new password. ### 3.6 Configure nginx ```nginx server { listen 80; server_name xss.example.com; return 301 https://$host$request_uri; } server { listen 443 ssl; server_name xss.example.com; ssl_certificate /etc/letsencrypt/live/xss.example.com/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/xss.example.com/privkey.pem; # Payload reports include screenshots and full page DOMs. client_max_body_size 20m; location = /xss { return 301 /xss/; } location /xss/ { proxy_pass http://127.0.0.1:3000; proxy_http_version 1.1; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; } } ``` ```bash sudo nginx -t sudo systemctl reload nginx ``` Notes: - `proxy_pass` must have **no path suffix** so the `/xss/` prefix is forwarded unchanged. - `X-Forwarded-Proto` is required: session cookies are `Secure`, and login fails with `you cannot have a secure cookie...` without it. - `X-Forwarded-For` is required so reports record the victim's real IP instead of `127.0.0.1`. The app only trusts this header from a loopback proxy. - If you change `BASE_PATH` or `PORT`, update both the environment file and nginx. ### 3.7 Verify ```bash # Should return {"status":"ok"} curl http://127.0.0.1:3000/xss/health # Should return 200 after the redirect to /xss/admin/ curl -IL https://xss.example.com/xss/admin/ ``` Open `https://xss.example.com/xss/admin/` and log in with the generated password. ### 3.8 Firewall Only expose the reverse proxy; the Node process should not be reachable from the internet: ```bash sudo ufw allow 80,443/tcp ``` `server.js` listens on `0.0.0.0`; if the machine is directly reachable, block the `PORT` from outside or change the listen address in `server.js` to `127.0.0.1`. ## 4. Upgrading ```bash cd /opt/xsshunter-express sudo git pull cd front-end && sudo npm install && sudo npm run build && cd .. sudo npm install sudo chown -R xsshunter:xsshunter /opt/xsshunter-express sudo systemctl restart xsshunter-express ``` ## 5. Data to back up - `./data/xsshunterexpress.sqlite` — SQLite database (plus its `-wal`/`-shm` files while running). - `./report/` — generated Markdown payload fire reports. - `SCREENSHOTS_DIR` — gzip-compressed payload fire screenshots. ## Features - **Managed XSS payload fires**: Manage all of your XSS payloads in your XSS Hunter account's control panel. - **Powerful XSS Probes**: The following information is collected everytime a probe fires on a vulnerable page: - The vulnerable page's URI - Origin of Execution - The Victim's IP Address - The Page Referer - The Victim's User Agent - All Non-HTTP-Only Cookies - The Page's Full HTML DOM - Full Screenshot of the Affected Page - Responsible HTTP Request (If an XSS Hunter compatible injection tool is used) - Browser's reported time - If the payload was fired in an iframe - **Single Node.js process**: No external database server required — SQLite stores all injection data. - **Compressed DOM uploads**: When the victim's browser supports `CompressionStream`, the captured DOM is gzip-compressed before it is uploaded and decompressed on the server. Older browsers fall back to plain-text upload automatically. - **Reverse-proxy friendly**: Runs behind nginx/Caddy with an optional URL prefix (`BASE_PATH`). - **`gzip`-Compressed Payload Fire Images**: All images are stored with `gzip` compression to utilize less hard disk space on your instance. - **Minimize Attack Surface**: Optionally disable the web UI altogether to minimize the attack surface of your instance. - **Full Page Screenshots**: XSS Hunter probes utilize the HTML5 canvas API to generate a full screenshot of the vulnerable page which an XSS payload has fired on. With this feature you can peak into internal administrative panels, support desks, logging systems, and other internal web apps. This allows for more powerful reports that show the full impact of the vulnerability to your client or bug bounty program. - **Markdown Payload Fire Reports**: Every payload fire writes a detailed Markdown report to `./report/`, ready to attach to a bug bounty submission or security report. - **Automatic Payload Generation**: XSS Hunter automatically generates XSS payloads for you to use in your web application security testing. - **Correlated Injections**: Perhaps the most powerful feature of XSS Hunter is the ability to correlated injection attempts with XSS payload fires. By using an [XSS Hunter compatible testing tool](https://github.com/mandatoryprogrammer/xsshunter_client) you can know immediately what caused a specific payload to fire (even weeks after the injection attempt was made!). - **Page Grabbing**: Upon your XSS payload firing you can specify a list of relative paths for the payload to automatically retrieve and store. This is useful in finding other vulnerabilities such as bad `crossdomain.xml` policies on internal systems which normally couldn't be accessed. - **Secondary Payload Loading**: Got a secondary payload that you want to load after XSS Hunter has done it's thing? XSS Hunter offers you the option to specify a secondary JavaScript payload to run after it's completed it's collection. - **Mobile Compatible**: Check your payloads at the bar without your laptop, the web interface is fully mobile ready. ## Screenshots ![](images/payload-fires.png) ![](images/collected-pages.png) ![](images/settings.png) ![](images/xss-payloads.png) ## Credits - The front-end is built in Vue and utilizes the [`vue-black-dashboard`](https://github.com/creativetimofficial/vue-black-dashboard) framework. Licensed under MIT (see ).