当前位置:网站首页>JS reverse | four libraries and one platform response data encryption
JS reverse | four libraries and one platform response data encryption
2022-06-26 10:22:00 【One room】
Statement : This article is for study only , It is forbidden to be used for illegal purposes , Otherwise, we will be responsible for the consequences . If your rights and interests are infringed , Please contact me immediately to delete !
Preface
The target site :aHR0cDovL2p6c2MubW9odXJkLmdvdi5jbi9kYXRhL2NvbXBhbnk=
Grab the bag
Bag grabbing discovery , The response data is a string of characters , Description is encrypted .
Find the encrypted location
next xhr The breakpoint , Turn the page to break the breakpoint , Then go back to the stack , Come here .
Although the response data is encrypted , But the whole process must first request data normally , Then decrypt the response data , And then render it to the page . Here we need to focus on onreadystatechange This method , Because there is response and respnseText The word .
But this onreadystatechange What is? , The definition of a rookie is :
The logic here should be when readyState by 4 The callback function is executed to decrypt the response data .
Here's the next breakpoint , Then step through the debugging , Come to this place ,

This h Is the method of decryption , Enter h Look inside .
function h(t) {
var e = d.a.enc.Hex.parse(t)
, n = d.a.enc.Base64.stringify(e)
, a = d.a.AES.decrypt(n, f, {
iv: m,
mode: d.a.mode.CBC,
padding: d.a.pad.Pkcs7
})
, r = a.toString(d.a.enc.Utf8);
return r.toString()
}
Encryption logic
h It's just one. AES encryption ( laugh ), The encryption mode is CBC,key and iv It is also defined in the previous section .
f = d.a.enc.Utf8.parse("jo8j9wGw%6HbxfFn")
m = d.a.enc.Utf8.parse("0123456789ABCDEF");
Although this view is original AES, But for insurance , Or first take the online website to verify .
It's really native AES, That's easy , Direct use python The library adjustment is finished .
python Code :
from Crypto.Cipher import AES
from Crypto.Util.Padding import pad, unpad
import binascii
def decrypt(data):
cipher = AES.new(key=KEY, mode=AES.MODE_CBC, iv=IV)
decrypted_data = cipher.decrypt(binascii.a2b_hex(data))
return unpad(decrypted_data, block_size=AES.block_size).decode('utf8')
KEY = 'jo8j9wGw%6HbxfFn'.encode()
IV = '0123456789ABCDEF'.encode()
raw_data = 'xxx' # Too long , I will not post it
result = decrypt(raw_data)
print(result)
Running effect :
Another piece of water (bushi), I'll see you next time .
边栏推荐
猜你喜欢

P1296 whispers of cows (quick row + binary search)

Record the handling of oom problems caused by too many threads at one time

Automated testing -- Introduction and use of pytest itself and third-party modules

MySQL第十二次作业-存储过程的应用

Little red book - Notes inspiration - project summary

Omni channel, multi scenario and cross platform, how does app analyze channel traffic with data

Internationalization configuration

DBSCAN

【LeetCode】59. 螺旋矩阵 II

Basic string operations in C
随机推荐
What is LSP
JVM的符号引用和直接引用是什么
Today's headline adaptation scheme code
[binary search] 4 Find the median of two positive arrays
MySQL job 11 - application de la vue
1. 两数之和(LeetCode题目)
Global and Chinese markets in hair conditioner 2022-2028: Research Report on technology, participants, trends, market size and share
Solution to network request crash in retrofit2.8.1
MySQL第四章总结
Glide's most common instructions
904. 水果成篮
Various errors encountered by tensorflow
SSM项目小例子,SSM整合图文详细教程
Omni channel, multi scenario and cross platform, how does app analyze channel traffic with data
Differences between JVM, Dalvik and art
[sans titre]
Basic string operations in C
Recyclerview implements flow layout (LinearLayout with line wrap) (flexboxlayoutmanager)
Openxcap usage
The IE mode tab of Microsoft edge browser is stuck, which has been fixed by rolling back the update