js教程

JS实现阿里云滑动验证码破解

我的站长站 2021-03-28 人阅读
//使用联通测试网址 http://upay.10010.com/npfwap/npfMobWap/bankcharge/index.html?version
function fuck10010(){
    btn=document.querySelector(".button");
    mousedown = document.createEvent("MouseEvents");
    rect = btn.getBoundingClientRect();
    x = rect.x||rect.left;
    y = rect.y||rect.top;
    w = document.querySelector(".label").getBoundingClientRect().width;
    //点击滑块
    mousedown.initMouseEvent("mousedown",true,true,window,0, 
            x, y, x, y,false,false,false,false,0,null);
    btn.dispatchEvent(mousedown);
    
    dx = 0;
    dy = 0;
    //滑动滑块
    intervaltimer = setInterval(function(){
        var mousemove = document.createEvent("MouseEvents");
        var _x = x + dx;
        var _y = y + dy;
        mousemove.initMouseEvent("mousemove",true,true,window,0, 
                _x, _y, _x, _y,false,false,false,false,0,null);
        btn.dispatchEvent(mousemove);
         
        btn.dispatchEvent(mousemove);
        if(_x - x >= w){
            clearInterval(intervaltimer);
            var mouseup = document.createEvent("MouseEvents");
            mouseup.initMouseEvent("mouseup",true,true,window,0, 
            _x, _y, _x, _y,false,false,false,false,0,null);
            btn.dispatchEvent(mouseup);
            setTimeout(function(){
console.log('拖动结束执行逻辑');
            }, 1000);
        }
        else{
            dx += parseInt(Math.random()*(209-199)+199)/33;
            console.log(x,y,_x,_y,dx);
        }
    }, 30);
}


相关专题
阿里云
阿里云
2022-03-05 1120

阿里云是国内大型互联网服务商之一,我的站长站为大家整理关于阿里云相关信息,包含阿里云最新活动,阿里云域名配置教程,阿里云服务器活动分享....

最新更新
  • js截取字符串教程

    slice()方法接受两个参数,起始索引和结束索引(可选)。它返回从起始索引到结束索引(不包括结束索引)之间的子字符...

    js教程 3个月前
  • find findIndex indexOf索引选择器使用方法

    find使用方法find方法是ES6引入的一种数组方法,可以用来查找数组中符合条件的元素。语法是:array.find(callba...

    js教程 3个月前
  • js复制网页内容教程

    Async Clipboard API方法HTML5新增的方法,无需引入第三方插件,直接就可以复制内容。低版本的浏览器可能会不兼...

    js教程 3个月前
  • js获取字符长度函数分享

    js获取字符长度函数function objLen(str) { if (str == null) return 0; if (typeof str != "string") { ...

    js教程 3个月前
  • 网站LED跑马灯效果广告代码

    网站可以看到很多的论坛网站都会用到这种网站LED跑马灯效果,这种效果实现也很简单,分享给大家。LED跑马灯效果...

    js教程 4个月前