Commit b31f5fe6 authored by wang's avatar wang

11

parent d1d04b0e
......@@ -6,7 +6,7 @@ __pycache__/
# C extensions
*.so
.idea
# Distribution / packaging
.Python
build/
......
This diff is collapsed.
import base64
import ctypes
import json
import random
import time
import ctypes
import execjs
import requests
import tls_client
from py_mini_racer import MiniRacer
from loguru import logger
with open('test.js', 'r', encoding='utf-8') as f:
......@@ -22,10 +24,12 @@ def unsinged_right_shift(x, y):
class PxBypass():
session = tls_client.Session(client_identifier='chrome_112')
# session = requests.Session()
session.proxies = {
'http': 'http://127.0.0.1:7890',
'https': 'http://127.0.0.1:7890',
}
# session.proxies = {
# 'http': "http://user-unifflcc-region-us:q39CEBTs5A5YQXor@pr.roxlabs.cn:4600",
# 'https': "http://user-unifflcc-region-us:q39CEBTs5A5YQXor@pr.roxlabs.cn:4600",
......@@ -43,20 +47,20 @@ class PxBypass():
def _init(self):
headers = {
"authority": "www.spirit.com",
"authority": "www.flyfrontier.com",
"accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
"accept-language": "en-US,en;q=0.9,zh-CN;q=0.8,zh;q=0.7",
"accept-language": "en-US,en;q=0.9,zh-CN;q=0.8,zh;q=0.7,ru;q=0.6",
"cache-control": "no-cache",
"pragma": "no-cache",
"sec-ch-ua": "\"Not/A)Brand\";v=\"99\", \"Google Chrome\";v=\"115\", \"Chromium\";v=\"115\"",
"sec-ch-ua-mobile": "?0",
"sec-ch-ua-platform": "\"Windows\"",
"sec-ch-ua-platform": "\"macOS\"",
"sec-fetch-dest": "document",
"sec-fetch-mode": "navigate",
"sec-fetch-site": "same-origin",
"sec-fetch-site": "none",
"sec-fetch-user": "?1",
"upgrade-insecure-requests": "1",
"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36"
"user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36"
}
res = self.session.get(self.target_url, headers=headers)
self.log.info(f"初始化请求 res {res.status_code}")
......@@ -82,9 +86,9 @@ class PxBypass():
"ea", "eb", "ec", "ed", "ee", "ef", "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", "f8", "f9", "fa", "fb",
"fc", "fd", "fe", "ff"]
bs = 0
ys = [random.randint(10,255) for _ in range(6)]
ys = [random.randint(10, 255) for _ in range(6)]
# random.shuffle(ys)
Gs = random.randint(1100,9999)
Gs = random.randint(1100, 9999)
Ws = 0
s = Gs
h = get_timestamp()
......@@ -123,7 +127,7 @@ class PxBypass():
t2 = t1 + random.randint(3, 12)
_uuid = self.__uuid()
data = [{"t": "PX12095",
"d": {"PX11645": "https://www.spirit.com/", "PX12207": 0, "PX12458": "Win32", "PX11902": 0,
"d": {"PX11645": "https://www.flyfrontier.com/", "PX12207": 0, "PX12458": "Win32", "PX11902": 0,
"PX11560": random.randint(8549, 8549 * 3), "PX12248": 3600, "PX11385": t1, "PX12280": t2,
"PX11496": _uuid, "PX12564": None, "PX12565": -1,
"PX11379": True}}]
......@@ -131,8 +135,7 @@ class PxBypass():
self.log.info(f'data_str {data_str}')
payload = base64.b64encode(self.encrypt(data_str, 50)).decode()
ctx = MiniRacer()
ctx.eval(jsCode)
ctx = execjs.compile(jsCode)
payload = ctx.call('enc', payload, _uuid)
self.log.info(f'payload {payload}')
tag = "v8.6.4"
......@@ -159,9 +162,9 @@ class PxBypass():
"accept-language": "en-US,en;q=0.9,zh-CN;q=0.8,zh;q=0.7",
"cache-control": "no-cache",
"content-type": "application/x-www-form-urlencoded",
"origin": "https://www.spirit.com",
"origin": "https://www.flyfrontier.com",
"pragma": "no-cache",
"referer": "https://www.spirit.com/",
"referer": "https://www.flyfrontier.com/",
"sec-ch-ua": "\"Not/A)Brand\";v=\"99\", \"Google Chrome\";v=\"115\", \"Chromium\";v=\"115\"",
"sec-ch-ua-mobile": "?0",
"sec-ch-ua-platform": "\"Windows\"",
......@@ -217,43 +220,34 @@ class PxBypass():
def __gen_pc(self, data_str, param):
# self.log.info(f'genpc {data_str} {param}')
ctx = MiniRacer()
ctx.eval(jsCode)
ctx = execjs.compile(jsCode)
return ctx.call('Jt', param, data_str)
def __token(self):
headers = {
"authority": "www.spirit.com",
"accept": "application/json, text/plain, */*",
"accept-language": "en-US,en;q=0.9,zh-CN;q=0.8,zh;q=0.7",
"cache-control": "no-cache",
"content-type": "application/json",
"ocp-apim-subscription-key": "dc6844776fe84b1c8b68affe7deb7916",
"origin": "https://www.spirit.com",
"pragma": "no-cache",
"referer": "https://www.spirit.com/",
"sec-ch-ua": "\"Not/A)Brand\";v=\"99\", \"Google Chrome\";v=\"115\", \"Chromium\";v=\"115\"",
"sec-ch-ua-mobile": "?0",
"sec-ch-ua-platform": "\"Windows\"",
"sec-fetch-dest": "empty",
"sec-fetch-mode": "cors",
"sec-fetch-site": "same-origin",
"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36"
}
url = "https://www.spirit.com/api/prod-token/api/v1/token"
data = {
"applicationName": "dotRezWeb"
}
data = json.dumps(data, separators=(',', ':'))
response = self.session.post(url, headers=headers, data=data)
response = self.session.get(
'https://booking.flyfrontier.com/Flight/InternalSelect?o1=DEN&d1=LAS&dd1=2023-08-30&ADT=1&umnr=false&mon=true',
headers={
"authority": "www.flyfrontier.com",
"accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
"accept-language": "en-US,en;q=0.9,zh-CN;q=0.8,zh;q=0.7,ru;q=0.6",
"cache-control": "no-cache",
"pragma": "no-cache",
"sec-ch-ua": "\"Not/A)Brand\";v=\"99\", \"Google Chrome\";v=\"115\", \"Chromium\";v=\"115\"",
"sec-ch-ua-mobile": "?0",
"sec-ch-ua-platform": "\"macOS\"",
"sec-fetch-dest": "document",
"sec-fetch-mode": "navigate",
"sec-fetch-site": "none",
"sec-fetch-user": "?1",
"upgrade-insecure-requests": "1",
"user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36"
}, allow_redirects=True)
print(response.text)
if __name__ == '__main__':
url = "https://www.spirit.com/"
url = "https://booking.flyfrontier.com/Flight/InternalSelect?o1=DEN&d1=LAS&dd1=2023-08-30&ADT=1&umnr=false&mon=true"
px = PxBypass(url)
px.run()
print(unsinged_right_shift(275404960, 24) & 255)
This diff is collapsed.
......@@ -9,6 +9,6 @@
"author": "",
"license": "ISC",
"dependencies": {
"@babel/core": "^7.22.9"
"@babel/core": "^7.22.10"
}
}
function Base64() {
// private property
_keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
var _keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
// public method for encoding
this.encode = function (input) {
......@@ -57,7 +57,7 @@ function Base64() {
}
// private method for UTF-8 encoding
_utf8_encode = function (string) {
var _utf8_encode = function (string) {
string = string.replace(/\r\n/g, "\n");
var utftext = "";
for (var n = 0; n < string.length; n++) {
......@@ -78,7 +78,7 @@ function Base64() {
}
// private method for UTF-8 decoding
_utf8_decode = function (utftext) {
var _utf8_decode = function (utftext) {
var string = "";
var i = 0;
var c = c1 = c2 = 0;
......@@ -299,7 +299,7 @@ function Bn(t, n) {
return e
}
$ = function (t) {
var $ = function (t) {
return btoa(encodeURIComponent(t).replace(/%([0-9A-F]{2})/g, (function (t, n) {
return String.fromCharCode("0x" + n)
}
......@@ -308,7 +308,7 @@ $ = function (t) {
var Zl = function (t, n, e, r, a) {
return Math[vl(378)]((t - n) / (e - n) * (a - r) + r)
}
u = function (t, n, e) {
var u = function (t, n, e) {
var Z = Bn($(e), 10), d = [], v = -1
for (var p = 0; p < t['length']; p++) {
......@@ -332,8 +332,8 @@ u = function (t, n, e) {
return A
}
o = 'G^S}DNK8DNa>D`K}GK77'
ur = u(o
var o = 'G^S}DNK8DNa>D`K}GK77'
var ur = u(o
, 364, '632ced90-2c62-11ee-9f7e-270e803e7664')
console.log(ur)
......@@ -371,4 +371,8 @@ function enc(payload, uuid) {
return rrr(o, payload, ur)
}
console.log(333,enc(aa, "e956bcd0-2d0b-11ee-a21c-431215775a7a"))
\ No newline at end of file
console.log(333,enc(aa, "e956bcd0-2d0b-11ee-a21c-431215775a7a"))
// module.exports = {
// getWords: getWords
// }
\ No newline at end of file
This diff is collapsed.
import tls_client
session = tls_client.Session(client_identifier='chrome_112')
r = session.get('https://booking.flyfrontier.com/Flight/InternalSelect?o1=DEN&d1=LAS&dd1=2023-08-30&ADT=1&umnr=false&mon=true', headers={
"authority": "www.flyfrontier.com",
"accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
"accept-language": "en-US,en;q=0.9,zh-CN;q=0.8,zh;q=0.7,ru;q=0.6",
"cache-control": "no-cache",
"pragma": "no-cache",
"sec-ch-ua": "\"Not/A)Brand\";v=\"99\", \"Google Chrome\";v=\"115\", \"Chromium\";v=\"115\"",
"sec-ch-ua-mobile": "?0",
"sec-ch-ua-platform": "\"macOS\"",
"sec-fetch-dest": "document",
"sec-fetch-mode": "navigate",
"sec-fetch-site": "none",
"sec-fetch-user": "?1",
"upgrade-insecure-requests": "1",
"user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36"
})
print(r.text)
\ 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