Python encryption crawler serial 8-JS (a)

A, JS encryption

1. Some anti-reptile strategies using js data to be transmitted encrypted.

2. encrypted, the ciphertext is transmitted

3. The encryption function or process must be completed in the browser, that is, will certainly codes (js code) exposed to a user

4. Tondo read encryption algorithm, the encryption process can be simulated, so as to achieve crack.

5. For a case

 

"""

Crack way dictionary

"""

from urllib import request,parse


DEF youdao (Key):

    url = "http://www.fanyi,com/translate_o?smartresult=dict&smartresult=rule"

    data = {

        "i":"girl",

        "from":"AUTO",

        "to":"AUTO",

        "smartresult":"dict",

        "client":"fanyideskweb",

        "salt":"1523100789519",

        "sign":"b8a55a436686cd89873fa46514ccedbe",

        "doctype":"json",

        "version":"2.1",

        "keyfrom":"fanyi.web",

        "action":"FY_BY_REALTIME",

        "typeResult":"False"

    }


    data = parse.urlencode(data).encode()

    headers = {

        "Connection": "keep - alive",

        "Content - Encoding":"gzip",

        "Content - Language": "zh - CN",

        "Content - Type": "text / html",

        "charset":"utf - 8",

        "Date": "Mon, 17 Feb 2020 15: 23:36 GMT",

        "Server":"nginx",

        "Transfer - Encoding": "chunked",

        "Vary": "Accept - Encoding"

    }

    req = request.Request(url=url,data=data,headers=headers)


    rsp = request.urlopen(req)


    html = rsp.read().decode()

    print(html)


if __name__ == "__main__":

    # for i in range(10000):

    #      Print (SUM) 

youdao ( 45)

 

 

Second, the source

Reptitle8_1_JSEncryption.py

https://github.com/ruigege66/PythonReptile/blob/master/Reptitle8_1_JSEncryption.py

2.CSDN:https://blog.csdn.net/weixin_44630050

3. Park blog: https: //www.cnblogs.com/ruigege0000/

4. Welcomes the focus on micro-channel public number: Fourier transform public personal number, only for learning exchanges, backstage reply "gifts" to get big data learning materials

 

 

Guess you like

Origin www.cnblogs.com/ruigege0000/p/12324518.html