How to bypass verification code detection by crawler reverse engineering?

I am Xiao Chen. I have persistent pursuits, believe in lifelong growth, do not define myself, love technology but do not stick to it. I like sharing, reading and making friends. Welcome to add me on WeChat to make friends with me.

Share some ideas about crawlers, reverse engineering and analysis in daily study. If there are any mistakes in the article, you are welcome to share and correct me☀️

Clicking to log in will load 2 addresses

Address 1: aHR0cHM6Ly9hcGkud2VpLWxpdS5jb20vYXBpL3YxL1Rva2VuL2NvZGU=

Address 2: aHR0cHM6Ly9hcGkud2VpLWxpdS5jb20vYXBpL3YxL1Rva2Vu

**Summary: **Address 2 contains the return 公钥and item2parameters of address 1 carrying parameters

4.3 JavaScript analysis

Insert image description here

**Summary:** It can be seen from here that the password is encrypted

Next XHRbreakpoint analysis aHR0cHM6Ly9hcGkud2VpLWxpdS5jb20vYXBpL3YxL1Rva2Vu, you can find the parameters at the following location

Insert image description here

4.4 Key analysis
  • Pull the slider to get the background public key item1and timeitem2

Insert image description here

4.5 Algorithm restoration
4.5.1 Use python to simulate request testing
def get\_miyue():  
    session = requests.session()  
    header = {
    
      
        'asdasd'  
    }  
    session.headers = header  
    url = J2h0dHBzOi8vYXBpLndlaS1saXUuY29tL2FwaS92MS9Ub2tlbi9jb2RlJw==  
    res = session.get(url)  
    if res.status\_code == 200:  
        res1 = res.json().get('data')  
        item1 = res1.get('item1')  
        item2 = res1.get('item2')  
        return item1,item2
4.5.2 JavaScript test code
JSEncrypt \= require('jsencrypt');  
function encrypt(module,pubCode,pwd){
    
      
    var encrypt \= new JSEncrypt();  
    encrypt.setPublicKey(module);  
    var result \= encrypt.encrypt(pubCode + pwd);  
    return result;  
}
4.5.3 Password acquisition
js\_code \= open('psd.js','r').read()  
result \= execjs.compile(js\_code).call('encrypt',item1,item2,jm\_sha256(''))

Today’s sharing ends here. Welcome everyone to pay attention to the next article. See you there⛽️

at last:

[For those who want to learn crawlers, I have compiled a lot of Python learning materials and uploaded them to the CSDN official. Friends in need can scan the QR code below to obtain them]

1. Study Outline

Insert image description here

2. Development tools

Insert image description here

3. Python basic materials

Insert image description here

4. Practical data

Insert image description here

Guess you like

Origin blog.csdn.net/Z987421/article/details/133270292