Python爬虫实战:app抓取 - so文件协议破解 安卓练习 猿人学比赛题目11题详解
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了Python爬虫实战:app抓取 - so文件协议破解 安卓练习 猿人学比赛题目11题详解,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含2024字,纯文字阅读大概需要3分钟。
内容图文
题目链接:http://match.yuanrenxue.com/match/11
安装好app后,打开HttpCanary抓包,然后随意查询一个范围内的数字
这里可以看到加载了一个so文件,然后调用了getSign方法得到了sign,如果继续静态分析的话,就要用到IDA来分析,这里我直接使用python+frida框架解决
这里跳过配置环境的部分,直接遍历0-9999来调用getSign方法获取sign,因为请求次数比较多,所以我这里还是用了多线程进行请求
import frida
import sys
import queue
import threading
import requests
from urllib import parse
class Producer(threading.Thread):
def __init__(self, baoming):
threading.Thread.__init__(self)
self.baoming = baoming
def run(self):
process = frida.get_remote_device().attach(self.baoming)
script = process.create_script(jscode)
script.on("message", message)
script.load()
sys.stdin.read()
class Consumer(threading.Thread):
def __init__(self, q):
threading.Thread.__init__(self)
self.q = q
def run(self):
global sums
while True:
try:
sign = self.q.get(timeout=10)
except:
break
nid, sign = sign.split(':')
while True:
try:
response = requests.get('https://sekiro.virjar.com/yuanrenxue/query?id='+nid+'&sign='+parse.quote(sign)).json()
break
except:
pass
print(nid)
print(response)
sums += response['data']
sums = 0
workqueue = queue.Queue(maxsize=0)
jscode = """
Java.perform(function () {
var OnlineJudgeApp = Java.use('com.yuanrenxue.onlinejudge2020.OnlineJudgeApp');
OnlineJudgeApp.getSign.implementation = function (j){
console.log('HOOK 开始');
for (i = 0; i < 10000; i++){
var sign = this.getSign(i);
send(i+':'+sign);
}
console.log('HOOK 结束');
return this.getSign(j);;
};
});
"""
def message(message, data):
global i
global workqueue
if message["type"] == 'send':
sign = message['payload']
workqueue.put(sign)
else:
print(message['stack'])
def main():
global workqueue
global sums
# 创建线程列表
threads = []
# 创建新线程,并开始线程
for eachthread in range(0, 32):
thread = Consumer(workqueue)
thread.start()
threads.append(thread)
baoming = 'com.yuanrenxue.onlinejudge2020'
thread = Producer(baoming)
thread.start()
# 等待所有线程结束
for t in threads:
t.join()
print(sums)
# 总和:4925000
if __name__ == '__main__':
main()
内容总结
以上是互联网集市为您收集整理的Python爬虫实战:app抓取 - so文件协议破解 安卓练习 猿人学比赛题目11题详解全部内容,希望文章能够帮你解决Python爬虫实战:app抓取 - so文件协议破解 安卓练习 猿人学比赛题目11题详解所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。