python-js逆向人人網登入

專注的阿熊發表於2021-04-12

t = {

    "password": account.password

}

but_js = session.get(').content.decode()

big_js = session.get(').content.decode()

rsa_js = session.get(').content.decode()

# 建立 js 物件

js_ven = js2py.EvalJs()

js_ven.execute(big_js)

js_ven.execute(rsa_js)

js_ven.execute(but_js)

js_ven.n = n

js_ven.t = t

data_js = """

    t.password = t.password.split("").reverse().join(""),

    setMaxDigits(130);

    var o = new RSAKeyPair(n.e,"",n.n)

    , r = encryptedString(o, t.password);

"""

js_ven.execute(data_js)

print(js_ven.r)

簡易程式碼分享

本文章只提供學習,切勿用在其他用途

import js2py    # 外匯跟單gendan5.com js 程式碼轉換成 python 能執行的

import account

import requests    

# 獲取到網站的 cookie    實現狀態儲存

session = requests.session()

session.headers = {

    'User-Agent': 'Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Mobile Safari/537.36'

}

response = session.get(').json()

print(response)

n = response["data"]

t = {

    "password": account.password

}

but_js = session.get(').content.decode()

big_js = session.get(').content.decode()

rsa_js = session.get(').content.decode()

# 建立 js 物件

js_ven = js2py.EvalJs()

js_ven.execute(big_js)

js_ven.execute(rsa_js)

js_ven.execute(but_js)

js_ven.n = n

js_ven.t = t

data_js = """

                    t.password = t.password.split("").reverse().join(""),

                    setMaxDigits(130);

                    var o = new RSAKeyPair(n.e,"",n.n)

                      , r = encryptedString(o, t.password);

"""

js_ven.execute(data_js)

print(js_ven.r)

data = {

    'phoneNum': account.phoneNum,

    'password': js_ven.r,

    'c1': '-100',

    'rKey': n['rkey']

}

url = "

result = session.post(url, data=data)

print(result.text)


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/69946337/viewspace-2767642/,如需轉載,請註明出處,否則將追究法律責任。

相關文章