mirror of
https://github.com/luzhisheng/js_reverse.git
synced 2025-04-22 08:11:29 +08:00
猿人学第2题-js-混淆-动态cookie-hook-cookie
This commit is contained in:
parent
4a2744a653
commit
97dbb0ce7f
@ -7,7 +7,6 @@ class App(object):
|
|||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.sign_url = "http://127.0.0.1:3001/get_sign"
|
self.sign_url = "http://127.0.0.1:3001/get_sign"
|
||||||
self.html_url = "https://www.xiaohongshu.com/discovery/item/5ea02f090000000001001a90"
|
|
||||||
|
|
||||||
def get_sign(self, date_time):
|
def get_sign(self, date_time):
|
||||||
data = {
|
data = {
|
||||||
|
File diff suppressed because one or more lines are too long
@ -1,5 +0,0 @@
|
|||||||
hook cookie
|
|
||||||
|
|
||||||
// 当 document 设置 cookie 的时候,将进入 debuuger
|
|
||||||
Object.defineProperty(document, "cookie", {set:function(){debugger;}})
|
|
||||||
|
|
@ -1,18 +0,0 @@
|
|||||||
|
|
||||||
|
|
||||||
function _0x443ca7(_0x48561e) {
|
|
||||||
_0x47cc1a = {},
|
|
||||||
_0x47cc1a[$dbsm_0x42c3(oQoQoq, qQQOOO) + '\x46\x59'] = _0x5500bb[$dbsm_0x42c3(LoLQoq, QiQqIq) + '\x5a\x64'],
|
|
||||||
_0x47cc1a['\x45\x67\x4e' + '\x71\x68'] = _0x5500bb[$dbsm_0x42c3(IQ00Qo, O0oqO0) + '\x73\x64'],
|
|
||||||
_0x37a87f = _0x47cc1a;
|
|
||||||
if (_0x5500bb[$dbsm_0x42c3(l0Oqoq, Qo01oq) + '\x76\x70'](_0x5500bb[$dbsm_0x42c3(qQll0q, QQloqo) + '\x4e\x6b'], _0x5500bb[$dbsm_0x42c3(qqLooq, oQ0liL) + '\x6f\x47'])) {
|
|
||||||
return _0x5500bb['\x64\x4a\x43' + '\x43\x58'](_0x57fdd5, _0x5500bb[$dbsm_0x42c3(lQl00o, Q10loO) + '\x43\x58'](_0x45dccd, _0x48561e));
|
|
||||||
} else {
|
|
||||||
return function(_0x2cf9d7) {}
|
|
||||||
[$dbsm_0x42c3(QOqqqQ, qQQIQq) + $dbsm_0x42c3(q1O0Qo, QOo1lq) + '\x75\x63\x74' + '\x6f\x72'](KKbXTR[$dbsm_0x42c3(Ql1lOo, QOOqqi) + '\x46\x59'])[$dbsm_0x42c3(QIqQlq, lqOqoO) + '\x6c\x79'](KKbXTR[$dbsm_0x42c3(OoOOIo, QqOOl0) + '\x71\x68']);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
_0x5500bb["dJCCX"](_0x57fdd5, _0x5500bb[$dbsm_0x42c3(lQl00o, Q10loO) + "CX"](_0x45dccd, 1651857980000));
|
|
11
猿人学第2题-js-混淆-动态cookie-hook-cookie/readme.md
Normal file
11
猿人学第2题-js-混淆-动态cookie-hook-cookie/readme.md
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
hook cookie
|
||||||
|
|
||||||
|
// 当 document 设置 cookie 的时候,将进入 debuuger
|
||||||
|
Object.defineProperty(document, "cookie", {set:function(){debugger;}})
|
||||||
|
|
||||||
|
Object.defineProperty(document, "cookie", {
|
||||||
|
set:function(var){
|
||||||
|
console.log(var);
|
||||||
|
debugger;
|
||||||
|
}
|
||||||
|
})
|
19
猿人学第2题-js-混淆-动态cookie-hook-cookie/server.js
Normal file
19
猿人学第2题-js-混淆-动态cookie-hook-cookie/server.js
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
const express = require('express');
|
||||||
|
const app = express();
|
||||||
|
const encryption = require("./案例");
|
||||||
|
var bodyParser = require('body-parser');
|
||||||
|
app.use(bodyParser());
|
||||||
|
|
||||||
|
|
||||||
|
app.post('/get_sign', function (req, res) {
|
||||||
|
let result = req.body;
|
||||||
|
let sign = result.sign;
|
||||||
|
console.log(sign);
|
||||||
|
result = encryption.get_m(sign);
|
||||||
|
console.log(result);
|
||||||
|
res.send(result.toString());
|
||||||
|
});
|
||||||
|
|
||||||
|
app.listen(3009, () => {
|
||||||
|
console.log("开启服务,端口3009")
|
||||||
|
});
|
6857
猿人学第2题-js-混淆-动态cookie-hook-cookie/案例.js
Normal file
6857
猿人学第2题-js-混淆-动态cookie-hook-cookie/案例.js
Normal file
File diff suppressed because it is too large
Load Diff
48
猿人学第2题-js-混淆-动态cookie-hook-cookie/请求.py
Normal file
48
猿人学第2题-js-混淆-动态cookie-hook-cookie/请求.py
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
import requests
|
||||||
|
import time
|
||||||
|
import json
|
||||||
|
|
||||||
|
|
||||||
|
class App(object):
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
self.sign_url = "http://127.0.0.1:3009/get_sign"
|
||||||
|
|
||||||
|
def get_sign(self, date_time):
|
||||||
|
data = {
|
||||||
|
'sign': str(date_time)
|
||||||
|
}
|
||||||
|
req = requests.post(self.sign_url, data=data)
|
||||||
|
sign = req.text
|
||||||
|
return sign
|
||||||
|
|
||||||
|
def get_html(self, m, page):
|
||||||
|
Headers = {
|
||||||
|
"user-agent": "yuanrenxue.project",
|
||||||
|
"cookie": m
|
||||||
|
}
|
||||||
|
url = f"https://match.yuanrenxue.com/api/match/2?page={page}"
|
||||||
|
print(url)
|
||||||
|
req = requests.get(url=url, headers=Headers)
|
||||||
|
return json.loads(req.text)
|
||||||
|
|
||||||
|
def run(self):
|
||||||
|
data_sum = 0
|
||||||
|
for page in range(1, 6):
|
||||||
|
t = int(time.time()) * 1000
|
||||||
|
print(t)
|
||||||
|
m = self.get_sign(t)
|
||||||
|
print(m)
|
||||||
|
res = self.get_html(m, page)
|
||||||
|
print(res)
|
||||||
|
data_list = res.get('data')
|
||||||
|
for data in data_list:
|
||||||
|
data_sum += data.get('value')
|
||||||
|
time.sleep(1)
|
||||||
|
|
||||||
|
print(data_sum)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
app = App()
|
||||||
|
app.run()
|
Loading…
x
Reference in New Issue
Block a user