58js加密勇敢牛牛不怕困难-md5-16位

This commit is contained in:
luzhisheng 2023-02-06 13:44:09 +08:00
parent 3ab2db6008
commit 2d06f4cc16
6 changed files with 62 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

View File

@ -0,0 +1,41 @@
import json
import requests
import hashlib
def md5_value_32(key):
sign = hashlib.md5(key.encode()).hexdigest()
return sign
def md5_value_16(key):
sign = hashlib.md5(key.encode()).hexdigest()[8:-8]
return sign
def challenge58(page, token):
url = "https://www.python-spider.com/api/challenge58"
payload = f"page={page}&token={token}"
session = requests.session()
headers = {
'content-type': 'application/x-www-form-urlencoded; charset=UTF-8'
}
session.headers = headers
response = session.request("POST", url, data=payload)
return response.text
def run():
data_num = 0
for page in range(1, 101):
safe = md5_value_16(str(page))
res_dict = json.loads(challenge58(page, safe))
data_list = res_dict.get('data')
for data in data_list:
data_num += int(data.get('value'))
print(data_num)
print(data_num)
if __name__ == '__main__':
run()

View File

@ -0,0 +1,21 @@
# 知识点: md5的16位加密
## 解题思路
观察请求内容发现存在固定的token值
![请求](./img/1.png)
跟值进入js中发现代码`i.hasContent && i.data || null`,这断代码最终执行`i.data`
![请求](./img/2.png)
继续控制调试,发现此断代码`md5(k['toString']())`传入的是k的字符串而k是页码
![请求](./img/3.png)
这里可以利用在线md5工具比对加密结果
![请求](./img/4.png)
问题解决是md5的16位加密