js加密(七)steam登录,


1. url: https://store.steampowered.com/login/?redir=&redir_ssl=1

2. target: 登录

from afterWork.config import proxies, userAgent import requests import json import time import re import execjs def getModExp(data): res = requests.post(url='https://store.steampowered.com/login/getrsakey/', data=data, headers={'User-Agent': userAgent.random()}) # print(res.text) jsonInfo = json.loads(res.text) mod = jsonInfo['publickey_mod'] exp = jsonInfo['publickey_exp'] return mod, exp def getData(userName, donotcache): data = { 'donotcache': donotcache, 'username': userName } return json.loads(json.dumps(data)) def accountInfo(): userName = '你的用户名' pw = '你的密码' donotcache = re.sub(r'\.', '', str(time.time()))[:-4] # print(donotcache) # print('1577238990888') return userName, pw, donotcache def getJsCode(): with open('jsCode.js', 'r') as f: jsCode = f.read() return jsCode def getLoginData(username, pw, donotcache): loginData = { 'donotcache': donotcache, 'password': pw, 'username': username, 'twofactorcode': '', 'emailauth': '', 'loginfriendlyname': '', 'captchagid': '-1', 'captcha_text': '', 'emailsteamid': '', 'rsatimestamp': '111645050000', 'remember_login': 'false' } print(loginData) return json.loads(json.dumps(loginData)) def login(loginData): res = requests.post(url='https://store.steampowered.com/login/dologin/', data=loginData, headers={'User-Agent': userAgent.random()}) print(res.text) return def mainFun(): userName, pw, donotcache = accountInfo() data = getData(userName, donotcache) # print(type(data)) mod, exp = getModExp(data) jsCode = getJsCode() ctx = execjs.compile(jsCode) result = ctx.call('getPW', pw, mod, exp) # print(result) loginData = getLoginData(userName, result, donotcache) # print(type(loginData)) login(loginData) if __name__ == '__main__': mainFun()

结果,登录成功返回这些东西:

 

 学习交流,勿作他用。

相关内容

    暂无相关文章

评论关闭