题目链接:http://match.yuanrenxue.com/match/11
安装好app后,打开httpCanary抓包,然后随意查询一个范围内的数字
这里可以看到加载了一个so文件,然后调用了getSign方法得到了sign,如果继续静态分析的话,就要用到IDA来分析,这里我直接使用python+frIDa框架解决
这里跳过配置环境的部分,直接遍历0-9999来调用getSign方法获取sign,因为请求次数比较多,所以我这里还是用了多线程进行请求
import frIDaimport sysimport queueimport threadingimport requestsfrom 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 = 0workqueue = 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题详解所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)