diff --git a/README.md b/README.md index 63429e2..5f02816 100644 --- a/README.md +++ b/README.md @@ -4,12 +4,13 @@ * 安居客(单IP大量请求后滑块验证会变成绘制手势验证) * 美团 * 京东(轨迹算法需要重写) -* 易盾(轨迹算法通过率较低, 可自行改写) +* 易盾(删除关键 js, 请自行补全) * 云片(验证码图像处理缺口定位成功率有待提高) * 数美(说明: 当接口返回数据中 riskLevel 字段为 PASS 即为验证通过, 在之后的请求中携带 rid 即可) -* 携程(只实现了滑块验证部分, 通过率极高, 控制频率不会出现后续点选验证) +* 携程(删除关键js, 请自行补全) * 搜狐 * 虎牙(滑块通过后台未返回通过认证参数, 后续请求直接使用滑块标识ID code 作为 ticket 即可) +* 爱奇艺安全盾(已删除部分关键js, 请自行补全) 结果展示 @@ -42,6 +43,10 @@ * 虎牙 ![image](https://github.com/Esbiya/SliderCracker/blob/master/view/huya.png) +* 爱奇艺 +![image](https://github.com/Esbiya/SliderCracker/blob/master/view/aiqiyi.png) + + 公告 -------- diff --git a/iqiyi/captcha.jpg b/iqiyi/captcha.jpg new file mode 100644 index 0000000..67db4e3 Binary files /dev/null and b/iqiyi/captcha.jpg differ diff --git a/iqiyi/decode_rsa.js b/iqiyi/decode_rsa.js new file mode 100644 index 0000000..23f7465 --- /dev/null +++ b/iqiyi/decode_rsa.js @@ -0,0 +1,7 @@ +// 已删除关键 js, 请自行补全 + +function decodeRSA(rsa_str) { + return f(i.decode(rsa_str)) +} + +console.log(decodeRSA("mC0IIm7khy7OZaZrpfcVAvZuh/xlkf4Ybi3PcCPLN579hY8dF61Tw9OjWwuAOQbd6p7h6sH7U1AeWeOX87CqeFA9k7bZW7BzfI4Trp81LZO9Nzm16S3v0CayyPbPCrVRYTDso/81QfaozFVa8vTvsMdUx41E7yhpdSmpEEhy6l8=")); \ No newline at end of file diff --git a/iqiyi/encrypt_pwd.js b/iqiyi/encrypt_pwd.js new file mode 100644 index 0000000..986bba2 --- /dev/null +++ b/iqiyi/encrypt_pwd.js @@ -0,0 +1,477 @@ +var b = {}; +var a = {}; + +function c(a) { + var b = f + , c = b.biDivideByRadixPower(a, this.k - 1) + , d = b.biMultiply(c, this.mu) + , e = b.biDivideByRadixPower(d, this.k + 1) + , g = b.biModuloByRadixPower(a, this.k + 1) + , h = b.biMultiply(e, this.modulus) + , i = b.biModuloByRadixPower(h, this.k + 1) + , j = b.biSubtract(g, i); + j.isNeg && (j = b.biAdd(j, this.bkplus1)); + for (var k = b.biCompare(j, this.modulus) >= 0; k;) + j = b.biSubtract(j, this.modulus), + k = b.biCompare(j, this.modulus) >= 0; + return j +} + +function d(a, b) { + var c = f.biMultiply(a, b); + return this.modulo(c) +} + +function e(a, b) { + var c = new t; + c.digits[0] = 1; + for (var d = a, e = b; ;) { + if (0 != (1 & e.digits[0]) && (c = this.multiplyMod(c, d)), + e = f.biShiftRight(e, 1), + 0 == e.digits[0] && 0 == f.biHighIndex(e)) + break; + d = this.multiplyMod(d, d) + } + return c +} + +var f, g = {}; +"undefined" == typeof g.RSAUtils && (f = g.RSAUtils = {}); +var h, k, l, m, n = 16, o = n, p = 65536, q = p >>> 1, r = p * p, s = p - 1, t = g.BigInt = function (a) { + this.digits = "boolean" == typeof a && a === !0 ? null : k.slice(0), + this.isNeg = !1 + } +; +f.setMaxDigits = function (a) { + h = a, + k = new Array(h); + for (var b = 0; b < k.length; b++) + k[b] = 0; + l = new t, + m = new t, + m.digits[0] = 1 +} +; +f.setMaxDigits(20); +var u = 15; +f.biFromNumber = function (a) { + var b = new t; + b.isNeg = 0 > a, + a = Math.abs(a); + for (var c = 0; a > 0;) + b.digits[c++] = a & s, + a = Math.floor(a / p); + return b +} +; +var v = f.biFromNumber(1e15); +f.biFromDecimal = function (a) { + for (var b, c = "-" == a.charAt(0), d = c ? 1 : 0; d < a.length && "0" == a.charAt(d);) + ++d; + if (d == a.length) + b = new t; + else { + var e = a.length - d + , g = e % u; + for (0 == g && (g = u), + b = f.biFromNumber(Number(a.substr(d, g))), + d += g; d < a.length;) + b = f.biAdd(f.biMultiply(b, v), f.biFromNumber(Number(a.substr(d, u)))), + d += u; + b.isNeg = c + } + return b +} +; +f.biCopy = function (a) { + var b = new t(!0); + return b.digits = a.digits.slice(0), + b.isNeg = a.isNeg, + b +} +; +f.reverseStr = function (a) { + for (var b = "", c = a.length - 1; c > -1; --c) + b += a.charAt(c); + return b +} +; +var w = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]; +f.biToString = function (a, b) { + var c = new t; + c.digits[0] = b; + for (var d = f.biDivideModulo(a, c), e = w[d[1].digits[0]]; 1 == f.biCompare(d[0], l);) + d = f.biDivideModulo(d[0], c), + digit = d[1].digits[0], + e += w[d[1].digits[0]]; + return (a.isNeg ? "-" : "") + f.reverseStr(e) +} +; +f.biToDecimal = function (a) { + var b = new t; + b.digits[0] = 10; + for (var c = f.biDivideModulo(a, b), d = String(c[1].digits[0]); 1 == f.biCompare(c[0], l);) + c = f.biDivideModulo(c[0], b), + d += String(c[1].digits[0]); + return (a.isNeg ? "-" : "") + f.reverseStr(d) +} +; +var x = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"]; +f.digitToHex = function (a) { + var b = 15 + , c = ""; + for (i = 0; 4 > i; ++i) + c += x[a & b], + a >>>= 4; + return f.reverseStr(c) +} +; +f.biToHex = function (a) { + var b = ""; + f.biHighIndex(a); + for (var c = f.biHighIndex(a); c > -1; --c) + b += f.digitToHex(a.digits[c]); + return b +} +; +f.charToHex = function (a) { + var b, c = 48, d = c + 9, e = 97, f = e + 25, g = 65, h = 90; + return b = a >= c && d >= a ? a - c : a >= g && h >= a ? 10 + a - g : a >= e && f >= a ? 10 + a - e : 0 +} +; +f.hexToDigit = function (a) { + for (var b = 0, c = Math.min(a.length, 4), d = 0; c > d; ++d) + b <<= 4, + b |= f.charToHex(a.charCodeAt(d)); + return b +} +; +f.biFromHex = function (a) { + for (var b = new t, c = a.length, d = c, e = 0; d > 0; d -= 4, + ++e) + b.digits[e] = f.hexToDigit(a.substr(Math.max(d - 4, 0), Math.min(d, 4))); + return b +} +; +f.biFromString = function (a, b) { + var c = "-" == a.charAt(0) + , d = c ? 1 : 0 + , e = new t + , g = new t; + g.digits[0] = 1; + for (var h = a.length - 1; h >= d; h--) { + var i = a.charCodeAt(h) + , j = f.charToHex(i) + , k = f.biMultiplyDigit(g, j); + e = f.biAdd(e, k), + g = f.biMultiplyDigit(g, b) + } + return e.isNeg = c, + e +} +; +f.biDump = function (a) { + return (a.isNeg ? "-" : "") + a.digits.join(" ") +} +; +f.biAdd = function (a, b) { + var c; + if (a.isNeg != b.isNeg) + b.isNeg = !b.isNeg, + c = f.biSubtract(a, b), + b.isNeg = !b.isNeg; + else { + c = new t; + for (var d, e = 0, g = 0; g < a.digits.length; ++g) + d = a.digits[g] + b.digits[g] + e, + c.digits[g] = d % p, + e = Number(d >= p); + c.isNeg = a.isNeg + } + return c +} +; +f.biSubtract = function (a, b) { + var c; + if (a.isNeg != b.isNeg) + b.isNeg = !b.isNeg, + c = f.biAdd(a, b), + b.isNeg = !b.isNeg; + else { + c = new t; + var d, e; + e = 0; + for (var g = 0; g < a.digits.length; ++g) + d = a.digits[g] - b.digits[g] + e, + c.digits[g] = d % p, + c.digits[g] < 0 && (c.digits[g] += p), + e = 0 - Number(0 > d); + if (-1 == e) { + e = 0; + for (var g = 0; g < a.digits.length; ++g) + d = 0 - c.digits[g] + e, + c.digits[g] = d % p, + c.digits[g] < 0 && (c.digits[g] += p), + e = 0 - Number(0 > d); + c.isNeg = !a.isNeg + } else + c.isNeg = a.isNeg + } + return c +} +; +f.biHighIndex = function (a) { + for (var b = a.digits.length - 1; b > 0 && 0 == a.digits[b];) + --b; + return b +} +; +f.biNumBits = function (a) { + var b, c = f.biHighIndex(a), d = a.digits[c], e = (c + 1) * o; + for (b = e; b > e - o && 0 == (32768 & d); --b) + d <<= 1; + return b +} +; +f.biMultiply = function (a, b) { + for (var c, d, e, g = new t, h = f.biHighIndex(a), i = f.biHighIndex(b), k = 0; i >= k; ++k) { + for (c = 0, + e = k, + j = 0; h >= j; ++j, + ++e) + d = g.digits[e] + a.digits[j] * b.digits[k] + c, + g.digits[e] = d & s, + c = d >>> n; + g.digits[k + h + 1] = c + } + return g.isNeg = a.isNeg != b.isNeg, + g +} +; +f.biMultiplyDigit = function (a, b) { + var c, d, e; + result = new t, + c = f.biHighIndex(a), + d = 0; + for (var g = 0; c >= g; ++g) + e = result.digits[g] + a.digits[g] * b + d, + result.digits[g] = e & s, + d = e >>> n; + return result.digits[1 + c] = d, + result +} +; +f.arrayCopy = function (a, b, c, d, e) { + for (var f = Math.min(b + e, a.length), g = b, h = d; f > g; ++g, + ++h) + c[h] = a[g] +} +; +var y = [0, 32768, 49152, 57344, 61440, 63488, 64512, 65024, 65280, 65408, 65472, 65504, 65520, 65528, 65532, 65534, 65535]; +f.biShiftLeft = function (a, b) { + var c = Math.floor(b / o) + , d = new t; + f.arrayCopy(a.digits, 0, d.digits, c, d.digits.length - c); + for (var e = b % o, g = o - e, h = d.digits.length - 1, i = h - 1; h > 0; --h, + --i) + d.digits[h] = d.digits[h] << e & s | (d.digits[i] & y[e]) >>> g; + return d.digits[0] = d.digits[h] << e & s, + d.isNeg = a.isNeg, + d +} +; +var z = [0, 1, 3, 7, 15, 31, 63, 127, 255, 511, 1023, 2047, 4095, 8191, 16383, 32767, 65535]; +f.biShiftRight = function (a, b) { + var c = Math.floor(b / o) + , d = new t; + f.arrayCopy(a.digits, c, d.digits, 0, a.digits.length - c); + for (var e = b % o, g = o - e, h = 0, i = h + 1; h < d.digits.length - 1; ++h, + ++i) + d.digits[h] = d.digits[h] >>> e | (d.digits[i] & z[e]) << g; + return d.digits[d.digits.length - 1] >>>= e, + d.isNeg = a.isNeg, + d +} +; +f.biMultiplyByRadixPower = function (a, b) { + var c = new t; + return f.arrayCopy(a.digits, 0, c.digits, b, c.digits.length - b), + c +} +; +f.biDivideByRadixPower = function (a, b) { + var c = new t; + return f.arrayCopy(a.digits, b, c.digits, 0, c.digits.length - b), + c +} +; +f.biModuloByRadixPower = function (a, b) { + var c = new t; + return f.arrayCopy(a.digits, 0, c.digits, 0, b), + c +} +; +f.biCompare = function (a, b) { + if (a.isNeg != b.isNeg) + return 1 - 2 * Number(a.isNeg); + for (var c = a.digits.length - 1; c >= 0; --c) + if (a.digits[c] != b.digits[c]) + return a.isNeg ? 1 - 2 * Number(a.digits[c] > b.digits[c]) : 1 - 2 * Number(a.digits[c] < b.digits[c]); + return 0 +} +; +f.biDivideModulo = function (a, b) { + var c, d, e = f.biNumBits(a), g = f.biNumBits(b), h = b.isNeg; + if (g > e) + return a.isNeg ? (c = f.biCopy(m), + c.isNeg = !b.isNeg, + a.isNeg = !1, + b.isNeg = !1, + d = biSubtract(b, a), + a.isNeg = !0, + b.isNeg = h) : (c = new t, + d = f.biCopy(a)), + [c, d]; + c = new t, + d = a; + for (var i = Math.ceil(g / o) - 1, j = 0; b.digits[i] < q;) + b = f.biShiftLeft(b, 1), + ++j, + ++g, + i = Math.ceil(g / o) - 1; + d = f.biShiftLeft(d, j), + e += j; + for (var k = Math.ceil(e / o) - 1, l = f.biMultiplyByRadixPower(b, k - i); -1 != f.biCompare(d, l);) + ++c.digits[k - i], + d = f.biSubtract(d, l); + for (var n = k; n > i; --n) { + var u = n >= d.digits.length ? 0 : d.digits[n] + , v = n - 1 >= d.digits.length ? 0 : d.digits[n - 1] + , w = n - 2 >= d.digits.length ? 0 : d.digits[n - 2] + , x = i >= b.digits.length ? 0 : b.digits[i] + , y = i - 1 >= b.digits.length ? 0 : b.digits[i - 1]; + c.digits[n - i - 1] = u == x ? s : Math.floor((u * p + v) / x); + for (var z = c.digits[n - i - 1] * (x * p + y), A = u * r + (v * p + w); z > A;) + --c.digits[n - i - 1], + z = c.digits[n - i - 1] * (x * p | y), + A = u * p * p + (v * p + w); + l = f.biMultiplyByRadixPower(b, n - i - 1), + d = f.biSubtract(d, f.biMultiplyDigit(l, c.digits[n - i - 1])), + d.isNeg && (d = f.biAdd(d, l), + --c.digits[n - i - 1]) + } + return d = f.biShiftRight(d, j), + c.isNeg = a.isNeg != h, + a.isNeg && (c = h ? f.biAdd(c, m) : f.biSubtract(c, m), + b = f.biShiftRight(b, j), + d = f.biSubtract(b, d)), + 0 == d.digits[0] && 0 == f.biHighIndex(d) && (d.isNeg = !1), + [c, d] +} +; +f.biDivide = function (a, b) { + return f.biDivideModulo(a, b)[0] +} +; +f.biModulo = function (a, b) { + return f.biDivideModulo(a, b)[1] +} +; +f.biMultiplyMod = function (a, b, c) { + return f.biModulo(f.biMultiply(a, b), c) +} +; +f.biPow = function (a, b) { + for (var c = m, d = a; ;) { + if (0 != (1 & b) && (c = f.biMultiply(c, d)), + b >>= 1, + 0 == b) + break; + d = f.biMultiply(d, d) + } + return c +} +; +f.biPowMod = function (a, b, c) { + for (var d = m, e = a, g = b; ;) { + if (0 != (1 & g.digits[0]) && (d = f.biMultiplyMod(d, e, c)), + g = f.biShiftRight(g, 1), + 0 == g.digits[0] && 0 == f.biHighIndex(g)) + break; + e = f.biMultiplyMod(e, e, c) + } + return d +} +; +g.BarrettMu = function (a) { + this.modulus = f.biCopy(a), + this.k = f.biHighIndex(this.modulus) + 1; + var b = new t; + b.digits[2 * this.k] = 1, + this.mu = f.biDivide(b, this.modulus), + this.bkplus1 = new t, + this.bkplus1.digits[this.k + 1] = 1, + this.modulo = c, + this.multiplyMod = d, + this.powMod = e +} +; +var A = function (a, b, c) { + var d = f; + this.e = d.biFromHex(a), + this.d = d.biFromHex(b), + this.m = d.biFromHex(c), + this.chunkSize = 2 * d.biHighIndex(this.m), + this.radix = 16, + this.barrett = new g.BarrettMu(this.m) +}; +f.getKeyPair = function (a, b, c) { + return new A(a, b, c) +}; +"undefined" == typeof g.twoDigit && (g.twoDigit = function (a) { + return (10 > a ? "0" : "") + String(a) + } +); +f.encryptedString = function (a, b) { + for (var c = [], d = b.length, e = 0; d > e;) + c[e] = b.charCodeAt(e), + e++; + for (; 0 != c.length % a.chunkSize;) + c[e++] = 0; + var g, h, i, j = c.length, k = ""; + for (e = 0; j > e; e += a.chunkSize) { + for (i = new t, + g = 0, + h = e; h < e + a.chunkSize; ++g) + i.digits[g] = c[h++], + i.digits[g] += c[h++] << 8; + var l = a.barrett.powMod(i, a.e) + , m = 16 == a.radix ? f.biToHex(l) : f.biToString(l, a.radix); + k += m + " " + } + return k.substring(0, k.length - 1) +}; +f.decryptedString = function (a, b) { + var c, d, e, g = b.split(" "), h = ""; + for (c = 0; c < g.length; ++c) { + var i; + for (i = 16 == a.radix ? f.biFromHex(g[c]) : f.biFromString(g[c], a.radix), + e = a.barrett.powMod(i, a.d), + d = 0; d <= f.biHighIndex(e); ++d) + h += String.fromCharCode(255 & e.digits[d], e.digits[d] >> 8) + } + return 0 == h.charCodeAt(h.length - 1) && (h = h.substring(0, h.length - 1)), + h +}; +f.setMaxDigits(130); +b[a] = g; + +function rsaFun(e) { + var t = "ab86b6371b5318aaa1d3c9e612a9f1264f372323c8c0f19875b5fc3b3fd3afcc1e5bec527aa94bfa85bffc157e4245aebda05389a5357b75115ac94f074aefcd" + , n = "10001" + , a = f.getKeyPair(n, "", t) + , i = f.encryptedString(a, encodeURIComponent(e)).replace(/\s/g, "-"); + return i +} + +console.log(rsaFun("kldlkadnla")); diff --git a/iqiyi/geetest.py b/iqiyi/geetest.py new file mode 100644 index 0000000..d082265 --- /dev/null +++ b/iqiyi/geetest.py @@ -0,0 +1,222 @@ +# -*- coding: utf-8 -*- +# @Time : 2019/10/7 10:43 +# @Author : Esbiya +# @Email : 18829040039@163.com +# @File : geetest.py +# @Software: PyCharm + +import re +import json +import random +import time +import requests +from iqiyi.img_locate import get_distance +from iqiyi.process_trace import get_risk_data +from iqiyi import iqiyi_crypt + + +class IqiyiSliderCracker: + + def __init__(self, dfp): + self.i = iqiyi_crypt.get_random_str(64) + self.r = iqiyi_crypt.get_random_str(32) + # 这个 dfp 参数是个环境参数, 很重要, 是绕过爱奇艺滑块的关键, 我们这里使用的是过期的 dfp 参数, 以便可以触发爱奇艺安全盾 + self.dfp = dfp + self.session = requests.session() + self.session.headers = { + 'Content-Type': 'application/x-www-form-urlencoded', + 'Origin': 'https://www.iqiyi.com', + 'Referer': 'https://www.iqiyi.com/iframe/loginreg?ver=1', + 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.80 Safari/537.36' + } + + def login(self, env_token=''): + """ + 登录, 只有一个加密参数密码, 其他为定值 + 触发滑块, 测试用 + :return: + """ + url = 'https://passport.iqiyi.com/apis/reglogin/login.action' + + encrypt_pwd = iqiyi_crypt.encrypt_pwd('fheniudhqiu') + + data = { + 'email': iqiyi_crypt.get_random_phone(), + 'fromSDK': '1', + 'sdk_version': '1.0.0', + 'passwd': encrypt_pwd, + 'agenttype': '1', + '__NEW': '1', + 'checkExist': '1', + 'lang': '', + 'ptid': '01010021010000000000', + 'nr': '1', + 'verifyPhone': '1', + 'area_code': '86', + 'dfp': self.dfp, + 'env_token': env_token, + 'envinfo': 'eyJqbiI6Ik1vemlsbGEvNS4wIChXaW5kb3dzIE5UIDEwLjA7IFdpbjY0OyB4NjQpIEFwcGxlV2ViS2l0LzUzNy4zNiAoS0hUTUwsIGxpa2UgR2Vja28pIENocm9tZS83NS4wLjM3NzAuODAgU2FmYXJpLzUzNy4zNiIsImNtIjoiemgtQ04iLCJndSI6MjQsInVmIjoxLCJqciI6WzEzNjYsNzY4XSwiZGkiOlsxMzY2LDcyOF0sInpwIjotNDgwLCJ1aCI6MSwic2giOjEsImhlIjoxLCJ6byI6MSwicnYiOiJ1bmtub3duIiwibngiOiJXaW4zMiIsIml3IjoidW5rbm93biIsInFtIjpbIkNocm9tZSBQREYgUGx1Z2luOjpQb3J0YWJsZSBEb2N1bWVudCBGb3JtYXQ6OmFwcGxpY2F0aW9uL3gtZ29vZ2xlLWNocm9tZS1wZGZ+cGRmIiwiQ2hyb21lIFBERiBWaWV3ZXI6Ojo6YXBwbGljYXRpb24vcGRmfnBkZiIsIk5hdGl2ZSBDbGllbnQ6Ojo6YXBwbGljYXRpb24veC1uYWNsfixhcHBsaWNhdGlvbi94LXBuYWNsfiJdLCJ3ciI6ImI3NzY2NGM3MTcwNzdhZmZmMzNhN2QyODM2ZTIzNzdjIiwid2ciOiJlZDI2NTg5MTM1MTJlNTA5MmZlMjE5NDAwOGQ3OWEwZSIsImZrIjpmYWxzZSwicmciOmZhbHNlLCJ4eSI6ZmFsc2UsImptIjpmYWxzZSwiYmEiOmZhbHNlLCJ0bSI6WzAsZmFsc2UsZmFsc2VdLCJhdSI6dHJ1ZSwibWkiOiI5YTZlZWMzMS0xODAxLWI5ZGEtMDU3My1jMTVmOGVhMjVlNDEiLCJjbCI6IlBDV0VCIiwic3YiOiIxLjAiLCJqZyI6IjhkYTZmNDY5NmQ4YmU1ODFkMDliNzE3MTkwNTIxMGI5IiwiZmgiOiI0OGZpem1rcnZkejJ3Y2Q2ZzhqMXNybjkiLCJpZm0iOlt0cnVlLDQ2MCw0MjAsImh0dHBzOi8vd3d3LmlxaXlpLmNvbS8iXSwiZXgiOiIiLCJkdiI6Im9mZiIsInB2Ijp0cnVlfQ==' + } + result = self.session.post(url, data=data).json() + if result['code'] == 'P00223': + print('出现滑块: {}'.format(result)) + return result['data']['data']['token'] + print('滑块验证通过: {}'.format(result)) + return None + + def _init_key(self): + """ + 初始化密钥 + :return: + """ + secure = iqiyi_crypt.generate_secure(self.i, self.r) + # print('secure: {}'.format(secure)) + + url = 'https://qcaptcha.iqiyi.com/api/outer/sbox/sbox_init_key' + data = { + 'secure': secure, + 'platform': 'web', + 'lang': 'zh_cn', + 'langVersion': '6', + 'dfp': 'undefined', + 'authcookie': 'undefined', + 'nifc': 'false' + } + result = self.session.post(url, data=data).json() + if result['code'] == 'A00000': + print('初始化密钥成功! ') + # print('密钥初始化数据: {}'.format(result)) + return { + 'sid': result['data']['sid'], + 'sr': result['data']['sr'] + } + return None + + def format_origin_data(self, token): + """ + 构造滑块初始化加密字符串 + :param token: + :return: + """ + return json.dumps({ + 't': int(time.time() * 1000), + 'token': token, + 'width': 290, + 'height': 170, + 'clientVersion': 1, + 'dfp': self.dfp, + 'extend': json.dumps({ + "dfp": self.dfp, + "ptid": "01010021010000000000", + "agentType": 1, + "deviceId": "268f8fe0ab5234ce32705696d288397e", + "areaCode": "86" + } + )}).replace(' ', '') + + def _init_slider(self, token, aes_key, hmac_key, sid): + """ + 初始化滑块 + :param token: + :param aes_key: AES 密钥 + :param hmac_key hmac 密钥 + :param sid: 密钥认证参数 + :return: + """ + url = 'https://qcaptcha.iqiyi.com/api/outer/verifycenter/initpage' + + origin_data = self.format_origin_data(token) + cryptsrc_data = iqiyi_crypt.crypt_srcdata(aes_key, hmac_key, origin_data) + + encrypt_data = { + 'cryptSrcData': cryptsrc_data, + 'cryptVersion': 'web|20180418xkdewxe3dkxu9|' + sid, + 'platform': 'web', + 'nifc': 'false' + } + # print('提交表单: {}'.format(encrypt_data)) + resp = self.session.post(url, data=encrypt_data) + # print('验证码初始化接口返回加密数据: {}'.format(resp.text)) + decrypt_data = json.loads(iqiyi_crypt.aes_decrypt(aes_key, resp.text.split('|')[0])[:-4]) + # print('AES 解密后数据: {}'.format(decrypt_data)) + init_data = decrypt_data['data']['initData'] + print('滑块初始化成功! ') + return init_data + + def format_verify_data(self, token, distance, start_time, ypos): + """ + 构造提交表单 + :param token: + :param distance: + :param start_time: + :param ypos: + :return: + """ + risk_data = get_risk_data(distance, start_time, ypos) + time.sleep(random.uniform(0.5, 1.5)) + return json.dumps({ + "t": int(time.time() * 1000), + "token": token, + "staticVerifyValue": distance, + "riskData": json.dumps(risk_data), + "clientVersion": 1, + "platform": "web", + "dfp": self.dfp + }).replace(' ', '') + + def _slider_verify(self, post_data, aes_key, hmac_key, sid): + """ + 最终验证 + :param post_data: 提交表单 + :param aes_key: AES 密钥 + :param hmac_key hmac 密钥 + :param sid: 密钥认证参数, 服务器用来识别你加密的密钥, 从而解密你提交的表单 + :return: + """ + url = 'https://qcaptcha.iqiyi.com/api/outer/verifycenter/verify' + data = { + 'cryptSrcData': iqiyi_crypt.crypt_srcdata(aes_key, hmac_key, post_data), + 'cryptVersion': 'web|20180418xkdewxe3dkxu9|' + sid, + 'platform': 'web', + 'noCryptToken': 'undefined', + 'nifc': 'false' + } + resp = self.session.post(url, data=data) + print('接口返回的加密数据: {}'.format(resp.text)) + result = json.loads(re.search('{(.*?)}', iqiyi_crypt.aes_decrypt(aes_key, resp.text.split('|')[0])).group(0)) + print('AES 解密后的数据: {}'.format(result)) + return result + + def crack(self): + """ + 整个破解流程 + :return: + """ + # 登录触发滑块, 注意要使用过期的 dfp 参数, + token = self.login() + key_data = self._init_key() + aes_key = iqiyi_crypt.generate_aeskey(self.i, self.r, key_data['sr']) + hmac_key = iqiyi_crypt.generate_hmackey(self.i, self.r, key_data['sr']) + init_data = self._init_slider(token, aes_key, hmac_key, key_data['sid']) + start_time = int(time.time() * 1000) + time.sleep(random.uniform(0.1, 0.5)) + distance = get_distance(init_data) + verify_data = self.format_verify_data(token, distance, start_time, init_data['iconYOffset']) + result = self._slider_verify(verify_data, aes_key, hmac_key, key_data['sid']) + if result['code'] == "A00000": + return { + 'success': 1, + 'message': '校验通过! ', + 'data': { + 'env_token': result['data'] + } + } + return { + 'success': 0, + 'message': result['msg'], + 'data': None + } + + +if __name__ == '__main__': + pass diff --git a/iqiyi/img_locate.py b/iqiyi/img_locate.py new file mode 100644 index 0000000..c7749f8 --- /dev/null +++ b/iqiyi/img_locate.py @@ -0,0 +1,132 @@ +# -*- coding: utf-8 -*- +# @Time : 2019/10/9 11:31 +# @Author : Esbiya +# @Email : 18829040039@163.com +# @File : img_locate.py +# @Software: PyCharm + +import os +import requests +from PIL import Image +import cv2 +import numpy as np + + +def _pic_download(url, type): + """ + 图片下载 + :param url: + :param type: + :return: + """ + img_path = os.path.abspath('...') + '\\' + '{}.jpg'.format(type) + img_data = requests.get(url).content + with open(img_path, 'wb') as f: + f.write(img_data) + return img_path + + +def merge_captcha(init_data): + """ + 还原验证码背景图 + :param init_data: 验证码初始化数据 + :return: + """ + per_width = init_data['imageBlockPerWidth'] + per_height = init_data['imageBlockPerHeight'] + merge_array = init_data['imageBlockOffset'] + captcha_url = 'https://qcaptcha.iqiyi.com' + init_data['imageBgUrl'] + captcha_path = _pic_download(captcha_url, 'captcha') + image = Image.open(captcha_path) + + new_image = Image.new('RGB', image.size) + for s in range(2): + for p in range(len(merge_array[0])): + d = merge_array[s] + h = len(d) + l = d[h - 1] + G = d[p] + v = G['t1'] * per_width + Z = G['t2'] * per_height + g = per_width + W = per_height + if G['t1'] > l['t1']: + v += 290 - per_width * h + if p == h - 1: + g = 290 - per_width * p + if s == 1: + W = 170 - per_height * s + imgcrop = image.crop((v, Z, v + g, Z + W)) + new_image.paste(imgcrop, (p * per_width, s * per_height)) + new_image.save(captcha_path) + # new_image.show() + return captcha_path + + +def _cut_slider(path): + """ + 滑块切割 + :return: + """ + image = Image.open(path) + x = [] + y = [] + for i in range(image.size[0]): + for j in range(image.size[1]): + pix = image.load()[i, j] + if pix != 255: + x.append(i) + y.append(j) + z = (np.min(x), np.min(y), np.max(x), np.max(y)) + result = image.crop(z) + result.convert('RGB').save('targ.jpg') + # result.show() + return result.size[0], result.size[1] + + +def get_distance(init_data): + """ + 获取缺口距离 + :param init_data: 验证码初始化数据 + :return: + """ + slider_url = 'https://qcaptcha.iqiyi.com' + init_data['iconUrl'] + slider_path = _pic_download(slider_url, 'slider') + w, h = Image.open('slider.jpg').size + + # 验证码图片还原 + captcha_path = merge_captcha(init_data) + + # # 计算拼图还原距离 + target = cv2.imread(slider_path, 0) + template = cv2.imread(captcha_path, 0) + temp = 'temp.jpg' + targ = 'targ.jpg' + cv2.imwrite(targ, target) + cv2.imwrite(temp, template) + + template = cv2.imread(temp) + template = cv2.cvtColor(template, cv2.COLOR_BGR2GRAY) + template = abs(255 - template) + cv2.imwrite(temp, template) + w, h = _cut_slider('targ.jpg') + target = cv2.imread(targ) + target = cv2.cvtColor(target, cv2.COLOR_BGR2GRAY) + target = abs(255 - target) + cv2.imwrite(targ, target) + target = cv2.imread(targ) + template = cv2.imread(temp) + result = cv2.matchTemplate(target, template, cv2.TM_CCOEFF_NORMED) + x, y = np.unravel_index(result.argmax(), result.shape) + + # 调用PIL Image 做测试 + image = Image.open(captcha_path) + + xy = (y, x, y + w, x + h) + # 切割 + imagecrop = image.crop(xy) + # 保存切割的缺口 + imagecrop.convert('RGB').save("new_image.jpg") + imagecrop.show() + return int(y) + diff --git a/iqiyi/iqiyi_crypt.py b/iqiyi/iqiyi_crypt.py new file mode 100644 index 0000000..79a9580 --- /dev/null +++ b/iqiyi/iqiyi_crypt.py @@ -0,0 +1,324 @@ +# -*- coding: utf-8 -*- +# @Time : 2019/10/9 14:28 +# @Author : Esbiya +# @Email : 18829040039@163.com +# @File : iqiyi_crypt.py +# @Software: PyCharm + + +import execjs +import base64 +import random +import hmac +import hashlib +from cryptography.hazmat.primitives import padding +from cryptography.hazmat.primitives.ciphers import algorithms +from Crypto.Cipher import AES +from Crypto.Cipher import PKCS1_v1_5 as Cipher_pkcs1_v1_5 +from Crypto.PublicKey import RSA +from binascii import b2a_hex, a2b_hex + + +class AESCrypt: + """ + AES 加解密 + """ + + def __init__(self, key): + self.key = key.encode('utf-8') + self.iv = b"qwertyuiopasdfgh" # 偏移量 定值 + + # 加密函数,如果text不足16位就用空格补足为16位, + # 如果大于16当时不是16的倍数,那就补足为16的倍数。 + def encrypt(self, text): + """ + 加密 + :param text: 密文 + :return: + """ + cryptor = AES.new(self.key, AES.MODE_CBC, self.iv) + text = text.encode('utf-8') + + # 这里密钥key 长度必须为16(AES-128), + # 24(AES-192),或者32 (AES-256)Bytes 长度 + # 目前AES-128 足够目前使用 + + text = self.pkcs7_padding(text) + + ciphertext = cryptor.encrypt(text) + + # 因为AES加密时候得到的字符串不一定是ascii字符集的,输出到终端或者保存时候可能存在问题 + # 所以这里统一把加密后的字符串转化为16进制字符串 "Kd34yA0KlX5E6g06WVy187bKxgTtg1M0Ml5vXK859Ooy7ACjXGdLZH1Y2xbNbAfL" "wpgNVJD3xtv3oVzPDD4U8EiAJLijmCtQ" + return b2a_hex(ciphertext).decode('ISO-8859-1') + + @staticmethod + def process_decrypt(text): + """ + 处理解密文本 + :param text: 待处理加密字符串 + :return: + """ + js = """ + // require 导入 crypto-js + var CryptoJS = require("C:\\\\Users\\\\Administrator\\\\node_modules\\\\crypto-js"); + function process_text(text) { + return CryptoJS.enc.Base64.stringify(CryptoJS.enc.Hex.parse(text)) + } + """ + ctx = execjs.compile(js) + return ctx.call('process_text', text) + + def decrypt(self, text): + """ + 解密 + :param text: 密文 + :return: + """ + # 偏移量'abcdefg' + if not isinstance(text, bytes): + text = text.encode() + cryptor = AES.new(self.key, AES.MODE_CBC, self.iv) + try: + plain_text = cryptor.decrypt(a2b_hex(text)) + return bytes.decode(plain_text).rstrip() + except: + # base64加密后的解密 + text = self.process_decrypt(text) + print(text) + plain_text = cryptor.decrypt(base64.decodebytes(text)).decode() + return plain_text[0:-ord(plain_text[-1])] + + @staticmethod + def pkcs7_padding(data): + if not isinstance(data, bytes): + data = data.encode() + + padder = padding.PKCS7(algorithms.AES.block_size).padder() + + padded_data = padder.update(data) + padder.finalize() + + return padded_data + + @staticmethod + def pkcs7_unpadding(padded_data): + unpadder = padding.PKCS7(algorithms.AES.block_size).unpadder() + data = unpadder.update(padded_data) + + try: + uppadded_data = data + unpadder.finalize() + except ValueError: + raise Exception('无效的加密信息! ') + else: + return uppadded_data + + +def generate_aeskey(i, r, sr): + """ + 生成 AES 密钥 + :param i + :param r + :param sr + :return: + """ + aes_key = sha256_encrypt(i)[:4] + sha256_encrypt(r)[:8] + sha256_encrypt(sr)[:4] + return aes_key + + +def generate_hmackey(i, r, sr): + """ + 生成 hMac 密钥 + :param i + :param r + :param sr + :return: + """ + hmac_key = sha256_encrypt(i)[8: 12] + sha256_encrypt(r)[8: 16] + sha256_encrypt(sr)[8:12] + return hmac_key + + +def rsa_encrypt(text): + """ + RSA 加密 + :param text: + :return: + """ + with open('rsa_encrypt.js', 'rb') as f: + js = f.read().decode() + ctx = execjs.compile(js) + return ctx.call('RSAEncrypt', text) + + +def process_rsa(text): + """ + 处理 rsa 加密明文 + :return: + """ + js = """ + function process_rsa(x) { + for (var c = [], t = 0; t < x.length; t += 2) + c.push(parseInt(x.substr(t, 2), 16)); + return c + } + """ + ctx = execjs.compile(js) + return ctx.call('process_rsa', text) + + +# def rsa_encrypt(text): +# """ +# RSA 加密 +# :param text: 明文 +# :return: +# """ +# public_key = '\n'.join([ +# "-----BEGIN PUBLIC KEY-----", +# "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCfyy01w1BXvMX8hc0ooyaCcXv2A0fsqDjcEXZ8AQJSHU00iG9YoYyLwmS0G9eE+dEFomOI2a+mrh9JYpw2Y26oGFZFA8Dtly5Go4nXeFT/pEeSwWINcXQ5Y9WCMTkQ+RN5WJ0UPvWt+soqP3Z5FJdMJTWA4lwIyoN3c4d9dWcpkQIDAQAB", +# "-----END PUBLIC KEY-----" +# ]) +# print(public_key) +# rsa_key = RSA.importKey(public_key) +# encrypter = Cipher_pkcs1_v1_5.new(rsa_key) +# cipher = base64.b64encode(encrypter.encrypt(process_rsa(text))) +# return cipher.decode() + + +def sha256_encrypt(text): + """ + sha256 加密 + :param text: 明文 + :return: + """ + sha256 = hashlib.sha256() + sha256.update(text.encode()) + return sha256.hexdigest() + + +def aes_encrypt(key, text): + """ + AES 加密 + :param key: 密钥 + :param text: 明文 + :return: + """ + encrypter = AESCrypt(key) + return encrypter.encrypt(text) + + +def aes_decrypt(key, text): + """ + AES 解密 + :param key: 密钥 + :param text: 密文 + :return: + """ + decryter = AESCrypt(key) + return decryter.decrypt(text) + + +def hamc_encrypt(key, text): + """ + hMac sha256 加密 + :param key: 密钥 + :param text: 明文 + :return: + """ + return hmac.new(key.encode(), text.encode(), digestmod=hashlib.sha256).hexdigest().upper() + + +def crypt_srcdata(aes_key, hmac_key, text): + """ + 生成 cryptSrcdata 参数 + :param aes_key: AES 密钥 + :param hmac_key: hmac 密钥 + :param text: 待加密表单字符串 + :return: + """ + aes_str = aes_encrypt(aes_key, text) + hmac_str = hamc_encrypt(hmac_key, aes_str) + cryptsrc_data = aes_str + '|' + hmac_str + return cryptsrc_data + + +def get_random_phone(): + """ + 生成随机11位电话号码, 用作测试 + :return: + """ + return '1' + ''.join(random.sample(['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'], 10)) + + +def encrypt_pwd(password): + """ + RSA 加密, 修改过的 + :return: + """ + with open('encrypt_pwd.js', 'rb') as f: + js = f.read().decode() + ctx = execjs.compile(js) + return ctx.call('rsaFun', password) + + +def get_random_str(num): + """ + 根据当前时间生成指定长度的随机字符串 + :param num: 字符串长度 + :return: + """ + with open('random_str.js', 'rb') as f: + js = f.read().decode() + ctx = execjs.compile(js) + return ctx.call('getRandomStr', num) + + +def encode_r_str(r): + """ + 编码 随机 32 位字符串 r + :return: + """ + js = """ + function encodeR(x) { + for (var c = [], t = 0, e = x["length"]; t < e; t++) { + var _ = Number(x["charCodeAt"](t)).toString(16); + 1 == _["length"] && (_ = "0" + _), + c["push"](_) + } + return c["join"]("") + } + """ + ctx = execjs.compile(js) + return ctx.call('encodeR', r) + + +def decode_rsa_str(rsa_str): + """ + 解码 RSA 字符串 + :param rsa_str + :return: + """ + with open('decode_rsa.js', 'rb') as f: + js = f.read().decode() + ctx = execjs.compile(js) + return ctx.call('decodeRSA', rsa_str) + + +def generate_secure(i, r): + """ + 传输字符串给后台生成初始化密钥 + :param i: 随机 64 位字符串 + :param r: 随机 32 位字符串 + :return: + """ + encode_str = encode_r_str(r) + # print(encode_str) + rsa_str = rsa_encrypt(encode_str) + # print(rsa_str) + decode_str = decode_rsa_str(rsa_str) + # print(decode_str) + sha256_str = sha256_encrypt("web20180418xkdewxe3dkxu9" + i + decode_str) + # print(sha256_str) + secure = "web|20180418xkdewxe3dkxu9|" + i + "|" + decode_str + "|" + sha256_str + "|1|1|1" + return secure + + +if __name__ == '__main__': + pass diff --git a/iqiyi/new_captcha.jpg b/iqiyi/new_captcha.jpg new file mode 100644 index 0000000..3708ebb Binary files /dev/null and b/iqiyi/new_captcha.jpg differ diff --git a/iqiyi/new_image.jpg b/iqiyi/new_image.jpg new file mode 100644 index 0000000..172e034 Binary files /dev/null and b/iqiyi/new_image.jpg differ diff --git a/iqiyi/process_trace.py b/iqiyi/process_trace.py new file mode 100644 index 0000000..b01326f --- /dev/null +++ b/iqiyi/process_trace.py @@ -0,0 +1,164 @@ +# -*- coding: utf-8 -*- +# @Time : 2019/10/9 9:29 +# @Author : Esbiya +# @Email : 18829040039@163.com +# @File : img_process.py +# @Software: PyCharm + +import time +import random + + +def get_required_origin_data(post_data_length, trace): + """ + 将轨迹数组按照5个一组重新排列 + :param post_data_length: + :param trace: + :return: + """ + required_origin_data = [] + a = 0 + per = int((len(trace) - 4) / 20) + for _ in range(post_data_length): + required_origin_data.append(trace[a: a + 5]) + a += per + return required_origin_data + + +def get_acceleration(data): + """ + 处理轨迹数据生成加速度等信息 + :param data: 一组长度为5的轨迹数组 + :return: + """ + u = [] + i = len(data) - 1 + while i > 0: + u.append((data[i]['x'] - data[i - 1]['x']) / (data[i]['date'] - data[i - 1]['date'])) + i -= 1 + t = len(u) - 1 + a = [] + while t > 0: + a.append((u[t] + u[t - 1]) / 2) + t -= 1 + e = a[1] + _ = (a[0] - a[2]) / (data[3]['date'] - data[1]['date']) + + return { + 'x': data[2]['x'], + 'y': data[2]['y'], + 'date': data[2]['date'], + 'v': e, + 'aspeed': _ + } + + +def process_trace(trace): + """ + 处理轨迹 + :param trace: + :return: + """ + speed_and_aspeed = [] + post_data_length = len(trace) - 4 + if post_data_length >= 20: + post_data_length = 20 + required_origin_data = get_required_origin_data(post_data_length, trace) + for i in range(post_data_length): + process_data = required_origin_data[i] + speed_and_aspeed.append(get_acceleration(process_data)) + return speed_and_aspeed + + +def _generate_trace(distance, ypos): + """ + 生成轨迹 + :param distance: 缺口距离 + :param ypos: y 坐标 + :return: + """ + start_x = random.randint(105, 120) + back = random.randint(2, 6) + distance += back + # 初速度 + v = 0 + # 位移/轨迹列表,列表内的一个元素代表0.02s的位移 + tracks_list = [] + # 当前的位移 + current = 0 + while current < distance - 13: + # 加速度越小,单位时间的位移越小,模拟的轨迹就越多越详细 + a = random.randint(10000, 12000) # 加速运动 + # 初速度 + v0 = v + t = random.randint(9, 18) + s = v0 * t / 1000 + 0.5 * a * ((t / 1000) ** 2) + # 当前的位置 + current += s + # 速度已经达到v,该速度作为下次的初速度 + v = v0 + a * t / 1000 + # 添加到轨迹列表 + if current < distance: + tracks_list.append(round(current)) + # 减速慢慢滑 + if round(current) < distance: + for i in range(round(current) + 1, distance + 1): + tracks_list.append(i) + else: + for i in range(tracks_list[-1] + 1, distance + 1): + tracks_list.append(i) + # 回退 + for _ in range(back): + current -= 1 + tracks_list.append(round(current)) + tracks_list.append(round(current) - 1) + if tracks_list[-1] != distance - back: + tracks_list.append(distance - back) + # 生成时间戳列表 + timestamp_list = [] + timestamp = int(time.time() * 1000) + for i in range(len(tracks_list)): + t = random.randint(11, 18) + timestamp += t + timestamp_list.append(timestamp) + i += 1 + y_list = [] + zy = 0 + for j in range(len(tracks_list)): + y = random.choice( + [0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, + -1, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, -1, 0, 0]) + zy += y + y_list.append(zy) + j += 1 + trace = [] + for index, x in enumerate(tracks_list): + trace.append({ + 'x': x + start_x, + 'y': y_list[index] + ypos, + 'date': timestamp_list[index] + }) + return trace[: -1] + + +def get_risk_data(distance, start_time, ypos): + """ + 根据缺口距离构造轨迹数组并处理成提交表单样式 + :return: + """ + trace = _generate_trace(distance, ypos) + speed_and_aspeed = process_trace(trace) + time.sleep(random.uniform(0.3, 0.6)) + arrive_time = int(time.time() * 1000) + spend_time = arrive_time - start_time + return { + 'click_times': 1, + 'arrive_time': arrive_time, + 'click_frequency': 1 / spend_time * 1000, + 'spend_time': spend_time, + 'speed_and_aspeed': speed_and_aspeed + } + + +if __name__ == '__main__': + pass diff --git a/iqiyi/random_str.js b/iqiyi/random_str.js new file mode 100644 index 0000000..86515d7 --- /dev/null +++ b/iqiyi/random_str.js @@ -0,0 +1,24 @@ +function f(h) { + return (h = ((9301 * h) + 49297) % 233280) / 233280 +} +function o(x, h) { + return Math["ceil"](f(h) * x) +} +function getRandomStr(x) { + var c = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", + "U", "V", "W", "X", "Y", "Z", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", + "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "0", "1", "2", "3", "4", "5", "6", "7", + "8", "9"]; + var c_ = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + var a = c["length"]; + for (var _ = "", i = 0; i < x; i++) { + var h = (new Date)["getTime"]() + Math.ceil((10 * Math["random"]()) * c_["length"]); + var r = o(a, h) - 1; + r < 0 && (r = 0); + r > a && (r = a); + _ += c[r] + } + return _; +} + +console.log(getRandomStr(64)); diff --git a/iqiyi/rsa_encrypt.js b/iqiyi/rsa_encrypt.js new file mode 100644 index 0000000..8712c4e --- /dev/null +++ b/iqiyi/rsa_encrypt.js @@ -0,0 +1,8 @@ +// 已删除关键 js, RSA 加密, 请自行补全 + +function RSAEncrypt(text) { + var encrypter = new zc(); + var publicKey = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCfyy01w1BXvMX8hc0ooyaCcXv2A0fsqDjcEXZ8AQJSHU00iG9YoYyLwmS0G9eE+dEFomOI2a+mrh9JYpw2Y26oGFZFA8Dtly5Go4nXeFT/pEeSwWINcXQ5Y9WCMTkQ+RN5WJ0UPvWt+soqP3Z5FJdMJTWA4lwIyoN3c4d9dWcpkQIDAQAB"; + encrypter.setPublicKey(publicKey); + return encrypter.encrypt(a(text)) +} diff --git a/iqiyi/slider.jpg b/iqiyi/slider.jpg new file mode 100644 index 0000000..af1a7b8 Binary files /dev/null and b/iqiyi/slider.jpg differ diff --git a/iqiyi/targ.jpg b/iqiyi/targ.jpg new file mode 100644 index 0000000..6edef0d Binary files /dev/null and b/iqiyi/targ.jpg differ diff --git a/iqiyi/temp.jpg b/iqiyi/temp.jpg new file mode 100644 index 0000000..c12b3ff Binary files /dev/null and b/iqiyi/temp.jpg differ diff --git a/iqiyi/test.py b/iqiyi/test.py new file mode 100644 index 0000000..43f0c6a --- /dev/null +++ b/iqiyi/test.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# @Time : 2019/10/9 16:31 +# @Author : Esbiya +# @Email : 18829040039@163.com +# @File : test.py +# @Software: PyCharm + +from iqiyi.geetest import IqiyiSliderCracker + + +def main(dfp): + x = IqiyiSliderCracker(dfp).crack() + print(x) + if x['success']: + IqiyiSliderCracker(dfp).login(x['data']['env_token']) + + +if __name__ == '__main__': + dfp = 'a14276d7cc6c11427090d0b9dd4f48657a8b0e9d57769b1809e310381e1ce1fada' + main(dfp) diff --git a/view/aiqiyi.png b/view/aiqiyi.png new file mode 100644 index 0000000..8191b6e Binary files /dev/null and b/view/aiqiyi.png differ diff --git a/xiecheng/xc_slider.js b/xiecheng/xc_slider.js index 068bfb0..2cff2c9 100644 --- a/xiecheng/xc_slider.js +++ b/xiecheng/xc_slider.js @@ -1,883 +1,3 @@ -var C = function (a, b) { - var c = {} - , d = c.lib = {} - , e = d.Base = function () { - function a() { - } - - return { - extend: function (b) { - a.prototype = this; - var c = new a; - b && c.mixIn(b); - c.$super = this; - return c - }, - create: function () { - var a = this.extend(); - a.init.apply(a, arguments); - return a - }, - init: function () { - }, - mixIn: function (a) { - for (var b in a) - a.hasOwnProperty(b) && (this[b] = a[b]); - a.hasOwnProperty("toString") && (this.toString = a.toString) - }, - clone: function () { - return this.$super.extend(this) - } - } - }() - , g = d.WordArray = e.extend({ - init: function (a, c) { - a = this.words = a || []; - this.sigBytes = c != b ? c : 4 * a.length - }, - toString: function (a) { - return (a || q).stringify(this) - }, - concat: function (a) { - var b = this.words - , c = a.words - , h = this.sigBytes; - a = a.sigBytes; - this.clamp(); - if (h % 4) - for (var p = 0; p < a; p++) - b[h + p >>> 2] |= (c[p >>> 2] >>> 24 - p % 4 * 8 & 255) << 24 - (h + p) % 4 * 8; - else if (65535 < c.length) - for (p = 0; p < a; p += 4) - b[h + p >>> 2] = c[p >>> 2]; - else - b.push.apply(b, c); - this.sigBytes += a; - return this - }, - clamp: function () { - var b = this.words - , c = this.sigBytes; - b[c >>> 2] &= 4294967295 << 32 - c % 4 * 8; - b.length = a.ceil(c / 4) - }, - clone: function () { - var a = e.clone.call(this); - a.words = this.words.slice(0); - return a - }, - random: function (b) { - for (var c = [], d = 0; d < b; d += 4) - c.push(4294967296 * a.random() | 0); - return g.create(c, b) - } - }) - , f = c.enc = {} - , q = f.Hex = { - stringify: function (a) { - var b = a.words; - a = a.sigBytes; - for (var c = [], h = 0; h < a; h++) { - var p = b[h >>> 2] >>> 24 - h % 4 * 8 & 255; - c.push((p >>> 4).toString(16)); - c.push((p & 15).toString(16)) - } - return c.join("") - }, - parse: function (a) { - for (var b = a.length, c = [], h = 0; h < b; h += 2) - c[h >>> 3] |= parseInt(a.substr(h, 2), 16) << 24 - h % 8 * 4; - return g.create(c, b / 2) - } - } - , v = f.Latin1 = { - stringify: function (a) { - var b = a.words; - a = a.sigBytes; - for (var c = [], h = 0; h < a; h++) - c.push(String.fromCharCode(b[h >>> 2] >>> 24 - h % 4 * 8 & 255)); - return c.join("") - }, - parse: function (a) { - for (var b = a.length, c = [], h = 0; h < b; h++) - c[h >>> 2] |= (a.charCodeAt(h) & 255) << 24 - h % 4 * 8; - return g.create(c, b) - } - } - , u = f.Utf8 = { - stringify: function (a) { - try { - return decodeURIComponent(escape(v.stringify(a))) - } catch (td) { - throw Error("Malformed UTF-8 data"); - } - }, - parse: function (a) { - return v.parse(unescape(encodeURIComponent(a))) - } - } - , ja = d.BufferedBlockAlgorithm = e.extend({ - reset: function () { - this._data = g.create(); - this._nDataBytes = 0 - }, - _append: function (a) { - "string" == typeof a && (a = u.parse(a)); - this._data.concat(a); - this._nDataBytes += a.sigBytes - }, - _process: function (b) { - var c = this._data - , d = c.words - , h = c.sigBytes - , p = this.blockSize - , e = h / (4 * p); - e = b ? a.ceil(e) : a.max((e | 0) - this._minBufferSize, 0); - b = e * p; - h = a.min(4 * b, h); - if (b) { - for (var va = 0; va < b; va += p) - this._doProcessBlock(d, va); - va = d.splice(0, b); - c.sigBytes -= h - } - return g.create(va, h) - }, - clone: function () { - var a = e.clone.call(this); - a._data = this._data.clone(); - return a - }, - _minBufferSize: 0 - }); - d.Hasher = ja.extend({ - init: function () { - this.reset() - }, - reset: function () { - ja.reset.call(this); - this._doReset() - }, - update: function (a) { - this._append(a); - this._process(); - return this - }, - finalize: function (a) { - a && this._append(a); - this._doFinalize(); - return this._hash - }, - clone: function () { - var a = ja.clone.call(this); - a._hash = this._hash.clone(); - return a - }, - blockSize: 16, - _createHelper: function (a) { - return function (b, c) { - return a.create(c).finalize(b) - } - }, - _createHmacHelper: function (a) { - return function (b, c) { - return ua.HMAC.create(a, c).finalize(b) - } - } - }); - var ua = c.algo = {}; - return c -}(Math); -(function () { - var a = C - , b = a.lib.WordArray; - a.enc.Base64 = { - stringify: function (a) { - var b = a.words - , c = a.sigBytes - , g = this._map; - a.clamp(); - a = []; - for (var f = 0; f < c; f += 3) - for (var q = (b[f >>> 2] >>> 24 - f % 4 * 8 & 255) << 16 | (b[f + 1 >>> 2] >>> 24 - (f + 1) % 4 * 8 & 255) << 8 | b[f + 2 >>> 2] >>> 24 - (f + 2) % 4 * 8 & 255, v = 0; 4 > v && f + .75 * v < c; v++) - a.push(g.charAt(q >>> 6 * (3 - v) & 63)); - if (b = g.charAt(64)) - for (; a.length % 4;) - a.push(b); - return a.join("") - }, - parse: function (a) { - a = a.replace(/\s/g, ""); - var c = a.length - , e = this._map - , g = e.charAt(64); - g && (g = a.indexOf(g), - -1 != g && (c = g)); - g = []; - for (var f = 0, q = 0; q < c; q++) - if (q % 4) { - var v = e.indexOf(a.charAt(q - 1)) << q % 4 * 2 - , u = e.indexOf(a.charAt(q)) >>> 6 - q % 4 * 2; - g[f >>> 2] |= (v | u) << 24 - f % 4 * 8; - f++ - } - return b.create(g, f) - }, - _map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=" - } - } -)(); -(function (a) { - function b(a, b, c, d, e, h, p) { - a = a + (b & c | ~b & d) + e + p; - return (a << h | a >>> 32 - h) + b - } - - function c(a, b, c, d, e, h, p) { - a = a + (b & d | c & ~d) + e + p; - return (a << h | a >>> 32 - h) + b - } - - function d(a, b, c, d, e, h, p) { - a = a + (b ^ c ^ d) + e + p; - return (a << h | a >>> 32 - h) + b - } - - function e(a, b, c, d, e, h, p) { - a = a + (c ^ (b | ~d)) + e + p; - return (a << h | a >>> 32 - h) + b - } - - var g = C - , f = g.lib - , q = f.WordArray; - f = f.Hasher; - var v = g.algo - , u = []; - (function () { - for (var b = 0; 64 > b; b++) - u[b] = 4294967296 * a.abs(a.sin(b + 1)) | 0 - } - )(); - v = v.MD5 = f.extend({ - _doReset: function () { - this._hash = q.create([1732584193, 4023233417, 2562383102, 271733878]) - }, - _doProcessBlock: function (a, g) { - for (var f = 0; 16 > f; f++) { - var q = g + f - , y = a[q]; - a[q] = (y << 8 | y >>> 24) & 16711935 | (y << 24 | y >>> 8) & 4278255360 - } - q = this._hash.words; - y = q[0]; - var h = q[1] - , p = q[2] - , H = q[3]; - for (f = 0; 64 > f; f += 4) - 16 > f ? (y = b(y, h, p, H, a[g + f], 7, u[f]), - H = b(H, y, h, p, a[g + f + 1], 12, u[f + 1]), - p = b(p, H, y, h, a[g + f + 2], 17, u[f + 2]), - h = b(h, p, H, y, a[g + f + 3], 22, u[f + 3])) : 32 > f ? (y = c(y, h, p, H, a[g + (f + 1) % 16], 5, u[f]), - H = c(H, y, h, p, a[g + (f + 6) % 16], 9, u[f + 1]), - p = c(p, H, y, h, a[g + (f + 11) % 16], 14, u[f + 2]), - h = c(h, p, H, y, a[g + f % 16], 20, u[f + 3])) : 48 > f ? (y = d(y, h, p, H, a[g + (3 * f + 5) % 16], 4, u[f]), - H = d(H, y, h, p, a[g + (3 * f + 8) % 16], 11, u[f + 1]), - p = d(p, H, y, h, a[g + (3 * f + 11) % 16], 16, u[f + 2]), - h = d(h, p, H, y, a[g + (3 * f + 14) % 16], 23, u[f + 3])) : (y = e(y, h, p, H, a[g + 3 * f % 16], 6, u[f]), - H = e(H, y, h, p, a[g + (3 * f + 7) % 16], 10, u[f + 1]), - p = e(p, H, y, h, a[g + (3 * f + 14) % 16], 15, u[f + 2]), - h = e(h, p, H, y, a[g + (3 * f + 5) % 16], 21, u[f + 3])); - q[0] = q[0] + y | 0; - q[1] = q[1] + h | 0; - q[2] = q[2] + p | 0; - q[3] = q[3] + H | 0 - }, - _doFinalize: function () { - var a = this._data - , b = a.words - , c = 8 * this._nDataBytes - , d = 8 * a.sigBytes; - b[d >>> 5] |= 128 << 24 - d % 32; - b[(d + 64 >>> 9 << 4) + 14] = (c << 8 | c >>> 24) & 16711935 | (c << 24 | c >>> 8) & 4278255360; - a.sigBytes = 4 * (b.length + 1); - this._process(); - a = this._hash.words; - for (b = 0; 4 > b; b++) - c = a[b], - a[b] = (c << 8 | c >>> 24) & 16711935 | (c << 24 | c >>> 8) & 4278255360 - } - }); - g.MD5 = f._createHelper(v); - g.HmacMD5 = f._createHmacHelper(v) - } -)(Math); -(function () { - var a = C - , b = a.lib - , c = b.Base - , d = b.WordArray; - b = a.algo; - var e = b.EvpKDF = c.extend({ - cfg: c.extend({ - keySize: 4, - hasher: b.MD5, - iterations: 1 - }), - init: function (a) { - this.cfg = this.cfg.extend(a) - }, - compute: function (a, b) { - var c = this.cfg - , f = c.hasher.create() - , e = d.create() - , g = e.words - , k = c.keySize; - for (c = c.iterations; g.length < k;) { - l && f.update(l); - var l = f.update(a).finalize(b); - f.reset(); - for (var n = 1; n < c; n++) - l = f.finalize(l), - f.reset(); - e.concat(l) - } - e.sigBytes = 4 * k; - return e - } - }); - a.EvpKDF = function (a, b, c) { - return e.create(c).compute(a, b) - } - } -)(); -C.lib.Cipher || function (a) { - var b = C - , c = b.lib - , d = c.Base - , e = c.WordArray - , g = c.BufferedBlockAlgorithm - , f = b.enc.Base64 - , q = b.algo.EvpKDF - , k = c.Cipher = g.extend({ - cfg: d.extend(), - createEncryptor: function (a, b) { - return this.create(this._ENC_XFORM_MODE, a, b) - }, - createDecryptor: function (a, b) { - return this.create(this._DEC_XFORM_MODE, a, b) - }, - init: function (a, b, c) { - this.cfg = this.cfg.extend(c); - this._xformMode = a; - this._key = b; - this.reset() - }, - reset: function () { - g.reset.call(this); - this._doReset() - }, - process: function (a) { - this._append(a); - return this._process() - }, - finalize: function (a) { - a && this._append(a); - return this._doFinalize() - }, - keySize: 4, - ivSize: 4, - _ENC_XFORM_MODE: 1, - _DEC_XFORM_MODE: 2, - _createHelper: function () { - return function (a) { - return { - encrypt: function (b, c, h) { - return ("string" == typeof c ? y : m).encrypt(a, b, c, h) - }, - decrypt: function (b, c, h) { - return ("string" == typeof c ? y : m).decrypt(a, b, c, h) - } - } - } - }() - }); - c.StreamCipher = k.extend({ - _doFinalize: function () { - return this._process(!0) - }, - blockSize: 1 - }); - var u = b.mode = {} - , l = c.BlockCipherMode = d.extend({ - createEncryptor: function (a, b) { - return this.Encryptor.create(a, b) - }, - createDecryptor: function (a, b) { - return this.Decryptor.create(a, b) - }, - init: function (a, b) { - this._cipher = a; - this._iv = b - } - }); - u = u.CBC = function () { - function b(b, c, h) { - var d = this._iv; - d ? this._iv = a : d = this._prevBlock; - for (var p = 0; p < h; p++) - b[c + p] ^= d[p] - } - - var c = l.extend(); - c.Encryptor = c.extend({ - processBlock: function (a, c) { - var h = this._cipher - , d = h.blockSize; - b.call(this, a, c, d); - h.encryptBlock(a, c); - this._prevBlock = a.slice(c, c + d) - } - }); - c.Decryptor = c.extend({ - processBlock: function (a, c) { - var h = this._cipher - , d = h.blockSize - , p = a.slice(c, c + d); - h.decryptBlock(a, c); - b.call(this, a, c, d); - this._prevBlock = p - } - }); - return c - }(); - var n = (b.pad = {}).Pkcs7 = { - pad: function (a, b) { - var c = 4 * b; - c -= a.sigBytes % c; - for (var h = c << 24 | c << 16 | c << 8 | c, d = [], p = 0; p < c; p += 4) - d.push(h); - c = e.create(d, c); - a.concat(c) - }, - unpad: function (a) { - a.sigBytes -= a.words[a.sigBytes - 1 >>> 2] & 255 - } - }; - c.BlockCipher = k.extend({ - cfg: k.cfg.extend({ - mode: u, - padding: n - }), - reset: function () { - k.reset.call(this); - var a = this.cfg - , b = a.iv; - a = a.mode; - if (this._xformMode == this._ENC_XFORM_MODE) - var c = a.createEncryptor; - else - c = a.createDecryptor, - this._minBufferSize = 1; - this._mode = c.call(a, this, b && b.words) - }, - _doProcessBlock: function (a, b) { - this._mode.processBlock(a, b) - }, - _doFinalize: function () { - var a = this.cfg.padding; - if (this._xformMode == this._ENC_XFORM_MODE) { - a.pad(this._data, this.blockSize); - var b = this._process(!0) - } else - b = this._process(!0), - a.unpad(b); - return b - }, - blockSize: 4 - }); - var r = c.CipherParams = d.extend({ - init: function (a) { - this.mixIn(a) - }, - toString: function (a) { - return (a || this.formatter).stringify(this) - } - }); - u = (b.format = {}).OpenSSL = { - stringify: function (a) { - var b = a.ciphertext; - a = a.salt; - b = (a ? e.create([1398893684, 1701076831]).concat(a).concat(b) : b).toString(f); - return b.replace(/(.{64})/g, "$1\n") - }, - parse: function (a) { - a = f.parse(a); - var b = a.words; - if (1398893684 == b[0] && 1701076831 == b[1]) { - var c = e.create(b.slice(2, 4)); - b.splice(0, 4); - a.sigBytes -= 16 - } - return r.create({ - ciphertext: a, - salt: c - }) - } - }; - var m = c.SerializableCipher = d.extend({ - cfg: d.extend({ - format: u - }), - encrypt: function (a, b, c, d) { - d = this.cfg.extend(d); - var h = a.createEncryptor(c, d); - b = h.finalize(b); - h = h.cfg; - return r.create({ - ciphertext: b, - key: c, - iv: h.iv, - algorithm: a, - mode: h.mode, - padding: h.padding, - blockSize: a.blockSize, - formatter: d.format - }) - }, - decrypt: function (a, b, c, d) { - d = this.cfg.extend(d); - b = this._parse(b, d.format); - return a.createDecryptor(c, d).finalize(b.ciphertext) - }, - _parse: function (a, b) { - return "string" == typeof a ? b.parse(a) : a - } - }); - b = (b.kdf = {}).OpenSSL = { - compute: function (a, b, c, d) { - d || (d = e.random(8)); - a = q.create({ - keySize: b + c - }).compute(a, d); - c = e.create(a.words.slice(b), 4 * c); - a.sigBytes = 4 * b; - return r.create({ - key: a, - iv: c, - salt: d - }) - } - }; - var y = c.PasswordBasedCipher = m.extend({ - cfg: m.cfg.extend({ - kdf: b - }), - encrypt: function (a, b, c, d) { - d = this.cfg.extend(d); - c = d.kdf.compute(c, a.keySize, a.ivSize); - d.iv = c.iv; - a = m.encrypt.call(this, a, b, c.key, d); - a.mixIn(c); - return a - }, - decrypt: function (a, b, c, d) { - d = this.cfg.extend(d); - b = this._parse(b, d.format); - c = d.kdf.compute(c, a.keySize, a.ivSize, b.salt); - d.iv = c.iv; - return m.decrypt.call(this, a, b, c.key, d) - } - }) -}(); -(function () { - var a = C - , b = a.lib.BlockCipher - , c = a.algo - , d = [] - , e = [] - , g = [] - , f = [] - , q = [] - , k = [] - , u = [] - , l = [] - , n = [] - , r = []; - (function () { - for (var a = [], b = 0; 256 > b; b++) - a[b] = 128 > b ? b << 1 : b << 1 ^ 283; - var c = 0 - , v = 0; - for (b = 0; 256 > b; b++) { - var m = v ^ v << 1 ^ v << 2 ^ v << 3 ^ v << 4; - m = m >>> 8 ^ m & 255 ^ 99; - d[c] = m; - e[m] = c; - var Rb = a[c] - , w = a[Rb] - , ja = a[w] - , t = 257 * a[m] ^ 16843008 * m; - g[c] = t << 24 | t >>> 8; - f[c] = t << 16 | t >>> 16; - q[c] = t << 8 | t >>> 24; - k[c] = t; - t = 16843009 * ja ^ 65537 * w ^ 257 * Rb ^ 16843008 * c; - u[m] = t << 24 | t >>> 8; - l[m] = t << 16 | t >>> 16; - n[m] = t << 8 | t >>> 24; - r[m] = t; - c ? (c = Rb ^ a[a[a[ja ^ Rb]]], - v ^= a[a[v]]) : c = v = 1 - } - } - )(); - var m = [0, 1, 2, 4, 8, 16, 32, 64, 128, 27, 54]; - c = c.AES = b.extend({ - _doReset: function () { - var a = this._key - , b = a.words - , c = a.sigBytes / 4; - a = 4 * ((this._nRounds = c + 6) + 1); - for (var f = this._keySchedule = [], e = 0; e < a; e++) - if (e < c) - f[e] = b[e]; - else { - var g = f[e - 1]; - e % c ? 6 < c && 4 == e % c && (g = d[g >>> 24] << 24 | d[g >>> 16 & 255] << 16 | d[g >>> 8 & 255] << 8 | d[g & 255]) : (g = g << 8 | g >>> 24, - g = d[g >>> 24] << 24 | d[g >>> 16 & 255] << 16 | d[g >>> 8 & 255] << 8 | d[g & 255], - g ^= m[e / c | 0] << 24); - f[e] = f[e - c] ^ g - } - b = this._invKeySchedule = []; - for (c = 0; c < a; c++) - e = a - c, - g = c % 4 ? f[e] : f[e - 4], - b[c] = 4 > c || 4 >= e ? g : u[d[g >>> 24]] ^ l[d[g >>> 16 & 255]] ^ n[d[g >>> 8 & 255]] ^ r[d[g & 255]] - }, - encryptBlock: function (a, b) { - this._doCryptBlock(a, b, this._keySchedule, g, f, q, k, d) - }, - decryptBlock: function (a, b) { - var c = a[b + 1]; - a[b + 1] = a[b + 3]; - a[b + 3] = c; - this._doCryptBlock(a, b, this._invKeySchedule, u, l, n, r, e); - c = a[b + 1]; - a[b + 1] = a[b + 3]; - a[b + 3] = c - }, - _doCryptBlock: function (a, b, c, d, e, f, g, q) { - for (var h = this._nRounds, k = a[b] ^ c[0], p = a[b + 1] ^ c[1], u = a[b + 2] ^ c[2], l = a[b + 3] ^ c[3], v = 4, m = 1; m < h; m++) { - var n = d[k >>> 24] ^ e[p >>> 16 & 255] ^ f[u >>> 8 & 255] ^ g[l & 255] ^ c[v++] - , r = d[p >>> 24] ^ e[u >>> 16 & 255] ^ f[l >>> 8 & 255] ^ g[k & 255] ^ c[v++] - , t = d[u >>> 24] ^ e[l >>> 16 & 255] ^ f[k >>> 8 & 255] ^ g[p & 255] ^ c[v++]; - l = d[l >>> 24] ^ e[k >>> 16 & 255] ^ f[p >>> 8 & 255] ^ g[u & 255] ^ c[v++]; - k = n; - p = r; - u = t - } - n = (q[k >>> 24] << 24 | q[p >>> 16 & 255] << 16 | q[u >>> 8 & 255] << 8 | q[l & 255]) ^ c[v++]; - r = (q[p >>> 24] << 24 | q[u >>> 16 & 255] << 16 | q[l >>> 8 & 255] << 8 | q[k & 255]) ^ c[v++]; - t = (q[u >>> 24] << 24 | q[l >>> 16 & 255] << 16 | q[k >>> 8 & 255] << 8 | q[p & 255]) ^ c[v++]; - l = (q[l >>> 24] << 24 | q[k >>> 16 & 255] << 16 | q[p >>> 8 & 255] << 8 | q[u & 255]) ^ c[v++]; - a[b] = n; - a[b + 1] = r; - a[b + 2] = t; - a[b + 3] = l - }, - keySize: 8 - }); - a.AES = b._createHelper(c) - } -)(); -(function () { - var a = C - , b = a.lib - , c = b.WordArray; - b = b.Hasher; - var d = [] - , e = a.algo.SHA1 = b.extend({ - _doReset: function () { - this._hash = c.create([1732584193, 4023233417, 2562383102, 271733878, 3285377520]) - }, - _doProcessBlock: function (a, b) { - for (var c = this._hash.words, e = c[0], f = c[1], g = c[2], k = c[3], l = c[4], m = 0; 80 > m; m++) { - if (16 > m) - d[m] = a[b + m] | 0; - else { - var n = d[m - 3] ^ d[m - 8] ^ d[m - 14] ^ d[m - 16]; - d[m] = n << 1 | n >>> 31 - } - n = (e << 5 | e >>> 27) + l + d[m]; - n = 20 > m ? n + ((f & g | ~f & k) + 1518500249) : 40 > m ? n + ((f ^ g ^ k) + 1859775393) : 60 > m ? n + ((f & g | f & k | g & k) - 1894007588) : n + ((f ^ g ^ k) - 899497514); - l = k; - k = g; - g = f << 30 | f >>> 2; - f = e; - e = n - } - c[0] = c[0] + e | 0; - c[1] = c[1] + f | 0; - c[2] = c[2] + g | 0; - c[3] = c[3] + k | 0; - c[4] = c[4] + l | 0 - }, - _doFinalize: function () { - var a = this._data - , b = a.words - , c = 8 * this._nDataBytes - , d = 8 * a.sigBytes; - b[d >>> 5] |= 128 << 24 - d % 32; - b[(d + 64 >>> 9 << 4) + 15] = c; - a.sigBytes = 4 * b.length; - this._process() - } - }); - a.SHA1 = b._createHelper(e); - a.HmacSHA1 = b._createHmacHelper(e) - } -)(); -(function () { - var a = C - , b = a.enc.Utf8; - a.algo.HMAC = a.lib.Base.extend({ - init: function (a, d) { - a = this._hasher = a.create(); - "string" == typeof d && (d = b.parse(d)); - var c = a.blockSize - , g = 4 * c; - d.sigBytes > g && (d = a.finalize(d)); - for (var f = this._oKey = d.clone(), k = this._iKey = d.clone(), l = f.words, m = k.words, n = 0; n < c; n++) - l[n] ^= 1549556828, - m[n] ^= 909522486; - f.sigBytes = k.sigBytes = g; - this.reset() - }, - reset: function () { - var a = this._hasher; - a.reset(); - a.update(this._iKey) - }, - update: function (a) { - this._hasher.update(a); - return this - }, - finalize: function (a) { - var b = this._hasher; - a = b.finalize(a); - b.reset(); - return b.finalize(this._oKey.clone().concat(a)) - } - }) - } -)(); -(function () { - var a = C - , b = a.lib - , c = b.Base - , d = b.WordArray; - b = a.algo; - var e = b.HMAC - , g = b.PBKDF2 = c.extend({ - cfg: c.extend({ - keySize: 4, - hasher: b.SHA1, - iterations: 1 - }), - init: function (a) { - this.cfg = this.cfg.extend(a) - }, - compute: function (a, b) { - var c = this.cfg - , f = e.create(c.hasher, a) - , g = d.create() - , k = d.create([1]) - , l = g.words - , m = k.words - , q = c.keySize; - for (c = c.iterations; l.length < q;) { - var h = f.update(b).finalize(k); - f.reset(); - for (var p = h.words, n = p.length, r = h, t = 1; t < c; t++) { - r = f.finalize(r); - f.reset(); - for (var w = r.words, x = 0; x < n; x++) - p[x] ^= w[x] - } - g.concat(h); - m[0]++ - } - g.sigBytes = 4 * q; - return g - } - }); - a.PBKDF2 = function (a, b, c) { - return g.create(c).compute(a, b) - } - } -)(); - -(Sb = function(e, t) { - this.keySize = e / 32, - this.iterationCount = t, - this.key = { - words: [250181692, 1287279318, -2018848139, 38282178, -1732303752], - sigBytes: 16 - } - }).prototype.encrypt = function(e, t) { - return C.AES.encrypt(t, this.key, { - iv: C.enc.Hex.parse(e) - }).ciphertext.toString(C.enc.Base64) -}; - -Sb.prototype.decrypt = function(e, t) { - var i = C.lib.CipherParams.create({ - ciphertext: C.enc.Base64.parse(t) - }); - return C.AES.decrypt(i, this.key, { - iv: C.enc.Hex.parse(e) - }).toString(C.enc.Utf8) -}; - -function I(e, t) { - var i = new Sb(128, 1e3); - return 0 === t ? i.encrypt("3d70d6aee9810adac87eac0a78ba69be", e) : i.decrypt("3d70d6aee9810adac87eac0a78ba69be", e) -} - -function za(cookie, e) { - var t; - return (t = cookie.match(new RegExp("(^| )" + e + "=([^;]*)(;|$)"))) ? unescape(t[2]) : null -} - -function md() { - try { - if (Ta && localStorage && "getItem" in localStorage) { - var e = localStorage.getItem("GUID"); - if (e) - return e - } - } catch (t) { - } - return za("GUID") -} - -function Pc(e, t) { - if (null === e) - return null; - var i = e.match(new RegExp("(^|&)" + t + "=([^&]*)(&|$)", "i")); - return null != i ? unescape(i[2]) : null -} - -function ib(e, t, i) { - if (!(i = za(i))) { - i = "", - e = e || 32; - for (var n = (t = ["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", "0123456789", "0123456789abcdef"][t || 0]).length, o = 0; o < e; o++) - i += t.charAt(Math.floor(Math.random() * n)) - } - return i -} function init_encrypt(sfp) { var S = { diff --git a/yidun/yd_slider.js b/yidun/yd_slider.js index b655ca3..710c25b 100644 --- a/yidun/yd_slider.js +++ b/yidun/yd_slider.js @@ -1,375 +1,3 @@ -function n(e, t) { - function n(e, t) { - return e.charCodeAt(Math.floor(t % e.length)) - } - - function i(e, t) { - return t.split("").map(function (t, i) { - return t.charCodeAt(0) ^ n(e, i) - }) - } - return t = i(e, t), - _(t) -} - -__toByte = function (e) { - function t(t) { - return e.apply(this, arguments) - } - - return t.toString = function () { - return e.toString() - } - , - t -}(function (e) { - if (e < -128) - return __toByte(128 - (-128 - e)); - if (e >= -128 && e <= 127) - return e; - if (e > 127) - return __toByte(-129 + e - 127); - throw new Error("1001") -}); -var i = function (e, t) { - return __toByte(e + t) - } - , r = function (e, t) { - if (null == e) - return null; - if (null == t) - return e; - for (var n = [], r = t.length, o = 0, a = e.length; o < a; o++) - n[o] = i(e[o], t[o % r]); - return n - } - , o = function (e, t) { - return e = __toByte(e), - t = __toByte(t), - __toByte(e ^ t) - } - , a = function (e, t) { - if (null == e || null == t || e.length != t.length) - return e; - for (var n = [], i = e.length, r = 0, a = i; r < a; r++) - n[r] = o(e[r], t[r]); - return n - } - , l = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"] - , u = function (e) { - var t = []; - return t.push(l[e >>> 4 & 15]), - t.push(l[15 & e]), - t.join("") - } - , s = function (e) { - var t = e.length; - if (null == e || t < 0) - return new String(""); - for (var n = [], i = 0; i < t; i++) - n.push(u(e[i])); - return n.join("") - } - , f = function (e) { - if (null == e || 0 == e.length) - return []; - for (var t = new String(e), n = [], i = t.length / 2, r = 0, o = 0; o < i; o++) { - var a = parseInt(t.charAt(r++), 16) << 4 - , l = parseInt(t.charAt(r++), 16); - n[o] = __toByte(a + l) - } - return n - } - , j = function (e) { - if (null == e || void 0 == e) - return e; - for (var t = encodeURIComponent(e), n = [], i = t.length, r = 0; r < i; r++) - if ("%" == t.charAt(r)) { - if (!(r + 2 < i)) - throw new Error("1009"); - n.push(f(t.charAt(++r) + "" + t.charAt(++r))[0]) - } else - n.push(t.charCodeAt(r)); - return n - } - , c = function (e) { - var t = []; - return t[0] = e >>> 24 & 255, - t[1] = e >>> 16 & 255, - t[2] = e >>> 8 & 255, - t[3] = 255 & e, - t - } - , d = function (e) { - var t = c(e); - return s(t) - } - , p = function (e, t, n) { - var i = []; - if (null == e || 0 == e.length) - return i; - if (e.length < n) - throw new Error("1003"); - for (var r = 0; r < n; r++) - i[r] = e[t + r]; - return i - } - , h = function (e, t, n, i, r) { - if (null == e || 0 == e.length) - return n; - if (null == n) - throw new Error("1004"); - if (e.length < r) - throw new Error("1003"); - for (var o = 0; o < r; o++) - n[i + o] = e[t + o]; - return n - } - , y = function (e) { - for (var t = [], n = 0; n < e; n++) - t[n] = 0; - return t - } - , v = function (e) { - return null == e || void 0 == e || "" == e - } - , b = function () { - return ["i", "/", "x", "1", "X", "g", "U", "0", "z", "7", "k", "8", "N", "+", "l", "C", "p", "O", "n", "P", "r", "v", "6", "\\", "q", "u", "2", "G", "j", "9", "H", "R", "c", "w", "T", "Y", "Z", "4", "b", "f", "S", "J", "B", "h", "a", "W", "s", "t", "A", "e", "o", "M", "I", "E", "Q", "5", "m", "D", "d", "V", "F", "L", "K", "y"] - } - , g = function () { - return "3" - } - , m = function (e, t, n) { - var i, r, o, a = b(), l = g(), u = []; - if (1 == n) - i = e[t], - r = 0, - o = 0, - u.push(a[i >>> 2 & 63]), - u.push(a[(i << 4 & 48) + (r >>> 4 & 15)]), - u.push(l), - u.push(l); - else if (2 == n) - i = e[t], - r = e[t + 1], - o = 0, - u.push(a[i >>> 2 & 63]), - u.push(a[(i << 4 & 48) + (r >>> 4 & 15)]), - u.push(a[(r << 2 & 60) + (o >>> 6 & 3)]), - u.push(l); - else { - if (3 != n) - throw new Error("1010"); - i = e[t], - r = e[t + 1], - o = e[t + 2], - u.push(a[i >>> 2 & 63]), - u.push(a[(i << 4 & 48) + (r >>> 4 & 15)]), - u.push(a[(r << 2 & 60) + (o >>> 6 & 3)]), - u.push(a[63 & o]) - } - return u.join("") - } - , _ = function (e) { - if (null == e || void 0 == e) - return null; - if (0 == e.length) - return ""; - var t = 3; - try { - for (var n = [], i = 0; i < e.length;) { - if (!(i + t <= e.length)) { - n.push(m(e, i, e.length - i)); - break - } - n.push(m(e, i, t)), - i += t - } - return n.join("") - } catch (r) { - throw new Error("1010") - } - } - , S = function (e) { - return _(j(e)) - } - , - T = [0, 1996959894, 3993919788, 2567524794, 124634137, 1886057615, 3915621685, 2657392035, 249268274, 2044508324, 3772115230, 2547177864, 162941995, 2125561021, 3887607047, 2428444049, 498536548, 1789927666, 4089016648, 2227061214, 450548861, 1843258603, 4107580753, 2211677639, 325883990, 1684777152, 4251122042, 2321926636, 335633487, 1661365465, 4195302755, 2366115317, 997073096, 1281953886, 3579855332, 2724688242, 1006888145, 1258607687, 3524101629, 2768942443, 901097722, 1119000684, 3686517206, 2898065728, 853044451, 1172266101, 3705015759, 2882616665, 651767980, 1373503546, 3369554304, 3218104598, 565507253, 1454621731, 3485111705, 3099436303, 671266974, 1594198024, 3322730930, 2970347812, 795835527, 1483230225, 3244367275, 3060149565, 1994146192, 31158534, 2563907772, 4023717930, 1907459465, 112637215, 2680153253, 3904427059, 2013776290, 251722036, 2517215374, 3775830040, 2137656763, 141376813, 2439277719, 3865271297, 1802195444, 476864866, 2238001368, 4066508878, 1812370925, 453092731, 2181625025, 4111451223, 1706088902, 314042704, 2344532202, 4240017532, 1658658271, 366619977, 2362670323, 4224994405, 1303535960, 984961486, 2747007092, 3569037538, 1256170817, 1037604311, 2765210733, 3554079995, 1131014506, 879679996, 2909243462, 3663771856, 1141124467, 855842277, 2852801631, 3708648649, 1342533948, 654459306, 3188396048, 3373015174, 1466479909, 544179635, 3110523913, 3462522015, 1591671054, 702138776, 2966460450, 3352799412, 1504918807, 783551873, 3082640443, 3233442989, 3988292384, 2596254646, 62317068, 1957810842, 3939845945, 2647816111, 81470997, 1943803523, 3814918930, 2489596804, 225274430, 2053790376, 3826175755, 2466906013, 167816743, 2097651377, 4027552580, 2265490386, 503444072, 1762050814, 4150417245, 2154129355, 426522225, 1852507879, 4275313526, 2312317920, 282753626, 1742555852, 4189708143, 2394877945, 397917763, 1622183637, 3604390888, 2714866558, 953729732, 1340076626, 3518719985, 2797360999, 1068828381, 1219638859, 3624741850, 2936675148, 906185462, 1090812512, 3747672003, 2825379669, 829329135, 1181335161, 3412177804, 3160834842, 628085408, 1382605366, 3423369109, 3138078467, 570562233, 1426400815, 3317316542, 2998733608, 733239954, 1555261956, 3268935591, 3050360625, 752459403, 1541320221, 2607071920, 3965973030, 1969922972, 40735498, 2617837225, 3943577151, 1913087877, 83908371, 2512341634, 3803740692, 2075208622, 213261112, 2463272603, 3855990285, 2094854071, 198958881, 2262029012, 4057260610, 1759359992, 534414190, 2176718541, 4139329115, 1873836001, 414664567, 2282248934, 4279200368, 1711684554, 285281116, 2405801727, 4167216745, 1634467795, 376229701, 2685067896, 3608007406, 1308918612, 956543938, 2808555105, 3495958263, 1231636301, 1047427035, 2932959818, 3654703836, 1088359270, 936918e3, 2847714899, 3736837829, 1202900863, 817233897, 3183342108, 3401237130, 1404277552, 615818150, 3134207493, 3453421203, 1423857449, 601450431, 3009837614, 3294710456, 1567103746, 711928724, 3020668471, 3272380065, 1510334235, 755167117] - , w = function (e) { - var t = 4294967295; - if (null != e) - for (var n = 0; n < e.length; n++) { - var i = e[n]; - t = t >>> 8 ^ T[255 & (t ^ i)] - } - return d(4294967295 ^ t, 8) - } - , E = function (e) { - return w(null == e ? [] : j(e)) - } - , - R = [120, 85, -95, -84, 122, 38, -16, -53, -11, 16, 55, 3, 125, -29, 32, -128, -94, 77, 15, 106, -88, -100, -34, 88, 78, 105, -104, -90, -70, 90, -119, -28, -19, -47, -111, 117, -105, -62, -35, 2, -14, -32, 114, 23, -21, 25, -7, -92, 96, -103, 126, 112, -113, -65, -109, -44, 47, 48, 86, 75, 62, -26, 72, -56, -27, 66, -42, 63, 14, 92, 59, -101, 19, -33, 12, -18, -126, -50, -67, 42, 7, -60, -81, -93, -86, 40, -69, -37, 98, -63, -59, 108, 46, -45, 93, 102, 65, -79, 73, -23, -46, 37, -114, -15, 44, -54, 99, -10, 60, -96, 76, 26, 61, -107, 18, -116, -55, -40, 57, -76, -82, 45, 0, -112, -77, 29, 43, -30, 109, -91, -83, 107, 101, 81, -52, -71, 84, 36, -41, 68, 39, -75, -122, -6, 11, -80, -17, -74, -73, 35, 49, -49, -127, 80, 103, 79, -25, 52, -43, 56, 41, -61, -24, 17, -118, 115, -38, 8, -78, 33, -85, -106, 58, -98, -108, 94, 116, -125, -51, -9, 71, 82, 87, -115, 9, 69, -123, 123, -117, 113, -22, -124, -87, 64, 13, 21, -89, -2, -99, -97, 1, -4, 34, 20, 83, 119, 30, -12, -110, -66, 118, -48, 6, -36, 104, -58, -102, 97, 5, -20, 31, -72, 70, -39, 67, -68, -57, 110, 89, 51, 10, -120, 28, 111, 127, 22, -3, 54, 53, -1, 100, 74, 50, 91, 27, -31, -5, -64, 124, -121, 24, -13, 95, 121, -8, 4] - , k = 4 - , C = 4 - , X = 4 - , O = 4 - , $ = function (e) { - var t = []; - if (null == e || void 0 == e || 0 == e.length) - return y(C); - if (e.length >= C) - return p(e, 0, C); - for (var n = 0; n < C; n++) - t[n] = e[n % e.length]; - return t - } - , I = function (e) { - if (null == e || void 0 == e || 0 == e.length) - return y(k); - var t = e.length - , n = 0; - n = t % k <= k - X ? k - t % k - X : 2 * k - t % k - X; - var i = []; - h(e, 0, i, 0, t); - for (var r = 0; r < n; r++) - i[t + r] = 0; - var o = c(t); - return h(o, 0, i, t + n, X), - i - } - , x = function (e) { - if (null == e || e.length % k != 0) - throw new Error("1005"); - for (var t = [], n = 0, i = e.length / k, r = 0; r < i; r++) { - t[r] = []; - for (var o = 0; o < k; o++) - t[r][o] = e[n++] - } - return t - } - , A = function (e) { - var t = e >>> 4 & 15 - , n = 15 & e - , i = 16 * t + n; - return R[i] - } - , N = function (e) { - if (null == e) - return null; - for (var t = [], n = 0, i = e.length; n < i; n++) - t[n] = A(e[n]); - return t - } - , P = function () { - for (var e = [], t = 0; t < O; t++) { - var n = 256 * Math.random(); - n = Math.floor(n), - e[t] = __toByte(n) - } - return e - } - , L = function (e, t) { - if (null == e) - return null; - for (var n = __toByte(t), r = [], o = e.length, a = 0; a < o; a++) - r.push(i(e[a], n)); - return r - } - , M = function (e, t) { - if (null == e) - return null; - for (var n = __toByte(t), i = [], r = e.length, a = 0; a < r; a++) - i.push(o(e[a], n)); - return i - } - , D = function (e) { - var t = M(e, 56) - , n = L(t, -40) - , i = M(n, 103); - return i - } - , Y = function (e, t) { - null == e && (e = []); - var n = P(); - t = $(t), - t = a(t, $(n)), - t = $(t); - var i = t - , o = I(e) - , l = x(o) - , u = []; - h(n, 0, u, 0, O); - for (var s = l.length, f = 0; f < s; f++) { - var j = D(l[f]) - , c = a(j, t) - , d = r(c, i); - c = a(d, i); - var p = N(c); - p = N(p), - h(p, 0, u, f * k + O, k), - i = p - } - return u - } - , B = function (e) { - var t = "14731382d816714fC59E47De5dA0C871D3F"; - if (null == t || void 0 == t) - throw new Error("1008"); - null != e && void 0 != e || (e = ""); - var n = e + E(e) - , i = j(n) - , r = j(t) - , o = Y(i, r); - return _(o) - }; -var t = {}; -t.eypt = B; -t.xor_encode = n; -t.toByte = __toByte; -t.str2Bytes = j; -t.arrayCopy = p; -t.arrayCopy2 = h; -t.createEmptyArray = y; -t.isEmptyString = v; -t.base64Encode = S; -t.getStringCRC32 = E; -t.toByte = __toByte; - - -function uuid(e, t) { - var n = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split("") - , a = [] - , i = void 0; - if (t = t || n.length, - e) - for (i = 0; i < e; i++) - a[i] = n[0 | Math.random() * t]; - else { - var r = void 0; - for (a[8] = a[13] = a[18] = a[23] = "-", - a[14] = "4", - i = 0; i < 36; i++) - a[i] || (r = 0 | 16 * Math.random(), - a[i] = n[19 === i ? 3 & r | 8 : r]) - } - return a.join("") -} - -function get_cb() { - var e = uuid(32); - return t.eypt(e) -} - -function b_sample(e, t) { - var n = e.length; - if (n <= t) - return e; - for (var i = [], r = 0, o = 0; o < n; o++) - o >= r * (n - 1) / (t - 1) && (i.push(e[o]), - r += 1); - return i -} - function process_trace(token, trace) { var new_trace = new Array(); for (var i_index = 0 ;i_index < trace.length; i_index++) {