Webhacking.kr old-23
Challenge
Inject a script despite the character filter.
绕过字符过滤注入 script。
1 | https://webhacking.kr/challenge/bonus-3/ |
Analysis
这里通过插入 %00
改变服务端过滤与挑战判据看到的字符串。题目回执与浏览器实际执行 XSS
是不同的判据。
Solution
完整请求脚本如下。PAYLOAD 已经包含
%00,所以脚本直接拼接 query string,避免 HTTP client 把
%00 再编码为字面量 %2500:
1 | #!/usr/bin/env python3 |
等价的请求目标是:
1 | https://webhacking.kr/challenge/bonus-3/index.php?code=<s%00c%00r%00i%00p%00t%00>alert(1);</s%00c%00r%00i%00p%00t%00> |