mirror of
https://github.com/luzhisheng/js_reverse.git
synced 2025-04-21 00:25:09 +08:00
63js加密传输数据与返回数据二进制-RC4
This commit is contained in:
parent
09d854f001
commit
be2f8750d5
34
猿人学练习/63js加密传输数据与返回数据二进制-RC4/main.py
Normal file
34
猿人学练习/63js加密传输数据与返回数据二进制-RC4/main.py
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
import requests
|
||||||
|
from rc4_encrypt import decrypt, encrypt
|
||||||
|
|
||||||
|
|
||||||
|
def challenge63(page):
|
||||||
|
url = f"https://www.python-spider.com/api/challenge63"
|
||||||
|
payload = f"page={page}"
|
||||||
|
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):
|
||||||
|
response_text = challenge63(page)
|
||||||
|
print(response_text)
|
||||||
|
exit()
|
||||||
|
encrypted_text = decrypt('12345678812345678912345678912345', str(page))
|
||||||
|
data_list = response_json.get('data')
|
||||||
|
print(data_list)
|
||||||
|
exit()
|
||||||
|
for data in data_list:
|
||||||
|
data_num += int(data.get('value'))
|
||||||
|
print(data_num)
|
||||||
|
print(data_num)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
run()
|
30
猿人学练习/63js加密传输数据与返回数据二进制-RC4/rc4_encrypt.py
Normal file
30
猿人学练习/63js加密传输数据与返回数据二进制-RC4/rc4_encrypt.py
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
from Crypto.Cipher import ARC4
|
||||||
|
import base64
|
||||||
|
|
||||||
|
|
||||||
|
def encrypt(data, key1): # 加密
|
||||||
|
key = bytes(key1, encoding='utf-8')
|
||||||
|
enc = ARC4.new(key)
|
||||||
|
res = enc.encrypt(data.encode('utf-8'))
|
||||||
|
res = base64.b64encode(res)
|
||||||
|
res = str(res, 'utf-8')
|
||||||
|
return res
|
||||||
|
|
||||||
|
|
||||||
|
def decrypt(data, key1): # 解密
|
||||||
|
data = base64.b64decode(data)
|
||||||
|
key = bytes(key1, encoding='utf-8')
|
||||||
|
enc = ARC4.new(key)
|
||||||
|
res = enc.decrypt(data)
|
||||||
|
res = str(res, 'gbk')
|
||||||
|
return res
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
data = 'yVRgZ6DVKwYwaqb3CsPFrqsanQvDUS/6MqHLTaztbqc+8nVQ26ZIwrEYViYNyLc7I7WTIkZgJGEUq0mtMVXnDajHnestfk' \
|
||||||
|
'Z7WoYTXFYbCVa8vghXgbj0EZzp6q7gKDf9Rd9HaxZxapX5GqqRf62dwiHxL3YRJ5LbIB/xSfO1GoEZR55TQHeEff3PwH4M0i' \
|
||||||
|
'p8aC8rX3K2PFOvCqpcj495OavfnlgT2otxLcqKHOnZyC1/cKvLpFjADDTbasbon42aCqcm116+2sNktwfo29ncTz7jawIZc4' \
|
||||||
|
'MR9DfYdA8aI/aZl5MbbKhLKHo=' # 需要加密的内容
|
||||||
|
key = '12345678812345678912345678912345' # 加密key
|
||||||
|
print('解密后:')
|
||||||
|
print(decrypt(data, key)) # 解密方法
|
Loading…
x
Reference in New Issue
Block a user