JS实现阿里云滑动验证码破解
本帖最后由 夕浩 于 2021-2-23 23:42 编辑//使用联通测试网址 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);
}
免费的评分来一波,后续发布更多有用的源码 //简单改了下,去掉了中间过程,直接秒过,传入滑块的id,用的蓝奏云盘登录滑块做的测试
function slide (id) {
var slider = document.getElementById(id),
container = slider.parentNode;
var rect = slider.getBoundingClientRect(),
x0 = rect.x || rect.left,
y0 = rect.y || rect.top,
w = container.getBoundingClientRect().width,
x1 = x0 + w,
y1 = y0;
var mousedown = document.createEvent("MouseEvents");
mousedown.initMouseEvent("mousedown", true, true, window, 0,
x0, y0, x0, y0, false, false, false, false, 0, null);
slider.dispatchEvent(mousedown);
var mousemove = document.createEvent("MouseEvents");
mousemove.initMouseEvent("mousemove", true, true, window, 0,
x1, y1, x1, y1, false, false, false, false, 0, null);
slider.dispatchEvent(mousemove);
/*var mouseup = document.createEvent("MouseEvents");
mouseup.initMouseEvent("mouseup", true, true, window, 0,
x1, y1, x1, y1, false, false, false, false, 0, null);
slider.dispatchEvent(mouseup);*/
}
slide('nc_1_n1z'); 感谢楼主的分享!学习了 lianyi 发表于 2021-8-2 15:36
那是因为这个滑块弹窗是由iframe的形式加载的,就算是用document.querySelector("#J_sufei > iframe"). ...
请问这个现在有解决方案嘛?想学习下{:1_937:} 数字+字母组合可以出个教程不 学习一下 试一下,看看行不行 大佬,现在这个已经不能用了,可以更新下吗? lianyi 发表于 2021-3-31 10:44
//简单改了下,去掉了中间过程,直接秒过,传入滑块的id,用的蓝奏云盘登录滑块做的测试
有的滑块会检测过程
大牛厉害 学习一下 老哥,可以留个联系方式交流一下? 我试试看,