Commit b31f5fe6 authored by wang's avatar wang

11

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