Python crawler advanced essential | Decryption logic analysis of an index analysis platform

Today website

aHR0cCUzQS8vemhpc2h1LmJhaWR1LmNvbS92Mi9tYWluL2luZGV4Lmh0bWwlMjMvdHJlbmQvJTI1RTglMjU4NSUyNUJFJTI1RTglMjVBRSUyNUFGJTNGd29yZHMlM0QlMjVFOCUyNTg1JTI1QkUlMjVFOCUyNUFFJTI1QUY=

I wrote a lot of articles about encryption parameter encryption. Today I wrote an article about return value decryption for your reference.

Packet capture analysis and encryption positioning

Let’s take a look at the results that need to be analyzed. You can see that the page has two values: the time axis and the index value. Now we are going to grab the value of the index axis.

After a simple analysis, we see that the following request has a string of data values returned in the form of ciphertext. We boldly guess that this is the encrypted return result. There must be decryption logic on the page to decrypt this data

You can see that the encrypted result has 3 segments, namely pc, all and wise. The decryption logic here should be the same, so we only need to analyze one.

Searching for key times such as data, pc, wise, etc., did not find the encryption logic, and tried the xhr breakpoint, but did not find the decryption logic.

By referring to the articles of Rare Cow Data I have written before, as well as the ideas that I mentioned in some of the basic articles I have written before, which can be located by searching the keywords of encryption and decryption

Suddenly it occurred to me that there is a decryption keyword decrypt, you can try again

Sure enough, I found the following results

I chased in and hit the breakpoint, it really is the logic we need (I hope all front-end engineers can write comments)

You can also find the upper level of logic through the stack to confirm

Encryption logic analysis

The logic is very clear, let’s just copy it and see if we can decrypt it

After all, the logic is very simple

This logic can also be copied into the Python version

def decrypt_data(password, data):
 n =list(password)
 i =list(data)
 a ={}
 result =[]
 ln =int(len(n)/2)
 start = n[ln:]
 end = n[:ln]for j, k inzip(start, end):
  a.update({k: j})for j in data:
  result.append(a.get(j))return''.join(result)

That’s all for today, let’s meet again next time~

[ Finish]

Recommended Posts

Python crawler advanced essential | Decryption logic analysis of an index analysis platform
Python crawler advanced essential | About a free IP publishing platform webpage encryption parameter logic analysis
Python crawler advanced essential | a live data analysis platform encryption parameter sign analysis
Python crawler advanced essential | Signature encryption logic analysis of a financial information website (old site update)
Analysis of JS of Python crawler
Python crawler advanced must-have | Logical analysis of the encryption parameters of the jump link on a certain information publishing platform
Python analysis of wav files
Python3 crawler data cleaning analysis
Analysis of Python Sandbox Escape
Analysis of Python object-oriented programming
Analysis of usage examples of Python yield
Scrapy simulation login of Python crawler
Analysis of Python conditional control statements
Mongodb and python interaction of python crawler
​Full analysis of Python module knowledge
Learning path of python crawler development