Created
December 8, 2020 03:45
-
-
Save akkuman/9e06dac5c196c338dfb50d51bf8d9e21 to your computer and use it in GitHub Desktop.
加速创宇云反爬第二层解密
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var jsSha1 = require("js-sha1") | |
function go(config) { | |
function check() { | |
var userAgent = window.navigator.userAgent, | |
checkFlags = ['Phantom']; | |
for (var i = 0; i < checkFlags.length; i++) { | |
if (userAgent.indexOf(checkFlags[i]) != -1) { | |
return true; | |
} | |
} | |
if (window.callPhantom || window._phantom || window.Headless || window.navigator.webdriver || window.navigator.__driver_evaluate || window.navigator.__webdriver_evaluate) { | |
return true; | |
} | |
}; | |
if (check()) { | |
return; | |
} | |
var date = new Date(); | |
function get_jsl(ct_data, bts_data) { | |
for (var i = 0; i < config.chars.length; i++) { | |
for (var j = 0; j < config.chars.length; j++) { | |
var result = bts_data[0] + config.chars.substr(i, 1) + config.chars.substr(j, 1) + bts_data[1]; | |
if (jsSha1.hex(result) == ct_data) { | |
return [result, new Date() - date]; | |
} | |
} | |
} | |
}; | |
var res = get_jsl(config.ct, config.bts); | |
if (res) { | |
setTimeout(function () { | |
document.cookie = config.tn + '=' + res[0] + ';Max-age' + '=' + config.vt + '; path =' + ' /'; | |
location.href = location.pathname + location.search; | |
}, 0); | |
} else { | |
alert('请求验证澶辫触'); | |
} | |
}; | |
go({ | |
"bts": ["1607391418.48|0|Vble", "TTB8Z71tYZORwXYybEGFw%3D"], | |
"chars": "hHARhjPzITKKe8IhNhcoOP", | |
"ct": "408ff1aa827a1c63351614b501bce3ef6cab3bcf", | |
"ha": "sha1", | |
"tn": "__jsl_clearance_s", | |
"vt": "3600", | |
"wt": "1500" | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment