首页
论坛
课程
招聘
[原创]Apple ID 网页协议注册机源代码 163邮箱。
2017-12-29 16:33 14481

[原创]Apple ID 网页协议注册机源代码 163邮箱。

2017-12-29 16:33
14481

我们做ASO协议刷有2年了,上半年做了一个Apple ID网页版协议注册机,用163邮箱做账号,python写的。

 

本人文笔不好,直接贴代码,给大家做个参考,希望对大家有所帮助
QQ 9292 04200

# coding: utf-8
from __future__ import unicode_literals
import re
import requests
import json
import base64
import binascii
import time
import datetime
import execjs
import urllib
import random


def SendApple(AppleSession,AppleRegPutJson1,AppleRegPutJson2,AppleRegPutJson4,MailUserName,MailPwd):




    #1、提交给https://appleid.apple.com/account/validate
    r = AppleSession.post('https://appleid.apple.com/account/validate',verify = False,data =AppleRegPutJson1 )
    print  r.text
    #2、提交给https://appleid.apple.com/account/verification 获取"verificationId" : "001356-00-765182d1c944a7d9f3e433829ea0f5ea6fce75e20a7816187c08652e7de7d35aLTOW",
    r = AppleSession.post('https://appleid.apple.com/account/verification', verify = False,data=AppleRegPutJson2)
    AppleRetJson = json.loads(r.text)
    VeriID =  AppleRetJson['verificationId']

    #2、取出验证码
    time.sleep(5)
    strCheckCode = LoginMail(MailUserName,MailPwd)

    # 3、提交验证码"verificationId" : "001356-00-765182d1c944a7d9f3e433829ea0f5ea6fce75e20a7816187c08652e7de7d35aLTOW",
    AppleRegPutJson3 = InputAppleInformation3(MailUserName,VeriID,strCheckCode)
    r = AppleSession.put('https://appleid.apple.com/account/verification', verify = False,data=AppleRegPutJson3)
    AppleSession.headers['X-Apple-I-FD-Client-Info'] = GetJsCode()
    AppleSession.headers['User-Agent']='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36'

    # 4、复合验证
    AppleRegPutJson4 = ChangeAppleInforVerIDAndAnswer(AppleRegPutJson4,VeriID,strCheckCode)
    r = AppleSession.post('https://appleid.apple.com/account', verify=False, data=AppleRegPutJson4)

    #5、登陆验证验证
    #GET访问appleid网站appleid.获取serviceKey
    #Post访问idmasa.apple.com/app;eauth/auth/signin 带上{"accountName":"kgytb88qejp28@163.com","password":"Jhq19940831","rememberMe":false}以及serviceKey 获取scnt SessionID
    #Get访问https://idmsa.apple.com/appleauth/auth 带上scnt SessionID serverKey X-Apple-ID-Session-Id X-Apple-I-FD-Client-Info,返回question内容
    #Post访问https://idmsa.apple.com/appleauth/auth/verify/questions 提交答案
    #(1)、serviceKey服务key获取

    LoginCheckPatch(AppleRegPutJson4)





    print r.text

def LoginApple(AppleSession):

    AppleSession.headers['User-Agent'] = 'Mozilla/5.0 [en](Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36'
    AppleSession.headers['Accept']='text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8'
    AppleSession.headers['Content-Type']='application/x-www-form-urlencoded'
    AppleSession.headers['Connection']='keep-alive'
    AppleSession.headers['Accept-Encoding']='gzip, deflate, sdch, br'
    r=AppleSession.get('https://appleid.apple.com/account#!&page=create',verify = False);
    ### 二次提交获取验证码

    AppleSession.headers['Content-Type']='application/json'
    AppleSession.headers[
        'User-Agent'] = 'Mozilla/5.0 [en](Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36'
    AppleSession.headers['scnt']= r.text[r.text.index('scnt:')+7:r.text.index('scnt:')+7+32]
    AppleSession.headers['X-Apple-Api-Key']=r.text[r.text.index('apiKey:')+9:r.text.index('apiKey:')+9+32]
    AppleSession.headers['X-Apple-ID-Session-Id']=r.text[r.text.index('sessionId:')+12:r.text.index('sessionId:')+12+32]
    AppleSession.headers['Accept']='application/json, text/javascript, */*; q=0.01'
    AppleSession.headers['X-Requested-With']='XMLHttpRequest'
    AppleSession.headers['Connection']='keep-alive'

    r = AppleSession.post('https://appleid.apple.com/captcha',verify = False,data=json.dumps({"type":"IMAGE"}))
    AppleRetJson = json.loads(r.text)







    return AppleRetJson;

def LoginMail(Loginusername,pwd):
    session = requests.Session()
    session.headers['User-Agent'] = 'Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Firefox/52.0'

    data = {
        'username': Loginusername,
        'password': pwd,
        'funcid': 'loginone',
        'language': -1,
        'passtype': 1,
        'iframe': 1,
        'product': 'mail163',
        'from': 'web',
        'df': 'email163',
    }

    print('登录')
    r = session.post('http://mail.163.com/entry/cgi/ntesdoor', data=data)
    url = re.search('top.location.href = "(.+)"', r.text).group(1)

    print('进入主页, url: {}'.format(url))
    session.get(url)
    sid = session.cookies.get('Coremail.sid')

    print('收信, sid: {}'.format(sid))
    params = {
        'sid': sid,
        'func': 'mbox:listMessages',
        'LeftNavfolder1Click': 1,
        'mbox_folder_enter': 1
    }
    payload = {
        'var': '<?xml version="1.0"?><object><int name="fid">1</int><string name="order">date</string><boolean name="desc">true</boolean><int name="limit">20</int><int name="start">0</int><boolean name="skipLockedFolders">false</boolean><string name="topFlag">top</string><boolean name="returnTag">true</boolean><boolean name="returnTotal">true</boolean></object>'
    }
    receive_url = 'http://mail.163.com/js6/s'
    r = session.post(receive_url, params=params, data=payload)

    mid = re.search('<string name="id">(.+)</string>', r.text).group(1)

    print('读信, mid: {}'.format(mid))
    str = 'http://mail.163.com/js6/read/readhtml.jsp?mid=' + mid + '&font=15&color=064977'
    r = session.get(str)
    strCheckCode = r.text[r.text.find('>',r.text.find('paragraph verification-code'))+1:r.text.find('>',r.text.find('paragraph verification-code'))+7]
    return  strCheckCode


def LoginSuperManCheckcode(XXUserName,XXPwd,byteCheckcode):
    session = requests.Session()
    dataPayload = {
        'username': XXUserName,
        'password':XXPwd,
        'imgdata':byteCheckcode
    }
    r=session.post('http://api2.sz789.net:88/RecvByte.ashx',data=dataPayload);
    SCJson = json.loads(r.text)
    return  SCJson


#value="130"你少年时代最好的朋友叫什么名字?
#value="131"你的第一个宠物叫什么名字?
#value="132"你学会做的第一道菜是什么?
#value="133"你第一次去电影院看的是哪一部电影?
#value="134"你第一次坐飞机是去哪里?
#value="135"你上小学时最喜欢的老师姓什么?


#value=130 What is the first name of your best friend in high school?
#value=131 What was the name of your first pet?
#value="132 What was the first thing you learned to cook?
#value="133 What was the first film you saw in the theater?
#value="134 Where did you go the first time you flew on a plane?
#value="135 What is the last name of your favorite elementary school teacher?

#value=136 What is your dream job?
#value=137 What is your favorite children’s book?
#value=138 What was the model of your first car?
#value=139 What was your childhood nickname?
#value=140 Who was your favorite film star or character in school?
#value=141 Who was your favorite singer or band in high school?

#value=142 In what city did your parents meet?
#value=143 What was the first name of your first boss?
#value=144 What is the name of the street where you grew up?
#value=145 What is the name of the first beach you visited?
#value=146 What was the first album that you purchased?
#value=147 What is the name of your favorite sports team?


def QuesitonIdGet(argument):
    switcher = {
        '你少年时代最好的朋友叫什么名字?':'130',
        '你的第一个宠物叫什么名字?':'131',
        '你学会做的第一道菜是什么?':'132',
        '你第一次去电影院看的是哪一部电影?':'133',
        '你第一次坐飞机是去哪里?':'134',
        '你上小学时最喜欢的老师姓什么':'135',

        'What is the first name of your best friend in high school?':'130',
        'What was the name of your first pet?': '131',
        'What was the first thing you learned to cook?': '132',
        'What was the first film you saw in the theater?': '133',
        'Where did you go the first time you flew on a plane?': '134',
        'What is the last name of your favorite elementary school teacher?': '135',

        'What is your dream job?': '136',
        'What is your favorite children’s book?': '137',
        'What was the model of your first car?': '138',
        'What was your childhood nickname?': '139',
        'Who was your favorite film star or character in school?': '140',
        'Who was your favorite singer or band in high school?': '141',

        'In what city did your parents meet?': '142',
        'What was the first name of your first boss?': '143',
        'What is the name of the street where you grew up?': '144',
        'What is the name of the first beach you visited?': '145',
        'What was the first album that you purchased?': '146',
        'What is the name of your favorite sports team?': '147',

    }
    return switcher.get(argument, "nothing")
def InputAppleInformation1(name,password,firstName,lastName,birthday,country,preferredLanguage,appleNews,appleUpdates,iTunesUpdates,question1,answer1,question2,answer2,question3,answer3,id,token,answer):
    questionId1 = QuesitonIdGet(question1)
    questionId2 = QuesitonIdGet(question2)
    questionId3 = QuesitonIdGet(question3)

    data = {
    "account": {
        "name": name,
        "password": password,
        "person": {
            "name": {
                "firstName":firstName,
                "lastName": lastName
            },
            "birthday": birthday,
            "primaryAddress": {
                "country": country
            }
        },
        "preferences": {
            "preferredLanguage":preferredLanguage,
            "marketingPreferences": {
                "appleNews": appleNews,
                "appleUpdates": appleUpdates,
                "iTunesUpdates": iTunesUpdates
            }
        },
        "security": {
            "questions": [
                {
                    "id": questionId1,
                    "question": question1,
                    "answer": answer1
                },
                {
                    "id": questionId2,
                    "question": question2,
                    "answer": answer2
                },
                {
                    "id": questionId3,
                    "question": question3,
                    "answer": answer3
                }
            ]
        }
    },
    "captcha": {
        "id": id,
        "token": token,
        "answer": answer
    }
}

    json_string = json.dumps(data)

    return json_string
def InputAppleInformation2(name,firstName,lastName):
    data = {
    "account":{
        "name":name,
        "person":{
            "name":{
                "firstName":firstName,
                "lastName":lastName
            }
        }
    }
}
    json_string = json.dumps(data)
    return json_string
def InputAppleInformation3(name,id,answer):
    data = {
    "name": name,
    "verificationInfo": {
        "id": id,
        "answer": answer
    }
}
    json_string = json.dumps(data)
    return json_string
def InputAppleInformation4(name, password, firstName, lastName, birthday, country, preferredLanguage, appleNews,
                          appleUpdates, iTunesUpdates, question1, answer1, question2, answer2, question3, answer3, id,
                          token, answer,verID,VerAnswer):
    questionId1 = QuesitonIdGet(question1)
    questionId2 = QuesitonIdGet(question2)
    questionId3 = QuesitonIdGet(question3)

    data = {
        "account": {
            "name": name,
            "password": password,
            "person": {
                "name": {
                    "firstName": firstName,
                    "lastName": lastName
                },
                "birthday": birthday,
                "primaryAddress": {
                    "country": country
                }
            },
            "verificationInfo": {
                "id": verID,
                "answer": VerAnswer
            },
            "preferences": {
                "preferredLanguage": preferredLanguage,
                "marketingPreferences": {
                    "appleNews": appleNews,
                    "appleUpdates": appleUpdates,
                    "iTunesUpdates": iTunesUpdates
                }
            },
            "security": {
                "questions": [
                    {
                        "id": questionId1,
                        "question": question1,
                        "answer": answer1
                    },
                    {
                        "id": questionId2,
                        "question": question2,
                        "answer": answer2
                    },
                    {
                        "id": questionId3,
                        "question": question3,
                        "answer": answer3
                    }
                ]
            }
        }
    }
    json_string = json.dumps(data)
    return json_string
def InputAppleLoginInformatin(accountName,password):
    #登陆信息
    data = {
    "accountName": accountName,
    "password": password,
    "rememberMe": 'false'
    }
    json_string = json.dumps(data)
    return json_string


def InputAppleLoginInformatin2(questionA,questionB,answerA,answerB,idA,idB,numberA,numberB):
    #登陆信息
    data = {
    "questions": [
        {
            "question": questionA,
            "answer": answerA,
            "id": idA,
            "number": numberA
        },
        {
            "question": questionB,
            "answer": answerB,
            "id": idB,
            "number": numberB
        }
    ]
}
    json_string = json.dumps(data)
    return json_string

def ChangeAppleInforVerIDAndAnswer(AppleRegPutJson3,verID,verAnswer):
    data = json.loads(AppleRegPutJson3)
    data['account']['verificationInfo']['id'] = verID
    data['account']['verificationInfo']['answer'] = verAnswer
    json_string = json.dumps(data)
    return json_string


def Test():
    name = 'bpejvz35hn559@163.com'
    MailPwd = 'p75xztek'
    password = 'J19940831'
    firstName = 'huqu'
    lastName = 'juio'
    birthday = '1999-02-21'
    country = 'USA'
    preferredLanguage = 'en_US'
    appleNews = 'false'
    appleUpdates = 'true'
    iTunesUpdates = 'true'
    question1 = 'What is the first name of your best friend in high school?'
    answer1 = '123'
    question2 = 'What is your dream job?'
    answer2 = '456'
    question3 = 'In what city did your parents meet?'
    answer3 = '789'
    id = '123'
    token = '456'
    ApplePutJson4 = InputAppleInformation4(name, password, firstName, lastName, birthday, country, preferredLanguage,
                                           appleNews,
                                           appleUpdates, iTunesUpdates, question1, answer1, question2, answer2,
                                           question3, answer3, id,
                                           token, '123', 'Unknow', 'Unknow')
    LoginCheckPatch(ApplePutJson4)

    return



def Main():
    # 1、模拟发送icloud请求
    # (1)获取验证码相关信息
    # (2)交给打码平台
    # (3)提交全部数据
    # 2、模拟登陆邮箱
    # (1)登陆邮箱
    # (2)找到邮件
    # (3)获取内容
    # 3、取出邮箱结果
    # 4、交给icloud注册完成

    # (1)获取验证码相关信息







    AppleSession  = requests.session();
    LoginAppleRetJson = LoginApple(AppleSession)
    strContent = LoginAppleRetJson['payload']['content']
    byteCheckcode = binascii.b2a_hex(base64.decodestring(strContent))
    # (2)交给打码平台
    for i in range(0,3):
        CheckCodeRetJson = LoginSuperManCheckcode('damazhanghao', 'damamima', byteCheckcode)
        if i == 3:
            str = '验证码平台超过指定次数'
            return  str
        else:
            if CheckCodeRetJson['info'] == 1:  # successful
                answer = CheckCodeRetJson['result']
                break
            elif CheckCodeRetJson['info'] == 0:
                time.sleep(3)
                continue
            else:
                str = '验证码平台错误 代码:' + str(CheckCodeRetJson['info'])
                return str

    # (3)提交全部数据(测试数据)
    name = 'cv@163.com'
    MailPwd ='onwp0'
    password = 'Jhq'
    firstName = 'h'
    lastName= 'j'
    birthday='1999-02-21'
    country = 'USA'
    preferredLanguage = 'en_US'
    appleNews = 'false'
    appleUpdates = 'true'
    iTunesUpdates = 'true'
    question1= 'What is the first name of your best friend in high school?'
    answer1 = '123'
    question2 = 'What is your dream job?'
    answer2 = '456'
    question3 = 'In what city did your parents meet?'
    answer3 = '789'
    id = LoginAppleRetJson['id']
    token = LoginAppleRetJson['token']

    ApplePutJson1 = InputAppleInformation1(name, password, firstName, lastName, birthday, country, preferredLanguage, appleNews,
                          appleUpdates, iTunesUpdates, question1, answer1, question2, answer2, question3, answer3, id,
                          token, answer)
    ApplePutJson2 = InputAppleInformation2(name,firstName,lastName)
    #最后一次提交数据
    ApplePutJson4 = InputAppleInformation4(name, password, firstName, lastName, birthday, country, preferredLanguage, appleNews,
                          appleUpdates, iTunesUpdates, question1, answer1, question2, answer2, question3, answer3, id,
                          token, answer,'Unknow','Unknow')

    SendApple(AppleSession,ApplePutJson1,ApplePutJson2,ApplePutJson4,name,MailPwd)



def GetJsCode():
    #"TF1;020;;;;;;;;;;;;;;;;;;;;;;Mozilla;Netscape;5.0%20%28Windows%20NT%206.1%3B%20Win64%3B%20x64%29%20AppleWebKit/537.36%20%28KHTML%2C%20like%20Gecko%29%20Chrome/58.0.3029.110%20Safari/537.36;20030107;undefined;true;;true;Win32;undefined;Mozilla/5.0%20%28Windows%20NT%206.1%3B%20Win64%3B%20x64%29%20AppleWebKit/537.36%20%28KHTML%2C%20like%20Gecko%29%20Chrome/58.0.3029.110%20Safari/537.36;zh-CN;undefined;;undefined;undefined;undefined;undefined;false;false;1496323474932;8;2005-6-7%2021%3A33%3A44;3440;1440;;25.0;;;;;8;-480;-480;2017-6-1%2021%3A24%3A34;24;3440;1400;0;0;;;;;;Shockwave%20Flash%7CShockwave%20Flash%2025.0%20r0;;;;;;;;;;;;;;;;;;;;;;;;;;;;5.6.1-0;;"
    #data = time.strftime('%m/%d/%Y %-X %p',time.localtime())
    dtime = datetime.datetime.now().timetuple()
    if dtime.tm_hour >= 12:
        DataCode = str(dtime.tm_mon) + '/' + str(dtime.tm_mday) + '/' + str(dtime.tm_year) + ', '+ str(dtime.tm_hour - 12) + ':'
        if dtime.tm_min <10:
            DataCode = DataCode  + str(dtime.tm_min) + ':'
        if dtime.tm_sec <10:
            DataCode = DataCode+ '0'
        DataCode = DataCode + ' PM'

    else:
        DataCode = str(dtime.tm_mon) + '/' + str(dtime.tm_mday) + '/' + str(dtime.tm_year) + ', ' + str(dtime.tm_hour) + ':'
        if dtime.tm_min < 10:
            DataCode = DataCode + '0'
        DataCode = DataCode  + str(dtime.tm_min) + ':'
        if dtime.tm_sec < 10:
            DataCode = DataCode + '0'
        DataCode = DataCode + str(dtime.tm_sec) + ' AM'

    DataCode = str(urllib.quote(DataCode))
    CT = str(random.randint(6, 7))
    UTC = str(int(time.mktime(dtime)*1000)+218)

    code = str('"TF1;020;;;;;;;;;;;;;;;;;;;;;;Mozilla;Netscape;5.0%20%28Windows%20NT%2010.0%3B%20Win64%3B%20x64%29%20AppleWebKit/537.36%20%28KHTML%2C%20like%20Gecko%29%20Chrome/58.0.3029.110%20Safari/537.36;20030107;undefined;true;;true;Win32;undefined;Mozilla/5.0%20%28Windows%20NT%2010.0%3B%20Win64%3B%20x64%29%20AppleWebKit/537.36%20%28KHTML%2C%20like%20Gecko%29%20Chrome/58.0.3029.110%20Safari/537.36;en-US;undefined;;undefined;undefined;undefined;undefined;false;false;@UTC@;8;6/7/2005%2C%209%3A33%3A44%20PM;1152;2049;;;;;;;@CT@;-480;-480;@Time@;24;1152;2009;1536;-774;;;;;;;;;;;;;;;;;;;18;;;;;;;;;;;;;;;5.6.1-0;;"')
    #code = code.replace('@DataCode@',DataCode)
    #code = code.replace('@UTC@',UTC)
    #code = code.replace('@CT@','10')

    CodeValue = execjs.compile(open(r"Info.js").read().decode("utf-8")).call('GetCode', code)

    CodeValue = '{"U": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36","L": "en_US", "Z": "GMT+08:00", "V": "1.1","F": "' + CodeValue + '"}'

    return CodeValue


def LoginCheckPatch(AppleRegPutJson4):
    # 5、登陆验证验证

    # Get访问https://idmsa.apple.com/appleauth/auth 带上scnt SessionID serverKey X-Apple-ID-Session-Id X-Apple-I-FD-Client-Info,返回question内容
    # Post访问https://idmsa.apple.com/appleauth/auth/verify/questions 提交答案
    # (1)、serviceKey服务key获取
    AppleLoginSession = requests.session();

    # GET访问appleid网站appleid.获取serviceKey
    AppleLoginSession.headers[
        'User-Agent'] = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36'
    AppleLoginSession.headers['Accept'] = 'application/json, text/javascript, */*; q=0.01'
    AppleLoginSession.headers['Content-Type'] = 'application/json'
    AppleLoginSession.headers['Connection'] = 'keep-alive'
    AppleLoginSession.headers['Accept-Encoding'] = 'gzip, deflate, br'
    AppleLoginSession.headers['X-Apple-Locale']='zh_CN'
    r = AppleLoginSession.get('https://appleid.apple.com/#!&page=signin',verify = False)

    # Post访问idmasa.apple.com/app;eauth/auth/signin 带上{"accountName":"kgytb88qejp28@163.com","password":"Jhq19940831","rememberMe":false}以及serviceKey 获取scnt SessionID
    AppleLoginSession.headers['X-Apple-Widget-Key'] ='af1139274f266b22b68c2a3e7ad932cb3c0bbe854e13a79af78dcc73136882c3'
    #r.text[r.text.index('serviceKey:')+13:r.text.index('serviceKey:')+13+64]
    AppleLoginSession.headers['X-Apple-Locale'] = 'zh_CN'
    AppleLoginSession.headers['X-Apple-I-FD-Client-Info'] = GetJsCode()
    AppleLoginSession.headers['X-Requested-With'] = 'XMLHttpRequest'
    AppleLoginSession.headers['X-Apple-Domain-Id'] = '1'
    AppleRegPutJson4 = json.loads(AppleRegPutJson4)
    name = AppleRegPutJson4['account']['name']
    pwd = AppleRegPutJson4['account']['password']
    r = AppleLoginSession.post('https://idmsa.apple.com/appleauth/auth/signin', verify=False, data=InputAppleLoginInformatin(name,pwd))

    AppleLoginSession.headers['scnt'] = r.headers['scnt']
    AppleLoginSession.headers['X-Apple-ID-Session-Id'] = r.headers['X-Apple-ID-Session-Id']
    AppleLoginSession.headers['X-Apple-I-FD-Client-Info'] = GetJsCode()
    AppleLoginSession.headers['X-Apple-Domain-Id'] = '1'
    r = AppleLoginSession.get('https://idmsa.apple.com/appleauth/auth',verify = False)

    # Post访问https://idmsa.apple.com/appleauth/auth/verify/questions 提交答案

    QuestinJson = json.loads(r.text)
    questionA = ''
    questionB = ''
    for QuestionIt in iter(QuestinJson['securityQuestions']['questions']):
        if questionA == '':
            questionA = QuestionIt['question']
            idA = QuestionIt['id']
            numberA = QuestionIt['number']
        else:
            questionB = QuestionIt['question']
            idB = QuestionIt['id']
            numberB = QuestionIt['number']

    for QuestionIt in iter(AppleRegPutJson4['account']['security']['questions']):
        if int(idA) == int(QuestionIt['id']):
            answerA =QuestionIt['answer']
        elif int(idB) == int(QuestionIt['id']):
            answerB = QuestionIt['answer']
    JsonLoginApple2 = InputAppleLoginInformatin2(questionA,questionB,answerA,answerB,idA,idB,numberA,numberB)

    r = AppleLoginSession.post('https://idmsa.apple.com/appleauth/auth/verify/questions',  verify=False, data=JsonLoginApple2)

    AppleLoginSession.headers['X-Apple-ID-Session-Id']=''
    AppleLoginSession.headers['scnt'] = ''
    AppleLoginSession.headers['X-Apple-Domain-Id'] = ''
    AppleLoginSession.headers['X-Apple-Widget-Key']=''
    AppleLoginSession.headers['X-Apple-Locale'] = ''
    AppleLoginSession.headers['X-Apple-I-FD-Client-Info'] = ''
    AppleLoginSession.headers['X-Requested-With'] = ''
    AppleLoginSession.headers['Content-Type']=''
    AppleLoginSession.headers['Accept'] = 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8'
    AppleLoginSession.headers['Accept-Encoding'] = 'gzip, deflate, sdch, br'
    AppleLoginSession.headers['Upgrade-Insecure-Requests']='1'
    r = AppleLoginSession.get('https://appleid.apple.com/account/manage')

    #AppleLoginSession.headers['Accept-Encoding'] = 'gzip, deflate, br'
    #AppleLoginSession.headers['Accept'] = 'application/json, text/javascript, */*; q=0.01'



    return
#Test()
#GetJsCode2()
GetJsCode()
#Main()
#LoginCheckPatch()
#GetJsCode()
#
#LoginApple();
#LoginXiaoXin('future00','123456','123')
#
 function getCK(f, timeout) {
     var y = {
             1: [4, 15],
             110: [8, 239],
             74: [8, 238],
             57: [7, 118],
             56: [7, 117],
             71: [8, 233],
             25: [8, 232],
             101: [5, 28],
             104: [7, 111],
             4: [7, 110],
             105: [6, 54],
             5: [7, 107],
             109: [7, 106],
             103: [9, 423],
             82: [9, 422],
             26: [8, 210],
             6: [7, 104],
             46: [6, 51],
             97: [6, 50],
             111: [6, 49],
             7: [7, 97],
             45: [7, 96],
             59: [5, 23],
             15: [7, 91],
             11: [8, 181],
             72: [8, 180],
             27: [8, 179],
             28: [8, 178],
             16: [7, 88],
             88: [10, 703],
             113: [11, 1405],
             89: [12, 2809],
             107: [13, 5617],
             90: [14, 11233],
             42: [15, 22465],
             64: [16, 44929],
             0: [16, 44928],
             81: [9, 350],
             29: [8, 174],
             118: [8, 173],
             30: [8, 172],
             98: [8, 171],
             12: [8, 170],
             99: [7, 84],
             117: [6, 41],
             112: [6, 40],
             102: [9, 319],
             68: [9, 318],
             31: [8, 158],
             100: [7, 78],
             84: [6, 38],
             55: [6, 37],
             17: [7, 73],
             8: [7, 72],
             9: [7, 71],
             77: [7, 70],
             18: [7, 69],
             65: [7, 68],
             48: [6, 33],
             116: [6, 32],
             10: [7, 63],
             121: [8, 125],
             78: [8, 124],
             80: [7, 61],
             69: [7, 60],
             119: [7, 59],
             13: [8, 117],
             79: [8, 116],
             19: [7, 57],
             67: [7, 56],
             114: [6, 27],
             83: [6, 26],
             115: [6, 25],
             14: [6, 24],
             122: [8, 95],
             95: [8, 94],
             76: [7, 46],
             24: [7, 45],
             37: [7, 44],
             50: [5, 10],
             51: [5, 9],
             108: [6, 17],
             22: [7, 33],
             120: [8, 65],
             66: [8, 64],
             21: [7, 31],
             106: [7, 30],
             47: [6, 14],
             53: [5, 6],
             49: [5, 5],
             86: [8, 39],
             85: [8, 38],
             23: [7, 18],
             75: [7, 17],
             20: [7, 16],
             2: [5, 3],
             73: [8, 23],
             43: [9, 45],
             87: [9, 44],
             70: [7, 10],
             3: [6, 4],
             52: [5, 1],
             54: [5, 0]
         },
         E = ["%20", ";;;", "%3B", "%2C", "und", "fin", "ed;", "%28", "%29", "%3A", "/53", "ike", "Web", "0;", ".0", "e;", "on", "il", "ck", "01", "in", "Mo", "fa", "00", "32", "la", ".1", "ri", "it", "%u", "le"],
         s = ".0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz";

     function v(e, t, n, r) {
         "boolean" != typeof r && (r = !1);
         for (var a, i = !0;
             (a = e.indexOf(t)) >= 0 && (r || i);)
             e = e.substr(0, a) + n + e.substr(a + t.length),
             i = !1;
         return e
     }

     function G(e) {
         function t(e) {
             for (r = r << e[0] | e[1],
                 a += e[0]; a >= 6;)
                 e = r >> a - 6 & 63,
                 n += s.substring(e, e + 1),
                 a -= 6,
                 r ^= e << a
         }
         var n = "",
             r = 0,
             a = 0;
         t([6, (7 & e.length) << 3 | 0]),
             t([6, 56 & e.length | 1]);
         for (var i = 0; i < e.length; i++) {
             if (void 0 == y[e.charCodeAt(i)])
                 return;
             t(y[e.charCodeAt(i)])
         }
         return t(y[0]),
             a > 0 && t([6 - a, 0]),
             n
     }

     function w(e) {
         for (var t = G, n = e, r = 0; E[r]; r++)
             n = n.split(E[r]).join(String.fromCharCode(r + 1));
         if (t = t(n),
             void 0 == t)
             return e;
         for (n = 65535,
             r = 0; r < e.length; r++)
             n = 65535 & (n >>> 8 | n << 8),
             n ^= 255 & e.charCodeAt(r),
             n ^= (255 & n) >> 4,
             n ^= n << 12 & 65535,
             n ^= (255 & n) << 5 & 65535;
         return n &= 65535,
             e = "",
             e += s.charAt(n >>> 12),
             e += s.charAt(n >>> 6 & 63),
             e += s.charAt(63 & n),
             t += e
     }
     return f = v(f, escape("@UTC@"), (new Date).getTime()),
         f = v(f, escape("@CT@"), (new Date).getTime() - timeout),
         w(f)
 }


function getCK2(f) {
     var y = {
             1: [4, 15],
             110: [8, 239],
             74: [8, 238],
             57: [7, 118],
             56: [7, 117],
             71: [8, 233],
             25: [8, 232],
             101: [5, 28],
             104: [7, 111],
             4: [7, 110],
             105: [6, 54],
             5: [7, 107],
             109: [7, 106],
             103: [9, 423],
             82: [9, 422],
             26: [8, 210],
             6: [7, 104],
             46: [6, 51],
             97: [6, 50],
             111: [6, 49],
             7: [7, 97],
             45: [7, 96],
             59: [5, 23],
             15: [7, 91],
             11: [8, 181],
             72: [8, 180],
             27: [8, 179],
             28: [8, 178],
             16: [7, 88],
             88: [10, 703],
             113: [11, 1405],
             89: [12, 2809],
             107: [13, 5617],
             90: [14, 11233],
             42: [15, 22465],
             64: [16, 44929],
             0: [16, 44928],
             81: [9, 350],
             29: [8, 174],
             118: [8, 173],
             30: [8, 172],
             98: [8, 171],
             12: [8, 170],
             99: [7, 84],
             117: [6, 41],
             112: [6, 40],
             102: [9, 319],
             68: [9, 318],
             31: [8, 158],
             100: [7, 78],
             84: [6, 38],
             55: [6, 37],
             17: [7, 73],
             8: [7, 72],
             9: [7, 71],
             77: [7, 70],
             18: [7, 69],
             65: [7, 68],
             48: [6, 33],
             116: [6, 32],
             10: [7, 63],
             121: [8, 125],
             78: [8, 124],
             80: [7, 61],
             69: [7, 60],
             119: [7, 59],
             13: [8, 117],
             79: [8, 116],
             19: [7, 57],
             67: [7, 56],
             114: [6, 27],
             83: [6, 26],
             115: [6, 25],
             14: [6, 24],
             122: [8, 95],
             95: [8, 94],
             76: [7, 46],
             24: [7, 45],
             37: [7, 44],
             50: [5, 10],
             51: [5, 9],
             108: [6, 17],
             22: [7, 33],
             120: [8, 65],
             66: [8, 64],
             21: [7, 31],
             106: [7, 30],
             47: [6, 14],
             53: [5, 6],
             49: [5, 5],
             86: [8, 39],
             85: [8, 38],
             23: [7, 18],
             75: [7, 17],
             20: [7, 16],
             2: [5, 3],
             73: [8, 23],
             43: [9, 45],
             87: [9, 44],
             70: [7, 10],
             3: [6, 4],
             52: [5, 1],
             54: [5, 0]
         },
         E = ["%20", ";;;", "%3B", "%2C", "und", "fin", "ed;", "%28", "%29", "%3A", "/53", "ike", "Web", "0;", ".0", "e;", "on", "il", "ck", "01", "in", "Mo", "fa", "00", "32", "la", ".1", "ri", "it", "%u", "le"],
         s = ".0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz";

     function v(e, t, n, r) {
         "boolean" != typeof r && (r = !1);
         for (var a, i = !0;
             (a = e.indexOf(t)) >= 0 && (r || i);)
             e = e.substr(0, a) + n + e.substr(a + t.length),
             i = !1;
         return e
     }

     function G(e) {
         function t(e) {
             for (r = r << e[0] | e[1],
                 a += e[0]; a >= 6;)
                 e = r >> a - 6 & 63,
                 n += s.substring(e, e + 1),
                 a -= 6,
                 r ^= e << a
         }
         var n = "",
             r = 0,
             a = 0;
         t([6, (7 & e.length) << 3 | 0]),
             t([6, 56 & e.length | 1]);
         for (var i = 0; i < e.length; i++) {
             if (void 0 == y[e.charCodeAt(i)])
                 return;
             t(y[e.charCodeAt(i)])
         }
         return t(y[0]),
             a > 0 && t([6 - a, 0]),
             n
     }

     function w(e) {
         for (var t = G, n = e, r = 0; E[r]; r++)
             n = n.split(E[r]).join(String.fromCharCode(r + 1));
         if (t = t(n),
             void 0 == t)
             return e;
         for (n = 65535,
             r = 0; r < e.length; r++)
             n = 65535 & (n >>> 8 | n << 8),
             n ^= 255 & e.charCodeAt(r),
             n ^= (255 & n) >> 4,
             n ^= n << 12 & 65535,
             n ^= (255 & n) << 5 & 65535;
         return n &= 65535,
             e = "",
             e += s.charAt(n >>> 12),
             e += s.charAt(n >>> 6 & 63),
             e += s.charAt(63 & n),
             t += e
     }
     return f = w(f)

 }

 // 调用实例:
 var str = getCK('TF1;020;;;;;;;;;;;;;;;;;;;;;;Mozilla;Netscape;5.0%20%28Windows%20NT%206.1%3B%20Win64%3B%20x64%29%20AppleWebKit/537.36%20%28KHTML%2C%20like%20Gecko%29%20Chrome/58.0.3029.110%20Safari/537.36;20030107;undefined;true;;true;Win32;undefined;Mozilla/5.0%20%28Windows%20NT%206.1%3B%20Win64%3B%20x64%29%20AppleWebKit/537.36%20%28KHTML%2C%20like%20Gecko%29%20Chrome/58.0.3029.110%20Safari/537.36;zh-CN;undefined;;undefined;undefined;undefined;undefined;false;false;1496323474932;8;2005-6-7%2021%3A33%3A44;3440;1440;;25.0;;;;;@CT@;-480;-480;2017-6-1%2021%3A24%3A34;24;3440;1400;0;0;;;;;;Shockwave%20Flash%7CShockwave%20Flash%2025.0%20r0;;;;;;;;;;;;;;;;;;;;;;;;;;;;5.6.1-0;;', 1496323474923) 


