mobile wallpaper 1mobile wallpaper 2mobile wallpaper 3mobile wallpaper 4mobile wallpaper 5mobile wallpaper 6
首页 / CTF / 源代码
178 字
1 分钟
源代码
2026-02-20
无标签

web 题之查看源代码。

查看源代码:

看到 script 里有混淆后的东西,p1p2 变量经过一些操作后被 eval 执行。根据经验,形如 %xx(xx 为十六进制)的大概率是 URL 编码,加上 eval 里的 unescape 也说明了这点。

进行解码和 eval 里对应的拼接操作后,得到实际代码:

function checkSubmit(){
var a = document.getElementById("password");
if("undefined" != typeof a){
if("67d709b2b54aa2aa648cf6e87a7114f1" == a.value) return !0;
alert("Error");
a.focus();
return !1
}
}
document.getElementById("levelQuest").onsubmit = checkSubmit;

发现对 id 为 password 的输入框进行了判定,当值为 67d709b2b54aa2aa648cf6e87a7114f1 时函数返回 true(用 !0 做了一层混淆)。

猜测这是旧版本的前端校验代码,现在虽然换成了后端校验,但密码本身没变,提交后成功获得 flag。

分享

如果这篇文章对你有帮助,欢迎分享给更多人!

源代码
https://npiter.de/posts/源代码/
作者
piter
发布于
2026-02-20
许可协议
CC BY-NC-SA 4.0

部分信息可能已经过时

封面
Sample Song
Sample Artist
封面
Sample Song
Sample Artist
0:00 / 0:00