哲风壁纸逆向

阿巴阿巴

最近找图片时无意发现发现了这个站,看了一下内容还不错,准备细细品尝的时候发现数据是加密的,于是开始逆向之旅。


请求响应值都是加密的
先对响应值进行分析直接hook parse

进入该函数

然后我试试几个常见的关键词,然后就直接出来了 aes加密

请求加密在下面,就是对”{"page":"1","sortType":3,"isSel":"true","rows":9,"isFavorites":false,"wpType":1}”加密,就不放出来了

最终效果

源码

import requests
import hashlib
import base64
from Crypto.Cipher import AES
from Crypto.Util.Padding import pad, unpad
def get_data(r):
j = "68zhehao20776519".encode('utf-8')
q = "aa176b7519e84710".encode('utf-8')
cipher = AES.new(j, AES.MODE_CBC, iv=q)
padded_data = pad(r.encode('utf-8'), AES.block_size)
ciphertext = cipher.encrypt(padded_data)
hex_encoded = ciphertext.hex()
base64_encoded = base64.b64encode(bytes.fromhex(hex_encoded)).decode('utf-8')
return base64_encoded
def send(data):
cookies = {}
headers = {}

params = {
'data': data,
}

response = requests.get('https://haowallpaper.com/link/pc/wallpaper/getWallpaperList', params=params, cookies=cookies, headers=headers).json()
encoded = response['data']
return encoded
def y(r):
if not isinstance(r, str):
return r
try:
decoded_hex = base64.b64decode(r).hex()
se = "68zhehao20776519".encode('utf-8')
he = "aa176b7519e84710".encode('utf-8')
cipher = AES.new(se, AES.MODE_CBC, iv=he)
ciphertext_bytes = bytes.fromhex(decoded_hex)
decrypted_data = cipher.decrypt(ciphertext_bytes)
unpadded_data = unpad(decrypted_data, AES.block_size)
decrypted_string = unpadded_data.decode('utf-8').rstrip('\x00')
return decrypted_string

except Exception as e:
print(f"jm: {e}")
return None

if __name__ == '__main__':
R = "{\"page\":\"1\",\"sortType\":3,\"isSel\":\"true\",\"rows\":9,\"isFavorites\":false,\"wpType\":1}"
data = get_data(R)
enc=send(data)
# print(enc)
dec = y(enc)
print(dec)