Initialize encryption and JavaScript reverse-engineering study repository
Document the project structure and setup while excluding local dependencies and IDE settings. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
20
对称加密-2026-08-21/实战案例-自然科学/js解密.js
Normal file
20
对称加密-2026-08-21/实战案例-自然科学/js解密.js
Normal file
File diff suppressed because one or more lines are too long
55
对称加密-2026-08-21/实战案例-自然科学/调用解密.py
Normal file
55
对称加密-2026-08-21/实战案例-自然科学/调用解密.py
Normal file
@@ -0,0 +1,55 @@
|
||||
import json
|
||||
import time
|
||||
|
||||
import requests
|
||||
import execjs
|
||||
|
||||
headers = {
|
||||
"Accept": "application/json, text/plain, */*",
|
||||
"Accept-Language": "zh-CN,zh;q=0.9",
|
||||
"Authorization": "Bearer false",
|
||||
"Connection": "keep-alive",
|
||||
"Content-Type": "application/json;charset=UTF-8",
|
||||
"Origin": "https://kd.nsfc.cn",
|
||||
"Referer": "https://kd.nsfc.cn/finalSearchList?s=%E7%AC%AC%E4%B8%80%E6%80%A7%E5%8E%9F%E7%90%86%E8%AE%A1%E7%AE%97",
|
||||
"Sec-Fetch-Dest": "empty",
|
||||
"Sec-Fetch-Mode": "cors",
|
||||
"Sec-Fetch-Site": "same-origin",
|
||||
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/152.0.0.0 Safari/537.36",
|
||||
"sec-ch-ua": "\"Chromium\";v=\"152\", \"Not?A_Brand\";v=\"24\", \"Google Chrome\";v=\"152\"",
|
||||
"sec-ch-ua-mobile": "?0",
|
||||
"sec-ch-ua-platform": "\"Windows\""
|
||||
}
|
||||
with open("js解密.js", "r", encoding="utf-8") as f:
|
||||
js_code = f.read()
|
||||
|
||||
|
||||
ctx = execjs.compile(js_code)
|
||||
|
||||
url = 'https://kd.nsfc.cn/api/baseQuery/completionQueryResultsData'
|
||||
for page in range(1, 11):
|
||||
data = {
|
||||
"complete": True,
|
||||
"fuzzyKeyword": "第一性原理计算",
|
||||
"isFuzzySearch": True,
|
||||
"conclusionYear": "近五年",
|
||||
"dependUnit": "",
|
||||
"keywords": "",
|
||||
"pageNum": page,
|
||||
"pageSize": 10,
|
||||
"projectType": "",
|
||||
"projectTypeName": "",
|
||||
"code": "",
|
||||
"ratifyYear": "",
|
||||
"order": "enddate",
|
||||
"ordering": "desc",
|
||||
"codeScreening": "",
|
||||
"dependUnitScreening": "",
|
||||
"keywordsScreening": "",
|
||||
"projectTypeNameScreening": ""
|
||||
}
|
||||
response = requests.post(url, headers=headers, json=data)
|
||||
result = ctx.call("g", response.text)
|
||||
print(json.loads(result))
|
||||
time.sleep(1)
|
||||
|
||||
Reference in New Issue
Block a user