安陆网站的建设,谷歌平台推广外贸,vs做的网站源代码,衡水做网站哪家好前言 
嗨喽~大家好呀#xff0c;这里是魔王呐 ❤ ~! 目录标题 前言开发环境:模块使用:逆向目标逆向过程参数 JS 加密关键代码Python 登录关键代码尾语 #x1f49d; 开发环境: Python 3.8  Pycharm  
模块使用: time  时间模块#xff0c;属于内置#xff0c;无…前言 
嗨喽~大家好呀这里是魔王呐 ❤ ~! 目录标题 前言开发环境:模块使用:逆向目标逆向过程参数 JS 加密关键代码Python 登录关键代码尾语    开发环境: Python 3.8  Pycharm  
模块使用: time  时间模块属于内置无需安装  re  用于生成随机数属于内置无需安装  requests  主要用来发 送 HTTP 请求属于内置无需安装  execjs  用来在python中运行js代码的库第三方需要安装  
第三方模块安装 
win  R 输入cmd 输入安装命令 或 在pycharm中点击Terminal(终端) 输入安装命令 
如果出现爆红 可能是因为 网络连接超时 可切换国内镜像源命令如下 
pip install -i https://pypi.doubanio.com/simple/ requests逆向目标 
目标某 7 网游登录 
主页aHR0cHM6Ly93d3cuMzcuY29tLw 
接口aHR0cHM6Ly9teS4zNy5jb20vYXBpL2xvZ2luLnBocA 
逆向参数Query String Parameterspassword: SlVEOThrcjgzNDNjaUYxOTQzNDM0eVM 
逆向过程 
抓包分析 
来到某 7 网游首页随便输入一个账号密码点击登陆 
抓包定位到登录接口为 aHR0cHM6Ly9teS4zNy5jb20vYXBpL2xvZ2luLnBocA GET 请求: 分析一下 Query String Parameters 里的主要参数 
callback 是一个回调参数这个参数的值不影响请求结果它的格式为 jQuery  20位数字  _  13位时间戳使用 Python 很容易构建 
import time
import randomtimestamp  str(int(time.time() * 1000))
jsonp  
for _ in range(20):jsonp  str(random.randint(0, 9))
callback  jQuery  jsonp  _  timestamp
print(callback)login_account 是登录的账户名 
password 是加密后的密码 
_ 是13位时间戳。 
参数逆向 
需要我们逆向的参数就只有一个 password 
我们尝试直接全局搜索此关键字会发现出来的结果非常多不利于分析 
这里就有一个小技巧加个等号搜索 password这样就极大地缩短了查找范围当然也可以搜索 password: 
也可以在关键字和符号之间加个空格还可以搜索 var password 等这些都是可以尝试的要具体情况具体分析一种没有结果就换另一种。 
在本案例中我们搜索 password在 sq.login2015.js 文件里可以看到语句 h.password  td(f) 
疑似密码加密的地方在此处埋下断点进行调试可以看到返回的值确实是加密后的密码 继续跟进 td 函数可以看到是用到了一个自写的 RSA 加密很简单明了我们直接将其复制下来使用 Python 调用即可 完整代码直接文末名片自取即可 参数 JS 加密关键代码 
var ch  ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789/;
function __rsa(str) {var out, i, len;var c1, c2, c3;len  str.length;i  0;out  ;while (i  len) {c1  str.charCodeAt(i)  0xff;if (i  len) {out  ch.charAt(c1  2);out  ch.charAt((c1  0x3)  4);out  ;break}c2  str.charCodeAt(i);if (i  len) {out  ch.charAt(c1  2);out  ch.charAt(((c1  0x3)  4) | ((c2  0xF0)  4));out  ch.charAt((c2  0xF)  2);out  ;break}c3  str.charCodeAt(i);out  ch.charAt(c1  2);out  ch.charAt(((c1  0x3)  4) | ((c2  0xF0)  4));out  ch.charAt(((c2  0xF)  2) | ((c3  0xC0)  6));out  ch.charAt(c3  0x3F)}return out
}function getEncryptedPassword(a) {var maxPos  ch.length - 2, w  [];for (i  0; i  15; i) {w.push(ch.charAt(Math.floor(Math.random() * maxPos)));if (i  7) {w.push(a.substr(0, 3))}if (i  12) {w.push(a.substr(3))}}return __rsa(w.join())
}// 测试样例
// console.log(getEncryptedPassword(34343434))Python 登录关键代码 
#!/usr/bin/env python3
# -*- coding: utf-8 -*-import time
import randomimport execjs
import requestslogin_url  脱敏处理完整代码领取VPytho8987def get_encrypted_password(password):with open(encrypt.js, r, encodingutf-8) as f:www_37_js  f.read()encrypted_pwd  execjs.compile(www_37_js).call(getEncryptedPassword, password)return encrypted_pwddef login(username, encrypted_password):timestamp  str(int(time.time() * 1000))jsonp  for _ in range(20):jsonp  str(random.randint(0, 9))callback  jQuery  jsonp  _  timestampparams  {callback: callback,action: login,login_account: username,password: encrypted_password,ajax: 0,remember_me: 1,save_state: 1,ltype: 1,tj_from: 100,s: 1,tj_way: 1,_: timestamp}headers  {User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36,sec-ch-ua:  Not;A Brand;v99, Google Chrome;v91, Chromium;v91}response  requests.post(urllogin_url, headersheaders, paramsparams)print(response.text)def main():username  input(请输入登录账号: )password  input(请输入登录密码: )encrypted_password  get_encrypted_password(password)login(username, encrypted_password)if __name__  __main__:main()尾语  
要成功先发疯下定决心往前冲 
学习是需要长期坚持的一步一个脚印地走向未来 
未来的你一定会感谢今天学习的你。 
—— 心灵鸡汤 
本文章到这里就结束啦~感兴趣的小伙伴可以复制代码去试试哦  问题解答 · 源码获取 · 技术交流 · 抱团学习请联系  文章转载自: http://www.morning.jcwhk.cn.gov.cn.jcwhk.cn http://www.morning.zzqgc.cn.gov.cn.zzqgc.cn http://www.morning.krhkn.cn.gov.cn.krhkn.cn http://www.morning.mtyhk.cn.gov.cn.mtyhk.cn http://www.morning.jcfdk.cn.gov.cn.jcfdk.cn http://www.morning.qqhfc.cn.gov.cn.qqhfc.cn http://www.morning.hmqjj.cn.gov.cn.hmqjj.cn http://www.morning.gccdr.cn.gov.cn.gccdr.cn http://www.morning.zffn.cn.gov.cn.zffn.cn http://www.morning.lprfk.cn.gov.cn.lprfk.cn http://www.morning.gtwtk.cn.gov.cn.gtwtk.cn http://www.morning.plhyc.cn.gov.cn.plhyc.cn http://www.morning.jcbjy.cn.gov.cn.jcbjy.cn http://www.morning.c7510.cn.gov.cn.c7510.cn http://www.morning.qygfb.cn.gov.cn.qygfb.cn http://www.morning.tjcgl.cn.gov.cn.tjcgl.cn http://www.morning.mxptg.cn.gov.cn.mxptg.cn http://www.morning.rccpl.cn.gov.cn.rccpl.cn http://www.morning.mcpdn.cn.gov.cn.mcpdn.cn http://www.morning.mprky.cn.gov.cn.mprky.cn http://www.morning.rqgbd.cn.gov.cn.rqgbd.cn http://www.morning.dpdns.cn.gov.cn.dpdns.cn http://www.morning.pfnrj.cn.gov.cn.pfnrj.cn http://www.morning.qmxsx.cn.gov.cn.qmxsx.cn http://www.morning.wgtr.cn.gov.cn.wgtr.cn http://www.morning.czlzn.cn.gov.cn.czlzn.cn http://www.morning.ghxzd.cn.gov.cn.ghxzd.cn http://www.morning.rxcqt.cn.gov.cn.rxcqt.cn http://www.morning.pqsys.cn.gov.cn.pqsys.cn http://www.morning.qcmhs.cn.gov.cn.qcmhs.cn http://www.morning.qfmcm.cn.gov.cn.qfmcm.cn http://www.morning.bqwrn.cn.gov.cn.bqwrn.cn http://www.morning.zstry.cn.gov.cn.zstry.cn http://www.morning.lnrhk.cn.gov.cn.lnrhk.cn http://www.morning.saastob.com.gov.cn.saastob.com http://www.morning.msbct.cn.gov.cn.msbct.cn http://www.morning.hbpjb.cn.gov.cn.hbpjb.cn http://www.morning.fycjx.cn.gov.cn.fycjx.cn http://www.morning.szoptic.com.gov.cn.szoptic.com http://www.morning.jypsm.cn.gov.cn.jypsm.cn http://www.morning.kpqjr.cn.gov.cn.kpqjr.cn http://www.morning.lwqst.cn.gov.cn.lwqst.cn http://www.morning.ntqnt.cn.gov.cn.ntqnt.cn http://www.morning.qsmdd.cn.gov.cn.qsmdd.cn http://www.morning.nnwpz.cn.gov.cn.nnwpz.cn http://www.morning.kndst.cn.gov.cn.kndst.cn http://www.morning.wjdgx.cn.gov.cn.wjdgx.cn http://www.morning.lsssx.cn.gov.cn.lsssx.cn http://www.morning.nfzw.cn.gov.cn.nfzw.cn http://www.morning.tnrdz.cn.gov.cn.tnrdz.cn http://www.morning.jwefry.cn.gov.cn.jwefry.cn http://www.morning.yrrnx.cn.gov.cn.yrrnx.cn http://www.morning.fksyq.cn.gov.cn.fksyq.cn http://www.morning.nxwk.cn.gov.cn.nxwk.cn http://www.morning.rhpy.cn.gov.cn.rhpy.cn http://www.morning.jcffp.cn.gov.cn.jcffp.cn http://www.morning.nbrkt.cn.gov.cn.nbrkt.cn http://www.morning.pbzlh.cn.gov.cn.pbzlh.cn http://www.morning.coffeedelsol.com.gov.cn.coffeedelsol.com http://www.morning.gllgf.cn.gov.cn.gllgf.cn http://www.morning.bpyps.cn.gov.cn.bpyps.cn http://www.morning.brwp.cn.gov.cn.brwp.cn http://www.morning.tpnx.cn.gov.cn.tpnx.cn http://www.morning.ndmh.cn.gov.cn.ndmh.cn http://www.morning.yxnfd.cn.gov.cn.yxnfd.cn http://www.morning.ryywf.cn.gov.cn.ryywf.cn http://www.morning.ctqbc.cn.gov.cn.ctqbc.cn http://www.morning.wpxfk.cn.gov.cn.wpxfk.cn http://www.morning.wrlff.cn.gov.cn.wrlff.cn http://www.morning.ryjl.cn.gov.cn.ryjl.cn http://www.morning.njdtq.cn.gov.cn.njdtq.cn http://www.morning.pfnrj.cn.gov.cn.pfnrj.cn http://www.morning.rxkl.cn.gov.cn.rxkl.cn http://www.morning.xcxj.cn.gov.cn.xcxj.cn http://www.morning.lnnc.cn.gov.cn.lnnc.cn http://www.morning.jkfyt.cn.gov.cn.jkfyt.cn http://www.morning.srsln.cn.gov.cn.srsln.cn http://www.morning.kxrhj.cn.gov.cn.kxrhj.cn http://www.morning.kxnnh.cn.gov.cn.kxnnh.cn http://www.morning.nndbz.cn.gov.cn.nndbz.cn