【验证码挑战】深蹲验证码的简单解法
评论
收藏

【验证码挑战】深蹲验证码的简单解法

经验分享
shendeju
2026-03-31 13:35·浏览量:523
shendeju
发布于 2026-03-26 17:35更新于 2026-03-31 13:35523浏览

挑战链接:

https://vivirenremoto.github.io/squat_captcha/sample-form.html

需要对着摄像头,做10个深蹲,才能通过验证。

一、直接看通关视频:

解题思路:

1、通过分析验证码的js,知道这个验证机制是查找人脸,然后人脸移动一定距离后,会判断做了一次深蹲;

*直接改js感觉不太地道,不好玩,还是要光明正大的通过验证

2、知道了原理,直接去B站下载了一个深蹲的视频,截取比较标准的完整姿势,处理一下导出mp4;


3、下载obs,开启虚拟摄像头,循环播放这个深蹲的mp4,并设置好视频显示的区域。

4、打开测试网站,直接就开始触发验证了,深蹲10次之后通关。


总体来说,挑战难度不算高,看你能不能想到虚拟摄像头。

只要思想不滑坡,办法总比困难多。

二、影刀的js通关版

代码就2行:

方法一:直接在点击unsubscibe之前,设置验证码已通过,暴力跳过

function (element, input) {
    // 直接设置验证码已通过
    captcha_done = true;
    // 移除验证码iframe(如果存在)
    var iframe = document.getElementById('squat_captcha');
    if (iframe) iframe.remove();
    // 触发表单提交
    alert('form sent');
    return 'done';
}

方法二:暂停视频,在js里模拟深蹲

function (element, input) {
    var iframe = document.getElementById('squat_captcha');
    if (iframe) {
        var win = iframe.contentWindow;
        var doc = iframe.contentDocument;
        
        // 关键:暂停视频,停止原来的人脸检测循环
        var video = doc.getElementById('inputVideo');
        if (video) video.pause();
        
        var count = 10;
        var timer = setInterval(function () {
            count--;
            var el = doc.getElementById('pending_squats');
            if (el) el.textContent = count;
            if (count <= 0) {
                clearInterval(timer);
                var box = doc.getElementById('box_squats');
                if (box) box.innerHTML = '✅';
                setTimeout(function () {
                    win.parent.postMessage(1, '*');
                }, 2000);
            }
        }, 1500);
        return 'ok';
    }
    
    if (typeof pending_squats !== 'undefined') {
        // 在iframe内部执行
        var video = document.getElementById('inputVideo');
        if (video) video.pause();
        
        var count = pending_squats;
        var timer = setInterval(function () {
            count--;
            pending_squats = count;
            var el = document.getElementById('pending_squats');
            if (el) el.textContent = count;
            if (count <= 0) {
                clearInterval(timer);
                var box = document.getElementById('box_squats');
                if (box) box.innerHTML = '✅';
                setTimeout(function () {
                    var target = parent.postMessage ? parent : parent.document;
                    target.postMessage(1, '*');
                }, 2000);
            }
        }, 1500);
        return 'ok iframe, count=' + count;
    }
    
    return 'not found';
}

影刀js版的视频就不发了,大家可以自己试一试~


三、过往验证码相关帖子的传送门:

1、https://www.yingdao.com/community/detaildiscuss?id=842235723893710848&tag=&from=userCenter&sort=createTime&page=1

2、https://www.yingdao.com/community/detaildiscuss?id=842234046250221568&tag=&from=userCenter&sort=createTime&page=1

3、https://www.yingdao.com/community/detaildiscuss?id=801650995201552384&tag=&from=userCenter&sort=createTime&page=1

4、https://www.yingdao.com/community/detaildiscuss?id=798016452452347904&tag=&from=userCenter&sort=createTime&page=1


更多有趣内容指路:

收藏10
全部评论1
最新
发布评论
评论