python逆向爬蟲 python爬蟲js逆向

2021-10-21 07:57:15 字數 1528 閱讀 7958

js逆向要想是想,要非常熟悉web的執行流程,針對不同**,有不同的思路,這個部落格是針對人人直播的乙個爬取,先直接上**,然後在講解,

import requests

import js2py

import json

headers = {

session = requests.session()

context = js2py.evaljs()

phonenum = "*********"

password = "******"

context.t = {

"phonenum":phonenum,

"password":password,

"c1":-100

response = session.get("",headers=headers)

result = json.loads(response.content.decode('utf-8'))

context.n = result["data"]

with open('bigint.js','r',encoding='utf-8') as f:

context.execute(f.read())

with open('barrett.js','r',encoding='utf-8') as f:

context.execute(f.read())

with open('rsa.js','r',encoding='utf-8') as f:

context.execute(f.read())

js = '''

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

setmaxdigits(130)

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

var r = encryptedstring(o, t.password)

t.password = r

t.rkey = n.rkey

context.execute(js)

# 模擬登入

data = {

"c1":context.t.c1,

"password":context.t.password,

"phonenum":context.t.phonenum,

"rkey":context.t.rkey

response=session.post("",headers=headers,data=data)

with open('13-test.html','wb') as f:

f.write(response.content)

賬號密碼自己註冊乙個,別想著直接用啊,

context = js2py.evaljs(),這個函式的運用要靈活,

所有的js檔案都需要自己在瀏覽器上尋找的,這也是最膈應人的,經常性的看的我老眼昏花,

大概步驟:

訪問頁面,拿到js,讀取寫入,在ide中執行,獲取自己構造請求的真實資料,傳送請求

Python爬蟲實戰JS逆向AES逆向加密爬取

目錄 監管平台 開發工具 pycharm 開發環境 python3.7,wi程式設計客棧ndows10 使用工具包 requests,aes,json 涉及aes對稱加密問題 需要 安裝node.js環境 使用npm install 安裝 crypto js 確定資料 在這個網頁可以看到資料是動態返...

python爬蟲之js逆向(二)

每天一更,養成好習慣從我做起。真正想做成一件事,不取決於你有多少熱情,而是看你能多久堅持。千萬別奢望光有熱情就能得償所願。今天的帶大家了解一下md5加密,目標 是有道翻譯 首先第一步開啟 我用的是google f12,檢視是否是post請求,隨便輸入乙個字,右擊檢視網頁源 ctrl f檢視是否有你想...

python爬蟲之js逆向(三)

目標 這就是生成mcode的函式 直接拿下來複製到js檔案。生成js檔案 function missjson input else if isnan chr3 output output keystr.charat enc1 keystr.charat enc2 keystr.charat enc3...