某漫畫app逆向
- 一工具的準備
- 二專案思路
- 三簡易代碼提供參考
一工具的準備
1.fiddler抓包工具 ,夜神模擬器
2.python環境,Java環境
3.漫畫app準備
4.java反編譯工具
二專案思路
配置好抓包工具和夜神模擬器
豆瓣夾下載漫畫applink.
安裝到夜神模擬器

抓取app資料

決議抓取的資料:
post請求
變化的引數client-time, client-sign
client-time 比較明顯是時間戳
client-sign 是加密資料

client_type = 'android'
app_devicetoken = "e571dd8bd67803995b9bdcfefb58662b"
phone_mark = "58D83850AA58CCB094954B30F9C4D3C4"
client_time = str(int(time.time() * 1000))
決議app
將apk安裝包后綴修改為rar, 解壓壓縮包得到app對應檔案


得到Java的classes檔案
對獲取的classes.dex進行反編譯,工具可以自行查找,或者溝通群獲取
將classes.dex 移動到決議的檔案夾
進入windows powershell cd 到反編譯的檔案夾
執行命令 .\d2j-dex2jar.bat .\classes.dex
得到 classes-dex2jar.jar 檔案 這個就是java的源代碼了




將代碼拖動到你的java反編譯器 JD-GUI
就能得到全部的java代碼

搜索對應的加密引數:client-sign
確定生成client-sign 為b.class 打開對應檔案
找到資料的加密規則
原來加密的方式是md5
加密的資料是由時間戳來決定的



content = '3.0.1' + client_type + str(client_time) + app_devicetoken + phone_mark + "0" + "" + "{54563A97-2BBA-7F31-D4C1-8EF72F4A98E6}"
client_sign = hashlib.md5(content.encode("utf-8")).hexdigest()
確定請求頭的全部引數
headers = {
'client-ver': '3.0.1',
'client-type': client_type,
'client-time': str(client_time),
'phone-mark': phone_mark,
'app-devicetoken': app_devicetoken,
'sina-uid': '0',
'sina-token': '',
'VREADREFER': 'vmh_client',
'client-sign': client_sign,
'Cache-Control': 'no-cache',
'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8',
'Content-Length': '223',
'Host': 'api.manhua.weibo.com',
'Connection': 'Keep-Alive',
'Accept-Encoding': 'gzip',
'User-Agent': 'okhttp/3.8.0',
}
需要傳遞的引數
data = "client_ver=3.0.1&client_type={}&client_time={}&phone_mark={}&app_devicetoken={}&sina_uid=0&sina_token=&client_sign={}".format(client_type, client_time, phone_mark, app_devicetoken, client_sign)
三簡易代碼提供參考
內容涉及該app, 只限技術探討
扣扣群獲取編譯工具:731685275
import requests
import time
import hashlib
import os
client_type = 'android'
app_devicetoken = "e571dd8bd67803995b9bdcfefb58662b"
phone_mark = "58D83850AA58CCB094954B30F9C4D3C4"
client_time = str(int(time.time() * 1000))
content = '3.0.1' + client_type + str(client_time) + app_devicetoken + phone_mark + "0" + "" + "{54563A97-2BBA-7F31-D4C1-8EF72F4A98E6}"
client_sign = hashlib.md5(content.encode("utf-8")).hexdigest()
headers = {
'client-ver': '3.0.1',
'client-type': client_type,
'client-time': str(client_time),
'phone-mark': phone_mark,
'app-devicetoken': app_devicetoken,
'sina-uid': '0',
'sina-token': '',
'VREADREFER': 'vmh_client',
'client-sign': client_sign,
'Cache-Control': 'no-cache',
'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8',
'Content-Length': '223',
'Host': 'api.manhua.weibo.com',
'Connection': 'Keep-Alive',
'Accept-Encoding': 'gzip',
'User-Agent': 'okhttp/3.8.0',
}
data = "client_ver=3.0.1&client_type={}&client_time={}&phone_mark={}&app_devicetoken={}&sina_uid=0&sina_token=&client_sign={}".format(client_type, client_time, phone_mark, app_devicetoken, client_sign)
def parse_data(url):
response = requests.post(url, headers=headers, data=data).json()
page_list = response["data"]["chapter_list"]
for x in page_list:
page_url = "http://api.manhua.weibo.com/client/comic/show?comic_id=68236/client/comic/play?chapter_id={}".format(x["chapter_id"])
dir_name = r"漫畫\\" + x["chapter_name"]
page_data = requests.post(page_url, headers=headers, data=data).json()["data"]["json_content"]["page"]
y = 0
for i in page_data:
if not os.path.exists(dir_name):
os.makedirs(dir_name)
result = requests.get(i["mobileImgUrl"]).content
path = dir_name + "\\" + str(y) + ".jpg"
with open(path, "wb")as f:
f.write(result)
print("正在下載", path)
y += 1
def main():
url = "http://api.manhua.weibo.com/client/comic/show?comic_id=68236"
parse_data(url)
if __name__ == '__main__':
main()
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/271356.html
標籤:python
