# -*- coding:utf-8 -*-
import time
import ctypes
import base64
import execjs
import random
def lsubid():
haha = '''function lsu() {
// const jsdom = require("jsdom");
// const { JSDOM } = jsdom;
var t = 402871197;
function e(e) {
e = typeof e === undefined || null === e ? '' : e['toString']();
for (var r = 0; r < e['length']; r++) {
var n = .02519603282416938 * (t += e['charCodeAt'](r));
n -= t = n >>> 0,
t = (n *= t) >>> 0,
t += 4294967296 * (n -= t);
}
return 23283064365386964e-26 * (t >>> 0);
}
var r = e(' ')
, n = e(' ')
, i = e(' ')
, o = 1
, a = [String('<div id="a-popover-root" style="z-index:-1;position:absolute;"></div>'), "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.87 Safari/537.36",
new Date()['getTime']()];
// new Date()['getTime']() 当前时间戳 1588070148637
for (var u in a)
a['hasOwnProperty'](u) && ((r -= e(a[u])) < 0 && (r += 1),
(n -= e(a[u])) < 0 && (n += 1),
(i -= e(a[u])) < 0 && (i += 1));
function s(t) {
return ('0000000000' + (4294967296 * (e = 2091639 * r + 23283064365386964e-26 * o,
r = n,
n = i,
i = e - (o = 0 | e)))['toString']())['slice'](-t);
var e;
};
return 'X' + s(2) + '-' + s(7) + '-' + s(7) + ':' + Math['floor'](new Date()['getTime']() / 1000);
}'''
js = execjs.compile(haha)
lsu = js.call('lsu')
return lsu
def Crack():
starttime = int(time.time() * 1000)
he = time.strftime("%Y-%m-%d-%H-%M-%S", time.localtime(starttime // 1000))
timeArray = time.strptime(he, "%Y-%m-%d-%H-%M-%S")
ist = int(time.mktime(timeArray))
lsu = lsubid()
hahah = {'dupedPlugins': "Chrome PDF Plugin Chrome PDF Viewer Native Client ||1920-1080-1040-24-*-*-*",
'errors': [],
'flashVersion': 'null',
'location': "https://www.amazon.com/ap/signin?openid.pape.max_auth_age=0&openid.return_to=https%3A%2F%2Fsellercentral.amazon.com%2Fhome&openid.identity=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0%2Fidentifier_select&openid.assoc_handle=sc_na_amazon_v2&openid.mode=checkid_setup&language=zh_CN&openid.claimed_id=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0%2Fidentifier_select&pageId=sc_na_amazon_v2&openid.ns=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0&ssoResponse=eyJ6aXAiOiJERUYiLCJlbmMiOiJBMjU2R0NNIiwiYWxnIjoiQTI1NktXIn0.iYtE7Fv6aJ6v8chj2opIp_kOGZ33bdo5resZCKHOyv0Ovq0Egq5yMA.WdeSSQ_tHORwt2UX.rCFA9SmFW6sMqkq8A9L0t4rOE0SvBe993mELFt-VHyS636tvTYTD7NhHOrHZzB80D_qAjzY3KhcnpZEKTV7t_yZ-v0WIkpXgzr_GTOnAGCoq7uKI079hTMOVL-zZxFJswOXZSCQ7aC_uumC8RKta23jimSBYW9dJDKvfwnVJ7AKiKEjq2V6ZnOEUmPfPSTTYy_jbcPxHt4dmIEoc4g05St4Fat0ccd6kNcf6tb0YzM6zF8bwllfXv2Haslg7g9KT_oY2.3Vmm67W6l0WPcwF1ejudGw",
'lsUbid': lsu,
'metrics': {'tz': random.randint(0, 9999), 'fp2': random.randint(10000, 555555),
'lsubid': random.randint(0, 9999), 'browser': random.randint(0, 9999)},
'plugins': "Chrome PDF Plugin Chrome PDF Viewer Native Client ||1920-1080-1040-24-*-*-*",
'referrer': "",
'screenInfo': "1920-1080-1040-24-*-*-*",
'start': starttime,
'timeZone': 8,
'userAgent': "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.87 Safari/537.36",
'version': "4.0.0",
'webDriver': 'null'}
lha = ["{",
str('"metrics":' + str(hahah['metrics'])) + ',',
str('"start":' + str(hahah['start'])) + ',',
str('"timeZone":' + str(hahah['timeZone'])) + ',',
str('"lsUbid":"' + str(hahah['lsUbid'])) + '",',
str('"referrer":"' + str(hahah['referrer'])) + '",',
str('"userAgent":"' + str(hahah['userAgent'])) + '",',
str('"location":"' + str(hahah['location'])) + '",',
str('"webDriver":' + str(hahah['webDriver'])) + ',',
str('"errors":' + str(hahah['errors'])) + ',',
str('"version":"' + str(hahah['version'])) + '",',
"}"]
strhahah = ''
for ha in lha:
strhahah += ha
print(strhahah)
return strhahah
def crcTable():
js = execjs.compile('''
function crcTable(r){
var crc = Array();
for (var t=0; t<256; t++){
for (var e=t, c=0; c<8;c++)
1 == (1 & e) ? e = e >>> 1 ^ 3988292384 : e >>>= 1;
crc[t] = e
};
return crc
}''')
crclist = js.call('crcTable')
return crclist
def crc32_js(r):
js = execjs.compile('''
function crcTable(){
var crc = Array();
for (var t=0; t<256; t++){
for (var e=t, c=0; c<8;c++)
1 == (1 & e) ? e = e >>> 1 ^ 3988292384 : e >>>= 1;
crc[t] = e;
};
return crc;
};
function crc(r){
var t,e = 0;
var crcl = crcTable();
e ^= 4294967295;
for (var c=0; c<String(r).length; c++)
t = 255 & (e ^ String(r).charCodeAt(c));
e = e >>> 8 ^ crcl[t];
return 4294967295 ^ e};''')
crclist = js.call('crcTable')
# print(crclist)
cr32 = js.call('crc', r)
return cr32
def hex_js(t):
js = execjs.compile(
'''function jst(t){return ['0123456789ABCDEF'.charAt(t >>> 28 & 15),'0123456789ABCDEF'.charAt(t >>> 24 & 15),'0123456789ABCDEF'.charAt(t >>> 20 & 15),'0123456789ABCDEF'.charAt(t >>> 16 & 15),'0123456789ABCDEF'.charAt(t >>> 12 & 15),'0123456789ABCDEF'.charAt(t >>> 8 & 15),'0123456789ABCDEF'.charAt(t >>> 4 & 15),'0123456789ABCDEF'.charAt(15 & t)]['join']('')};''')
jst = js.call('jst', t)
print(t, jst)
return jst
def doEncrypt(r):
js = execjs.compile('''function doE(r){
t = [1888420705, 2576816180, 2347232058, 874813317];
for (var e = Math['ceil'](r['length'] / 4), o = [], i = 0; i < e; i++)
o[i] = (255 & r['charCodeAt'](4 * i)) + ((255 & r['charCodeAt'](4 * i + 1)) << 8) + ((255 & r['charCodeAt'](4 * i + 2)) << 16) + ((255 & r['charCodeAt'](4 * i + 3)) << 24);
for (var n = Math['floor'](6 + 52 / e),a = o[0], c = o[e - 1], d = 0; n-- > 0; )
for (var h = (d += 2654435769) >>> 2 & 3, u = 0; u < e; u++)
a = o[(u + 1) % e],
c = o[u] += (c >>> 5 ^ a << 2) + (a >>> 3 ^ c << 4) ^ (d ^ a) + (t[3 & u ^ h] ^ c);
for (var f = [], s = 0; s < e; s++)
f[s] = String['fromCharCode'](255 & o[s], o[s] >>> 8 & 255, o[s] >>> 16 & 255, o[s] >>> 24 & 255);
return f['join']('');}''')
uf = js.call('doE', r)
return uf
def base64s(uf):
js = execjs.compile('''function en(e){
var c = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
e = String(e);
for (var t, r, o, n, d = e.length % 3, h = "", i = -1, f = e.length - d; ++i < f; )
t = e.charCodeAt(i) << 16,
r = e.charCodeAt(++i) << 8,
o = e.charCodeAt(++i),
h += c.charAt((n = t + r + o) >> 18 & 63) + c.charAt(n >> 12 & 63) + c.charAt(n >> 6 & 63) + c.charAt(63 & n);
return 2 == d ? (t = e.charCodeAt(i) << 8,
r = e.charCodeAt(++i),
h += c.charAt((n = t + r) >> 10) + c.charAt(n >> 4 & 63) + c.charAt(n << 2 & 63) + "=") : 1 == d && (n = e.charCodeAt(i),
h += c.charAt(n >> 2) + c.charAt(n << 4 & 63) + "=="),
h}''')
return js.call('en', uf)
def setECdIecs():
sthahah = Crack()
crc32 = crc32_js(sthahah)
hek = hex_js(crc32)
nstrkey = hek + '#' + sthahah
uf = doEncrypt(nstrkey)
print(uf)
bas = base64s(uf)
return bas
import requests
url = "https://www.amazon.com/ap/signin?openid.pape.max_auth_age=0&openid.return_to=https%3A%2F%2Fsellercentral.amazon.com%2Fhome&openid.identity=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0%2Fidentifier_select&openid.assoc_handle=sc_na_amazon_v2&openid.mode=checkid_setup&language=zh_CN&openid.claimed_id=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0%2Fidentifier_select&pageId=sc_na_amazon_v2&openid.ns=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0&ssoResponse=eyJ6aXAiOiJERUYiLCJlbmMiOiJBMjU2R0NNIiwiYWxnIjoiQTI1NktXIn0.iYtE7Fv6aJ6v8chj2opIp_kOGZ33bdo5resZCKHOyv0Ovq0Egq5yMA.WdeSSQ_tHORwt2UX.rCFA9SmFW6sMqkq8A9L0t4rOE0SvBe993mELFt-VHyS636tvTYTD7NhHOrHZzB80D_qAjzY3KhcnpZEKTV7t_yZ-v0WIkpXgzr_GTOnAGCoq7uKI079hTMOVL-zZxFJswOXZSCQ7aC_uumC8RKta23jimSBYW9dJDKvfwnVJ7AKiKEjq2V6ZnOEUmPfPSTTYy_jbcPxHt4dmIEoc4g05St4Fat0ccd6kNcf6tb0YzM6zF8bwllfXv2Haslg7g9KT_oY2.3Vmm67W6l0WPcwF1ejudGw"
form_data= {'appActionToken':'20V6PCxuBx9nSj2FZnUVWXhEKj2BT58j3D',
'appAction':'SIGNIN_PWD_COLLECT',
'subPageType':'SignInClaimCollect',
'openid.return_to': ' ape:aHR0cHM6Ly93d3cuYW1hem9uLmNvbS8/dGFnPWFtYXp1c25hdmktMjAmaHZhZGlkPTM4MTgyMzQ5NzA4OCZodnBvcz0maHZuZXR3PWcmaHZyYW5kPTg3NDc0NTM3ODMwOTM5NzkzNzcmaHZwb25lPSZodnB0d289Jmh2cW10PWUmaHZkZXY9YyZodmR2Y21kbD0maHZsb2NpbnQ9Jmh2bG9jcGh5PTEwMTM5NjImaHZ0YXJnaWQ9a3dkLTMyMzgzMjE1MTY3NCZyZWY9bmF2X3lhX3NpZ25pbiZoeWRhZGNyPTI4ODgwXzExODQ1MzYwJmdjbGlkPUNqMEtDUWlBbFpIX0JSQ2dBUklzQUFaSFNCazFZdHNZenB2dEZkTGtDOGpUdUNPUTExYTUwUlF3dVlmVWFtMWRpcU5PSDMxSVlONGQ5dElhQWhoVkVBTHdfd2NC','prevRID':'ape:UUo3UllDVEg5NzRKM0VSQjhBQk0=',
'workflowState': 'eyJ6aXAiOiJERUYiLCJlbmMiOiJBMjU2R0NNIiwiYWxnIjoiQTI1NktXIn0.P30NwGRykbkdSyuY8c_-OxaQOMRdpvH2OO-Pt7SLSNoDPtlIhQtjCw.xBYTcPMoOQayYjHk.f9SWKGT3tvgAKzdznrJ27izg-H34SluHznvqTW82TtLKLSoG17eiVgVLG7pVq0dEc2-beQeCI8BKY_dQVvwUoDw6DoTq_Q7fkhD1voQVHcWVn56gMxOheOeRiAMSFz09IhxDUTmRsDgi3X6e0JEs7J5vSTbsBBY1K98XGjP3WTuygIjyiWuvPWvYhPLtz9OvTZqeco0HRZ51ZeVqfnQFAW7vSHuLmF-Q7vwszsRoqM99OdQCZmK0djwRoRkzXzxOdtl9lQ1Y7jEmcKPoVEp4MxwXqneghblw2EAJdzCg_X8nfEg0P1munhfpi2saxW5yJ1KK-0vs.D2u9uU_B4xjDXOLrXdOpjA',
'email': '123456@gmail.com',
'password': '',
'create': '0',
'metadata1':'{}'.format(setECdIecs())}
headers = {
'accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9',
'accept-encoding': 'gzip, deflate, br',
'accept-language': 'zh-CN,zh;q=0.9',
'cache-control': 'max-age=0',
'content-length': '10982',
'cookie': 'signin-sso-state-us=9ee2cd88-bc99-417a-a9b2-035378659774; session-id=147-0322739-0000539; i18n-prefs=USD; lc-main=zh_CN; sp-cdn="L5Z9:CN"; ubid-main=134-4535439-1253042; aws_lang=cn; s_fid=3402436A5D20BD5B-296AA6CC5F7332C7; s_campaign=PS%7Cacquisition_CN%7Cbaidu%7Cbz%7Cpc%7CHL%7Ctest%7Cpc%7CCN%7Cbaidu-ppc-test; s_cc=true; aws-target-data=%7B%22support%22%3A%221%22%7D; s_eVar60=baidu-ppc-test; aws-target-visitor-id=1608790345752-208104.35_0; s_vn=1640326522099%26vn%3D1; s_nr=1608790522100-New; regStatus=registering; aws-business-metrics-last-visit=1608790420695; session-token=Qye5C5W3ketckCWxws5WOwm43wCYfNsMnWDSbzt3XH2rR96nzxSNC4pYLtjKa3kclsX5AurUHMmYm6GIO65BURML0nqj7WRNJldwZLFnkDNi7c45+uUokBlIgg6GNBuItDPkIKJ76K8lnxBLAgQH6i9gOS5Ow7dqZX8C9yywNikgRpQ4aJntsDFnQhgEpbIK; skin=noskin; session-id-time=2239581570l; csm-hit=tb:M8J4B1G0305GNSR1DY0Z+s-QJ7RYCTH974J3ERB8ABM|1608861676182&t:1608861676182&adb:adblk_no; session-id=147-0322739-0000539; ubid-main=134-4535439-1253042; session-token=Qye5C5W3ketckCWxws5WOwm43wCYfNsMnWDSbzt3XH2rR96nzxSNC4pYLtjKa3kclsX5AurUHMmYm6GIO65BURML0nqj7WRNJldwZLFnkDNi7c45+uUokBlIgg6GNBuItDPkIKJ76K8lnxBLAgQH6i9gOS5Ow7dqZX8C9yywNikgRpQ4aJntsDFnQhgEpbIK; session-id-time=2239582280l',
'downlink': '4.2',
'ect': '4g',
'origin': 'https://www.amazon.com',
'referer': 'https://www.amazon.com/-/zh/ap/signin?openid.pape.max_auth_age=0&openid.return_to=https%3A%2F%2Fwww.amazon.com%2F%3Ftag%3Damazusnavi-20%26hvadid%3D381823497088%26hvpos%3D%26hvnetw%3Dg%26hvrand%3D8747453783093979377%26hvpone%3D%26hvptwo%3D%26hvqmt%3De%26hvdev%3Dc%26hvdvcmdl%3D%26hvlocint%3D%26hvlocphy%3D1013962%26hvtargid%3Dkwd-323832151674%26ref%3Dnav_ya_signin%26hydadcr%3D28880_11845360%26gclid%3DCj0KCQiAlZH_BRCgARIsAAZHSBk1YtsYzpvtFdLkC8jTuCOQ11a50RQwuYfUam1diqNOH31IYN4d9tIaAhhVEALw_wcB&openid.identity=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0%2Fidentifier_select&openid.assoc_handle=usflex&openid.mode=checkid_setup&openid.claimed_id=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0%2Fidentifier_select&openid.ns=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0&',
'rtt': '100',
'sec-fetch-dest': 'document',
'sec-fetch-mode': 'navigate',
'sec-fetch-site': 'same-origin',
'sec-fetch-user': '?1',
'upgrade-insecure-requests': '1',
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36'}
response = requests.request("POST", url, headers=headers, data=form_data)
print(response.text)
"""您在寻找什么吗?
56d14edce8e2cb6c6842c59ddaee426e
56d14edce8e2cb6c6842c59ddaee426e
encryptedPwd
generateProcessedForm
getWebCryptoAlgorithm
"""