Commit 849dbcbf authored by 王明明's avatar 王明明

初始化

parents
This diff is collapsed.
//babel库及文件模块导入
const fs = require('fs');
//babel库相关,解析,转换,构建,生产
const parser = require("@babel/parser");
const traverse = require("@babel/traverse").default;
const types = require("@babel/types");
// const {replaceWith} = require("cheerio/lib/api/manipulation");
const generator = require("@babel/generator").default;
// const YY = require('./test')
// console.log(YY)
//读取文件
let encode_file = "./sss.js",
decode_file = "./src_out.js";
// let encode_file = "./jiyan.js",decode_file = "./decode_result.js";
if (process.argv.length > 2) {
encode_file = process.argv[2];
}
if (process.argv.length > 3) {
decode_file = process.argv[3];
}
let jscode = fs.readFileSync(encode_file, { encoding: "utf-8" });
//转换为ast树
let ast = parser.parse(jscode);
traverse(ast, {
VariableDeclaration(path){
let node = path.node;
let declarations = node.declarations;
if (declarations.length == 0 && types.isVariableDeclarator(declarations[0])){}
let variable = declarations[0]
let {id, init} = variable;
if (types.isArrayExpression(init) && init.elements.length > 100){
let eles = init.elements;
let hasNotFunc = false;
eles.forEach(e=>{
if (!types.isFunctionExpression(e)){
hasNotFunc = true
}
})
if (hasNotFunc)return;
let cases = []
eles.forEach((e,i)=>{
cases.push(types.SwitchCase(types.NumericLiteral(i), [types.ReturnStatement(e)]))
})
console.log()
let res = types.FunctionDeclaration(id,[types.Identifier('key')], types.BlockStatement([types.SwitchStatement(types.Identifier('key'), cases)]))
path.replaceWith(res)
}
}
})
let { code } = generator(ast, {
minified:false,
// jsescOption:{
// quotes: "double",
// wrap: true,
// minimal: false
// }
});
fs.writeFile(decode_file, code, (err) => {});
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
bases = 'BXla8YOr4V2kxHMQcFf-SZAvim5dThL7_ENRbp=uIt9oGDgy1sKzj0Pnwqe3C6JWU'
print(bases[43])
print(len(bases))
s = 'hLaTGlqY8ei_QEhez=0xPexJsBVxrpT3ImaHFb59Ext3hN5pgKH1-4qwzlpAgbSDL=g_AY5dRq0PKvRcI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LdNp5_Ld6jZHshN6GM4QWPx9JRndrOcEy_=KXx4p6yPa3JWodSmNcV8WP6WBHuevf8QkTLJ8VXQqauBzrobs4MdOwsJWAz3PYaY34ssyKuDJ_V1m9yxEKMr9_4xDo8VgoBPxCEhzoti3VIGZ8G0=a9QuFGb-=-HJuuhfuf2cD_cZl57kIkHQitPD3aVIBgcrBt4oPYLeRlezvB8Ja7EptY7CnP=T0ooIeE=-SLG3NOnkraQ2ezC8fK_2HDY4JsFvYA_Q6O5Ol=e6MPwX=qJV90d2ZBLwqX4ZLQ3_gwhhG0KtOc5pNorXK=gj6OdoaOxKXLroMmH3L4=tHl-xsDGzKuBa-yQifjgrIxsB6E0jxmHHA_V=XyPO5EwYMmMK6yVi6naBcRdABu3STQ3ABVoJRY0bEhiTuu4gSbz=BKwtvBZMfEbupkB8NKCB1sjrS6_XM=xOh5kW=SyId1x_XZJCb47wuHndX_4tk5Thz8sNsgtFIMzcliPyZ9wmCCVdHOOxQfdm6Z1wpJM-a1zLLEasdhhrjCVAeI=Eo_YmCj'
res = []
for i in s:
res.append(bases.index(i))
print(res)
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<button onclick="sendXHr()">发送xhr请求</button>
</body>
</html>
<script>
Date.now = function now() { return 1685096207545 };
Date.parse = function () { return 1685096207545 };
Date.prototype.valueOf = function () { return 1685096207545 };
Date.prototype.getTime = function () { return 1685096207545 };
Date.prototype.toString = function () { return 1685096207545 };
Performance.prototype.now = function now(){ return Number('1685096207545'.slice(8))}
Math.random = function random() { return 0.08636862211354912 };
</script>
<script src="src_out.js"></script>
<!--<script src="https://www.jetblue.com/js/src/jb-74873.js"></script>-->
<script>
function sendXHr() {
var xhr = new XMLHttpRequest();
let h = { "accept": "application/json",
"accept-language": "en-US,en;q=0.9,zh-CN;q=0.8,zh;q=0.7",
"api-version": "v3",
"application-channel": "Desktop_Web",
"booking-application-type": "NGB",
"cache-control": "no-cache",
"content-type": "application/json",
}
xhr.open('POST', "https://jbrest.jetblue.com/lfs-rwb/outboundLFS", false);
for (let hKey in h) {
xhr.setRequestHeader(hKey, h[hKey])
}
try{
xhr.send('{\"tripType\":\"oneWay\",\"from\":\"ZLA\",\"to\":\"NAS\",\"depart\":\"2023-05-11\",\"cabin\":\"economy\",\"refundable\":false,\"dates\":{\"before\":\"3\",\"after\":\"3\"},\"pax\":{\"ADT\":1,\"CHD\":0,\"INF\":0,\"UNN\":0},\"redempoint\":false,\"pointsBreakup\":{\"option\":\"\",\"value\":0},\"isMultiCity\":false}"');
}catch (e){}
console.log(xhr.headers)
return xhr.headers
}
console.log('当前times', window.times)
!function(){
var websocket = new WebSocket("ws://127.0.0.1:5000/browser");
websocket.onopen = function(){
var info = 'browser:start:' + location.href
console.log(info);
websocket.send(info)
}
websocket.onmessage = function(e){
var info = JSON.parse(e.data)
console.log('websocket.onmessage', info)
// 这里处理请求参数以及对应rpc函数调用,返回参数用字符串传递回 websocket。回传字符串即可。
var ret = sendXHr()
websocket.send(JSON.stringify(ret))
}
}()
debugger
try {
sendXHr()
}catch (e){}
console.log('结束times', window.times)
</script>
\ No newline at end of file
import random
import time
import requests
import json
headers = {
"Host": "jbrest.jetblue.com",
"application-channel": "Desktop_Web",
"sec-ch-ua-platform": "\"macOS\"",
"sec-ch-ua-mobile": "?0",
"user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36",
"booking-application-type": "NGB",
"content-type": "application/json",
"accept": "application/json",
"api-version": "v3",
"origin": "https://www.jetblue.com",
"sec-fetch-site": "same-site",
"sec-fetch-mode": "cors",
"sec-fetch-dest": "empty",
"referer": "https://www.jetblue.com/booking/flights?from=LAS&to=BOS&depart=2023-07-10&isMultiCity=false&noOfRoute=1&lang=en&adults=1&children=0&infants=0&sharedMarket=false&roundTripFaresFlag=false&usePoints=false",
"accept-language": "en-US,en;q=0.9,zh-CN;q=0.8,zh;q=0.7"
}
for i in range(100):
t1 = time.time()
# r = requests.get('http://127.0.0.1:5000/getinfo').json()['message']
r = requests.get('http://127.0.0.1:3001').json()
print(time.time() - t1,r)
# r = {
# "x-1itxwo9i-a": "F7Pgtv2oFJ6SRuiVu1hHGyVjT-E9519oQfgqVh4t7nDGry-oz_jYCRNHUfHRa5UEuU_NCnLpA1UAxW1qJ15de9rk3vXe7e9fliEH2x_f29j_-yESHK-kqhqP47HxOQqYor7JAwTlSZCRVps8dD-Sshe-kxmGeWG==sd1gfTtXb5oOW5innE_63r=6y37msgHgbZsKsr3m-Nqrg8Gs_2zZnjo3fJbU8eOViydixp9pZbueCL5AuZmCx-0Ug_Y8Z12hfhoVKQ2k8sWUWMNYbn1b7___KrGD_6VdHnekp6W0RERVtsILg92QqEg4HZ0=jDX6vAzyNdvzYVfvMYi5MarM1Y=MulNJIyOk9pabwUjA05dTVl_8vQb0YW=QCzLPrykflJmh38xJl__AJ-rMzn86-LxO4WKkE7z0Xig92=p6LyRjUymVqVqG2ibJAHUuEtEUDB947ansxUMnECeDlOOYQdY4ugI5wg4hSU6eF0ItNvniaEx1LydsUPDtJv85MJyhPN0beZa4p0NvQ8X8uX9dXLd7TQ2mvKylBjXh_ktY-Aq=D3S7S7Mm-_2XVqP6La0q3Df1E60QNv9NMYOeM59ZSE5Uz0zFfkVOOS_dYgH5kXKPVIykG0miBDCz4n0qB1UbMkieVLYvAtjztKo1bzTrJvtOr6Y=w3_Knt-OAfM=TEajT3vq9Ls93u6dgEKY-uaz2qznd5Kl7kfdMXLiajx0hO8Zz8f_5gUenqAjLOITx4nAAo-6X-EW6tBBvaqE84Qd3jfn78R4=sIRvi2GnGwdYWlhGNYb471Omw1meParxDs8BCrKP-7hkug7x8pnXsnwWqY2-QnWN4h9HZTm1iEUv1S9nOEDpWYA23V6t7P-UsiIA_CgGjELouWoIyH8zF9odiU4CS-MtQaSAhISprP5khjPvGF6ZKkJvFPptGbB3ekf=IISkQxI-N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sAS0rIPCucn0ewH9eCOfvosJeCA==",
# "x-1itxwo9i-z": "q"
# }
headers.update(r)
print(len(headers['x-1itxwo9i-a']))
url = "https://jbrest.jetblue.com/lfs-rwb/outboundLFS"
data = {
"tripType": "oneWay",
"from": "LAS",
"to": "BOS",
"depart": "2023-07-10",
"cabin": "economy",
"refundable": False,
"dates": {
"before": "3",
"after": "3"
},
"pax": {
"ADT": 1,
"CHD": 0,
"INF": 0,
"UNN": 0
},
"redempoint": False,
"pointsBreakup": {
"option": "",
"value": 0
},
"isMultiCity": False,
"isDomestic": False
}
proxy = f'http://unfflcc:76cc14-47b8dd-1f8ace-827836-0c740e@usa.rotating.proxyrack.net:{int(random.randint(10000,11149))}'
proxy = 'http://user-unifflcc-region-us:q39CEBTs5A5YQXor@pr.roxlabs.cn:4600'
print(proxy)
response = requests.post(url, headers=headers, json=data, proxies={
'http':proxy,
'https':proxy,
})
print(response.text)
if response.status_code == 200:
# proxy = requests.post('http://ymx-lcc.unififi.com/proxy/get-proxy', json={
# 'type':'headerB6'
# })
uri = 'http://lcc.unififi.com/header/add'
r = requests.post(uri, json={
'brush_fromto': 'LAS-BOS',
'brush_fromdate': '2023-05-22',
'brush_header': headers,
'brush_proxy':proxy,
'brush_mode':'shopping',
'brush_name':'js',
'brush_type':'headerB6',
})
print(r.text)
This diff is collapsed.
# This is a sample Python script.
# Press Shift+F10 to execute it or replace it with your code.
# Press Double Shift to search everywhere for classes, files, tool windows, actions, and settings.
def print_hi(name):
# Use a breakpoint in the code line below to debug your script.
print(f'Hi, {name}') # Press Ctrl+F8 to toggle the breakpoint.
# Press the green button in the gutter to run the script.
if __name__ == '__main__':
print_hi('PyCharm')
# See PyCharm help at https://www.jetbrains.com/help/pycharm/
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
window = global;
createPrototype = function (name, obj) {
Object.assign(obj, {
constructor: function (){},
// name: name,
prototype: {
get function(){
},
toString: function () {
return `'function ${name}() { [native code] }'`
// throw new TypeError('Illegal invocation')
}
},
toString: function () {
return `'function ${name}() { [native code] }'`
}
})
// Object.defineProperty(obj.prototype, {
// [Symbol.toStringTag]: {value:name,writable:false,enumerable:false,configurable:true},
// prototype: {
// toString: function (){
// return `'function ${name}() { [native code] }'`
// // throw new TypeError('Illegal invocation')
// }
// },
// })
return obj
}
window.CustomEvent = createPrototype('CustomEvent', {
initCustomEvent: function (){
debugger
}
})
Object.defineProperties(window.CustomEvent, {
detail: {
},
constructor: {
value: function () {},
writable: true, enumerable: false, configurable: true
},
[Symbol.iterator]: {
value: function (){}
},
[Symbol.toStringTag]: {
value:function () {
}
}
})
Object.defineProperties(window.CustomEvent.prototype, {
detail: {
get :function (){},
set :function (){},
enumerable: true, configurable: true,
},
constructor: {
value: function () {},
writable: true, enumerable: false, configurable: true
},
[Symbol.iterator]: {
value: function (){}
},
[Symbol.toStringTag]: {
value:function () {
}
}
})
var v_saf;!function(){var n=Function.toString,t=[],i=[],o=[].indexOf.bind(t),e=[].push.bind(t),r=[].push.bind(i);function u(n,t){return-1==o(n)&&(e(n),r(`function ${t||n.name||""}() { [native code] }`)),n}Object.defineProperty(Function.prototype,"toString",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"function"==typeof this&&i[o(this)]||n.call(this)}}),u(Function.prototype.toString,"toString"),v_saf=u}();
function _inherits(t, e) {
t.prototype = Object.create(e.prototype, {
constructor: { value: t, writable: true, configurable: true }
}), e && Object.setPrototypeOf(t, e) }
// Object.defineProperty(Object.prototype, Symbol.toStringTag, {
// get() { return Object.getPrototypeOf(this).constructor.name }
// });
// Object.defineProperty(window.CustomEvent.prototype.detail, 'get', {
// value: function(){}
// })
EventTarget = v_saf(function EventTarget(){;})
Screen = v_saf(function Screen(){if (!v_new_toggle){ throw TypeError("Illegal constructor") };}); _inherits(Screen, EventTarget)
Object.defineProperties(Screen.prototype, {
availWidth: { enumerable: true, configurable: true},
availHeight: { enumerable: true, configurable: true},
width: {set:undefined,get:function width() { throw TypeError("legal invocation")}, enumerable: true, configurable: true},
height: { enumerable: true, configurable: true},
colorDepth: { enumerable: true, configurable: true},
pixelDepth: { enumerable: true, configurable: true},
availLeft: { enumerable: true, configurable: true},
availTop: { enumerable: true, configurable: true},
orientation: { enumerable: true, configurable: true},
onchange: { enumerable: true, configurable: true},
isExtended: { enumerable: true, configurable: true},
[Symbol.toStringTag]: {value:"Screen",writable:false,enumerable:false,configurable:true},
})
// Object.defineProperty(Screen.prototype, 'width', {
// value: function (){
// throw TypeError("Illegal constructor")
// },
// set:undefined,get:function () {}, enumerable: true, configurable: true
// })
console.log(Screen.prototype.width)
console.log(Object.getOwnPropertyDescriptor(Screen.prototype, 'width'))
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
</body>
</html>
<script>
!function(){
var websocket = new WebSocket("ws://127.0.0.1:5000/browser");
websocket.onopen = function(){
var info = 'browser:start:' + location.href
console.log(info);
websocket.send(info)
}
websocket.onmessage = function(e){
var info = JSON.parse(e.data)
console.log('websocket.onmessage', info)
// 这里处理请求参数以及对应rpc函数调用,返回参数用字符串传递回 websocket。回传字符串即可。
$.ajax({
type: 'POST',
url: '/api/match2023/4',
data: {'page': 2, 'yt4': '5WRckXmx+H0dKOXNcU3Q+OWcLSXN9ZFljLRgndE54Oi9teC1WDRF1Xi0SBWN+HG9fYyZJGW1bXTpUM1RTTD9SDnAaRVB1ZTJYL11HAU1bNXx7KXJUT1wH'},
dataType: 'json',
success: function (resp){
console.log(resp);
websocket.send(resp)
}
});
}
}()
</script>
\ No newline at end of file
This diff is collapsed.
import base64
b = [4259891, 7733370, 5111874, 6357065, 4259921, 4259905, 4522074, 5111915, 7864391, 6357098, 5111875, 3276852, 7077961, 2949185, 7405649, 5439600, 5701733, 5767243, 6881364, 7077989, 3342422, 3670137, 4259895, 4915275, 7602242, 7405643, 7602296, 3342440, 5111893, 6750311, 4259940, 4784196, 7209050, 6357109, 6488168, 5898290, 7798856, 3670081, 4259919, 6684790, 4259905, 4259905, 4259905, 3997757, 3276902, 4259909, 4849717, 7340107, 7929917, 7995494, 5374022, 4718657, 7012459, 5767221, 4456504, 3276898, 6946892, 7995508, 6881349, 5439567, 5636172, 7471212, 7471180, 4718637, 6226030, 5505144, 5570675, 3670120, 5832814, 5505069, 3145800, 3276848, 4259945, 4784205, 6684739, 7012456, 3276904, 7929907, 6488125, 5898290, 4718642, 6619242, 4718693, 5242960, 6226029, 3735641, 4522094, 3670098, 7667780, 4456568, 6750294, 5832794, 4849775, 5767252, 5832752, 4587622, 3997780, 6422644, 3407956, 5111860]
t = b''
for i in b:
t += i.to_bytes(4, byteorder='little')
print(t)
print(base64.b64encode(t).decode())
\ No newline at end of file
This diff is collapsed.
const {VM, VMScript} = require("vm2");
const crypto = require('crypto')
const fs = require('fs')
function readFile(name){
var data = fs.readFileSync(name);
return data.toString()
}
const vm = new VM({
sandbox: {
'crypto':crypto,
'Blob':Blob,
'URL':URL,
'DOMException':DOMException,
'FormData':FormData,
'MessageChannel':MessageChannel,
'ReadableStream':ReadableStream,
'TextDecoderStream':TextDecoderStream,
'TextEncoderStream':TextEncoderStream,
'TransformStream':TransformStream,
'URLSearchParams':URLSearchParams,
'fetch':fetch,
'setTimeout':setTimeout,
'clearInterval':clearInterval,
}
});
let envCode = readFile("env.js")
let srcCode = readFile("src.js")
let code = envCode + "\n\n\n" + srcCode
code += `
function getargs(){
var xhr = new XMLHttpRequest();
xhr.open('POST', "https://www.southwest.com/api/air-booking/v1/air-booking/page/air/booking/shopping", false);
xhr.send('{"adultPassengersCount":"1","adultsCount":"1","departureDate":"2023-05-27","departureTimeOfDay":"ALL_DAY","destinationAirportCode":"LAS","fareType":"USD","int":"HOMEQBOMAIR","originationAirportCode":"BOS","passengerType":"ADULT","reset":"true","returnDate":"","returnTimeOfDay":"ALL_DAY","tripType":"oneway","application":"air-booking","site":"southwest"}')
// console.log(xhr.headers)
console.log('结束times', times)
console.log(medias.join('|||'))
return JSON.stringify(xhr.headers);
}
`
const script = new VMScript(code,`${__dirname}/debug.js`);
// 运行脚本文件
vm.run(script);
console.log('vm.getGlobal("XMLHttpRequest")', vm.getGlobal("getargs"))
var xhr = vm.getGlobal("getargs");
console.log(xhr())
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<button onclick="sendXHr()">发送xhr请求</button>
</body>
</html>
<script src="src.js"></script>
<script>
document.addEventListener("visibilitychange", (eee) => {
console.log(eee)
});
var _send = XMLHttpRequest.prototype.send;
var _setRequestHeader = XMLHttpRequest.prototype.setRequestHeader;
let hreaders = {};
XMLHttpRequest.prototype.send = function (){
console.log("send", arguments);
_send.apply(this, arguments)
}
XMLHttpRequest.prototype.setRequestHeader = function (k,v){
this.hreaders[k] = v
hreaders[k] = v
_setRequestHeader.apply(this, arguments);
}
function sendXHr() {
var xhr = new XMLHttpRequest();
let h = { "accept": "application/json",
"accept-language": "en-US,en;q=0.9,zh-CN;q=0.8,zh;q=0.7",
"api-version": "v3",
"application-channel": "Desktop_Web",
"booking-application-type": "NGB",
"cache-control": "no-cache",
"content-type": "application/json",
}
console.log('当前times', times)
// debug = true;
var xhr = new XMLHttpRequest();
xhr.open('POST', "https://www.southwest.com/api/air-booking/v1/air-booking/page/air/booking/shopping", false);
xhr.send('')
console.log(hreaders)
console.log('结束times', times)
debugger
}
console.log('当前times', window.times)
try {
sendXHr()
}catch (e){
console.log(e)
}
console.log('结束times', window.times)
debugger;
</script>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment