forked from liyf-code/reverse_practice
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdemo.py
66 lines (51 loc) · 1.76 KB
/
demo.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# _*_ coding: utf-8 _*_
# @Date: 10:36 上午
# @File: demo.py
# @Author: liyf
'''
对查策网(https://www.chacewang.com/chanye/index#)的响应数据进行解密
打xhr断点,一步一步调试
或者搜索关键字`decrypt(`或者`JSON.parse(`也可以定位到加密位置
已完成:
- 响应数据解密已破解
未完成:
- 响应数据中的申报时间字段(start_time、end_time)进行了字体加密,未破解
'''
import requests
from utils import *
def get_encrypt_data(page: str):
headers = {
'authority': 'web.chace-ai.com',
'accept': 'application/json, text/plain, */*',
'accept-language': 'zh-CN,zh;q=0.9',
'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36',
# "authorization": "Bearer xxxxxx"
}
params = {
'page': page,
'size': '20',
'industry': '',
'area': 'RegisterArea_ZXS_Shanghai',
'dept': '',
'partition': '',
'pe_name': '',
'currentArea': 'RegisterArea_ZXS_Shanghai',
'query_date': '0',
'full_search': '0',
'sort_type': '0',
}
response = requests.get('https://web.chace-ai.com/api/ccw/project/evaluation/getList/', params=params,
headers=headers)
return response.json()
def get_decrypt_data(encrypt_data):
ctx = Utils(js_file_name='demo.js').read_js_file()
return ctx.call('get_decrypt_data', encrypt_data)
def parse():
for page in range(1, 10):
results = get_encrypt_data(str(page))
encrypt_data = results['data']
decrypt_data = get_decrypt_data(encrypt_data)
print(decrypt_data)
break
if __name__ == '__main__':
parse()