var str = getCK2('TF1;020;;;;;;;;;;;;;;;;;;;;;;Mozilla;Netscape;5.0%20%28Windows%20NT%206.1%3B%20Win64%3B%20x64%29%20AppleWebKit/537.36%20%28KHTML%2C%20like%20Gecko%29%20Chrome/58.0.3029.110%20Safari/537.36;20030107;undefined;true;;true;Win32;undefined;Mozilla/5.0%20%28Windows%20NT%206.1%3B%20Win64%3B%20x64%29%20AppleWebKit/537.36%20%28KHTML%2C%20like%20Gecko%29%20Chrome/58.0.3029.110%20Safari/537.36;zh-CN;undefined;;undefined;undefined;undefined;undefined;false;false;1496323474932;8;2005-6-7%2021%3A33%3A44;3440;1440;;25.0;;;;;8;-480;-480;2017-6-1%2021%3A24%3A34;24;3440;1400;0;0;;;;;;Shockwave%20Flash%7CShockwave%20Flash%2025.0%20r0;;;;;;;;;;;;;;;;;;;;;;;;;;;;5.6.1-0;;') 
     // console.log(str) 2017-6-1 21:24:34
     //2017/6/1 21:24:34

[注意] 招人!base上海,课程运营、市场多个坑位等你投递!

最后于 2019-2-10 20:02 被future未来编辑 ,原因: 隐私被泄露了
收藏
点赞0
打赏
分享
最新回复 (10)
雪    币: 5249
活跃值: 活跃值 (634)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
大道在我 活跃值 2017-12-29 17:28
2
0
有意思  C语言写封包
雪    币: 6
活跃值: 活跃值 (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
bianhao 活跃值 2018-1-2 12:52
3
0
虽然我也写过这个,还是顶一下
雪    币: 18
活跃值: 活跃值 (23)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
deadxing 活跃值 2018-1-2 16:57
4
0
需要这么复杂吗。。
雪    币: 209
活跃值: 活跃值 (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
李忠才 活跃值 2018-1-3 21:07
5
0
编译好的文件在哪呢
雪    币: 3651
活跃值: 活跃值 (540)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
MsScotch 活跃值 2018-1-4 09:40
6
0
看起来很好啊,比用iTunes.dll好多了
雪    币: 0
能力值: (RANK:10 )
在线值:
发帖
回帖
粉丝
迈凯伦 活跃值 2018-4-9 15:48
7
0
你好!能交流下吗?
雪    币: 34
活跃值: 活跃值 (27)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
天之道 活跃值 2018-10-19 23:05
8
0
现在还能用吗
雪    币: 2115
活跃值: 活跃值 (858)
能力值: ( LV3,RANK:20 )
在线值:
发帖
回帖
粉丝
yegu 活跃值 2020-2-25 12:01
11
0
感谢lz的分享,我也顺利的跑通了Apple ID网站的登录的各种口令挑战,登录成功之后的其他操作就好办了。
游客
登录 | 注册 方可回帖
返回