Commit c8047a25 authored by wang's avatar wang

nk token 测试

parent c864a15c
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -6,6 +6,7 @@ import re
import time
import execjs
import requests
import tls_client
from loguru import logger
......@@ -44,6 +45,7 @@ class PxBypass():
cs = ''
sid = ''
cts = ''
# session.proxies = {
# 'http': "http://user-unifflcc-region-us:q39CEBTs5A5YQXor@pr.roxlabs.cn:4600",
# 'https': "http://user-unifflcc-region-us:q39CEBTs5A5YQXor@pr.roxlabs.cn:4600",
......@@ -60,32 +62,44 @@ class PxBypass():
self._step_2()
self._step_3()
c = self.__token()
if c == 403:
self._step_1()
self._step_2()
self._step_3()
self.log.info(f'c: {c}')
# if c == 403:
# self._step_1()
# self._step_2()
# self._step_3()
self.log.info(self.session.cookies.get_dict())
def _init(self):
res = 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)
cks = requests.post('http://127.0.0.1:59001/akamai/gen', json={"type": "NK", "proxy": "http://127.0.0.1:7890"})
print(cks.json())
cks = cks.json()['cookies']
self.session.cookies.update(cks)
url = "https://www.spirit.com/api/prod-token/api/v1/token"
data = {
"applicationName": "dotRezWeb"
}
data = json.dumps(data, separators=(',', ':'))
res = self.session.post(url, 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,ru;q=0.6",
"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": "\"Google Chrome\";v=\"117\", \"Not;A=Brand\";v=\"8\", \"Chromium\";v=\"117\"",
"sec-ch-ua-mobile": "?0",
"sec-ch-ua-platform": "\"macOS\"",
"sec-fetch-dest": "empty",
"sec-fetch-mode": "cors",
"sec-fetch-site": "same-origin",
"user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36",
"x-dtpc": "2$217478397_28h17vUSRHUHMPCLARSKPAAKSGJSNTPCPCCFBR-0e0"
}, data=data)
self.log.info(f"初始化请求 res {res.status_code}")
self.params = {}
for k, v in self.session.cookies.items():
......@@ -217,7 +231,6 @@ class PxBypass():
# self.token = m['I00II0']
self.log.info(self.m)
def _step_1(self):
t1 = int(time.time() * 1000)
self.init_time = t1
......@@ -228,7 +241,7 @@ class PxBypass():
{
"t": "PX12095",
"d": {
"PX11645": "https://www.flyfrontier.com/",
"PX11645": "https://www.spirit.com/",
"PX12207": 0,
"PX12458": "MacIntel",
"PX11902": 0,
......@@ -258,7 +271,7 @@ class PxBypass():
print(pc)
body = {
"payload": payload,
"appId": "PXVb73hTEg",
"appId": "PXkp4CLSb5",
"tag": tag,
"uuid": self.uuid,
"ft": ft,
......@@ -272,16 +285,16 @@ class PxBypass():
})
print(body)
url = "https://collector-pxvb73hteg.px-cloud.net/assets/js/bundle"
url = "https://collector-PXkp4CLSb5.px-cloud.net/assets/js/bundle"
headers = {
"authority": "collector-PXVb73hTEg.px-cloud.net",
"authority": "collector-PXkp4CLSb5.px-cloud.net",
"accept": "*/*",
"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.flyfrontier.com",
"origin": "https://www.spirit.com",
"pragma": "no-cache",
"referer": "https://www.flyfrontier.com/",
"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\"",
......@@ -312,42 +325,41 @@ class PxBypass():
def __token(self):
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.status_code)
with open('index.html', 'w') as f:
f.write(response.text)
vids = re.findall("_pxVid = '(.+?)'", response.text)
if len(vids) != 0:
self.vid = vids[0]
self.log.info(f'获取到vid {self.vid}')
uuids = re.findall("_pxUuid = '(.+?)'", response.text)
if len(uuids) != 0:
self.uuid = uuids[0]
self.log.info(f'获取到uuid {self.uuid}')
url = "https://www.spirit.com/api/prod-token/api/v1/token"
data = {
"applicationName": "dotRezWeb"
}
data = json.dumps(data, separators=(',', ':'))
res = self.session.post(url, 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,ru;q=0.6",
"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": "\"Google Chrome\";v=\"117\", \"Not;A=Brand\";v=\"8\", \"Chromium\";v=\"117\"",
"sec-ch-ua-mobile": "?0",
"sec-ch-ua-platform": "\"macOS\"",
"sec-fetch-dest": "empty",
"sec-fetch-mode": "cors",
"sec-fetch-site": "same-origin",
"user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36",
"x-dtpc": "2$217478397_28h17vUSRHUHMPCLARSKPAAKSGJSNTPCPCCFBR-0e0"
}, data=data)
self.log.info(f"c res {res.status_code}")
self.log.info(f"c text {res.text}")
return response.status_code
return res.status_code
def _step_2(self):
self.log.info(self.m)
# genPayload2(vid, sid, uuid, sts, code1, code2, tag)
data_str = ctxStep2.call('genPayload2', self.vid,self.sid,self.uuid, self.sts, self.code1, self.code2, self.tag)
data_str = ctxStep2.call('genPayload2', self.vid, self.sid, self.uuid, self.sts, self.code1, self.code2,
self.tag)
self.log.info(f'data_str2 {data_str}')
......@@ -358,7 +370,7 @@ class PxBypass():
pc = self.__gen_pc(data_str, f'{self.uuid}:{tag}:{ft}')
body = {
"payload": payload,
"appId": "PXVb73hTEg",
"appId": "PXkp4CLSb5",
"tag": tag,
"uuid": self.uuid,
"ft": ft,
......@@ -371,16 +383,16 @@ class PxBypass():
"cts": self.cts,
"rsc": "1"
}
url = "https://collector-pxvb73hteg.px-cloud.net/assets/js/bundle"
url = "https://collector-PXkp4CLSb5.px-cloud.net/assets/js/bundle"
headers = {
"authority": "collector-PXVb73hTEg.px-cloud.net",
"authority": "collector-PXkp4CLSb5.px-cloud.net",
"accept": "*/*",
"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.flyfrontier.com",
"origin": "https://www.spirit.com",
"pragma": "no-cache",
"referer": "https://www.flyfrontier.com/",
"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\"",
......@@ -427,12 +439,14 @@ class PxBypass():
self.log.info(f'cookies2 {self.session.cookies.keys()}')
self.m = m
self.log.info(self.m)
def _step_3(self):
# self.log.info(self.m)
# self.log.info(self.uuid)
time.sleep(5)
# time.sleep(5)
data_str = ctxStep3.call('genPayload', self.uuid, self.vid, self.hash, self.hash2, self.hashv, self.token, self.ci, self.init_time)
data_str = ctxStep3.call('genPayload', self.uuid, self.vid, self.hash, self.hash2, self.hashv, self.token,
self.ci, self.init_time)
self.log.info(f'data_str2 {data_str}')
data_str = json.dumps(data_str)
......@@ -443,7 +457,7 @@ class PxBypass():
pc = self.__gen_pc(data_str, f'{self.uuid}:{tag}:{ft}')
body = {
"payload": payload,
"appId": "PXVb73hTEg",
"appId": "PXkp4CLSb5",
"tag": tag,
"uuid": self.uuid,
"ft": ft,
......@@ -457,16 +471,16 @@ class PxBypass():
"cts": self.cts,
"rsc": "3"
}
url = "https://collector-pxvb73hteg.px-cloud.net/assets/js/bundle"
url = "https://collector-PXkp4CLSb5.px-cloud.net/assets/js/bundle"
headers = {
"authority": "collector-PXVb73hTEg.px-cloud.net",
"authority": "collector-PXkp4CLSb5.px-cloud.net",
"accept": "*/*",
"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.flyfrontier.com",
"origin": "https://www.spirit.com",
"pragma": "no-cache",
"referer": "https://www.flyfrontier.com/",
"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\"",
......@@ -516,7 +530,7 @@ class PxBypass():
if __name__ == '__main__':
url = "https://booking.flyfrontier.com/Flight/InternalSelect?o1=DEN&d1=LAS&dd1=2023-08-30&ADT=1&umnr=false&mon=true"
url = "https://booking.spirit.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)
<!DOCTYPE html><html lang="en" translate="no"><head>
<script type="text/javascript" src="https://www.spirit.com/static/9e17e4fbb7d10c40d0c9fe606f74062ea7ab0011ba04fc" ></script><script type="text/javascript"> (function(){
window.PXkp4CLSb5_asyncInit = function(px) {
px.Events.on('score', function (score) {
try {
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({ event: 'px.score', trigger: { dimension117: score }});
} catch (err) {
console.error("px score ga send failed" + err);
}
});
};
var p = document.getElementsByTagName('script')[0], s = document.createElement('script'); s.async = 1; s.src = '/kp4CLSb5/init.js';
window._pxMonitorAbr = true; p.parentNode.insertBefore(s,p);}());
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-VKEG2ZBNZ5');
window['GoogleAnalyticsObject'] = 'ga';
window['ga'] = window['ga'] || function() {
(window['ga'].q = window['ga'].q || []).push(arguments)
};
function OptanonWrapper() { }
function getCookie(name) {
const v = `; ${document.cookie}`;
const a = v.split(`; ${name}=`);
if (a.length === 2) return a.pop().split(';').shift();
}
var OneTrust = {
geolocationResponse: {
stateCode: getCookie('userProvinceLocation'),
countryCode: getCookie('userCountryLocation'),
}
};
</script>
<link rel="preconnect" href="https://service.maxymiser.net">
<link rel="preload" as="script" href="https://www.spirit.com/static/9e17e4fbb7d10c40d0c9fe606f74062ea7ab0011ba04fc"/><link rel="preload" href="https://d.oracleinfinity.io/infy/acs/account/heul299ijy/js/main/odc.js?_ora.config=analytics:production;maxymiser:production" as="script">
<script type="text/javascript" src="https://d.oracleinfinity.io/infy/acs/account/heul299ijy/js/main/odc.js?_ora.config=analytics:production;maxymiser:production"></script>
<script src="https://cdn.cookielaw.org/scripttemplates/otSDKStub.js" type="text/javascript" charset="UTF-8" data-domain-script="0390835f-17d4-4720-a875-08b2c2eeac36"></script>
<meta charset="utf-8">
<meta name="google" content="notranslate">
<meta name="google-site-verification" content="_f3fFuGwOQMzwZ_2R71sZBMz8zpKYkp0cmzcZyXb_X4">
<meta name="viewport" content="initial-scale=1.0, width=device-width, height=device-height, user-scalable=yes">
<meta name="description" content="Spirit Airlines is the leading Ultra Low Cost Carrier in the United States, the Caribbean and Latin America. Spirit Airlines fly to 60+ destinations with 500+ daily flights with Ultra Low Fare.">
<title>Spirit Airlines</title>
<link rel="preconnect" href="https://content.spirit.com">
<link rel="preload" href="/assets/font/source-sans-pro/WOFF2/TTF/SourceSansPro-Regular.ttf.woff2" as="font" type="font/woff2" crossorigin="anonymous">
<link rel="preload" href="/assets/font/source-sans-pro/WOFF2/TTF/SourceSansPro-Black.ttf.woff2" as="font" type="font/woff2" crossorigin="anonymous">
<link rel="preload" href="/assets/font/icomoon/icomoon.woff2?bfh1w1" as="font" type="font/woff2" crossorigin="anonymous">
<link rel="preload" media="(max-width: 766px)" href="https://content.spirit.com/a/2129" as="image">
<link rel="preload" media="(min-width: 767px) and (max-width: 992px)" href="https://content.spirit.com/a/2888" as="image">
<link rel="preload" media="(min-width: 993px)" href="https://content.spirit.com/a/2151" as="image">
<base href="/"><script type="text/javascript" src="https://js-cdn.dynatrace.com/jstag/16dcf18d41e/bf04820crc/73bede5a20cee83c_complete.js" crossorigin="anonymous"></script>
<link rel="icon" type="image/x-icon" href="favicon.ico?v=2">
<style>:root{--blue:#007bff;--indigo:#6610f2;--purple:#6f42c1;--pink:#e83e8c;--red:#dc3545;--orange:#fd7e14;--yellow:#ffc107;--green:#28a745;--teal:#20c997;--cyan:#17a2b8;--white:#fff;--gray:#6c757d;--gray-dark:#343a40;--primary:#007bff;--secondary:#6c757d;--success:#28a745;--info:#17a2b8;--warning:#ffc107;--danger:#dc3545;--light:#f8f9fa;--dark:#343a40;--breakpoint-xs:0;--breakpoint-sm:576px;--breakpoint-md:768px;--breakpoint-lg:992px;--breakpoint-xl:1200px;--font-family-sans-serif:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-family-monospace:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace}*,:after,:before{box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:transparent}body{margin:0;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-size:1rem;font-weight:400;line-height:1.5;color:#212529;text-align:left;background-color:#fff}@media print{*,:after,:before{text-shadow:none!important;box-shadow:none!important}@page{size:a3}body{min-width:992px!important}}html{scroll-behavior:smooth}html{font-size:100%;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-smoothing:antialiased;font-weight:400}@-moz-document url-prefix(){body{font-weight:lighter!important}}body{margin:0;font-family:Source Sans Pro,Verdana,sans-serif;font-size:1rem;color:#000;overflow-y:scroll;overflow-x:hidden}@media print{@page{size:auto;margin:10mm}}@font-face{font-family:Source Sans Pro;font-weight:400;font-style:normal;font-stretch:normal;font-display:swap;src:local("Source Sans Pro Regular"),local("SourceSansPro-Regular"),url(/assets/font/source-sans-pro/WOFF2/TTF/SourceSansPro-Regular.ttf.woff2) format("woff2"),url(/assets/font/source-sans-pro/WOFF/OTF/SourceSansPro-Regular.otf.woff) format("woff")}</style><link rel="stylesheet" href="styles.a654c67cd0cb36ef.css" media="print" onload="this.media='all'"><noscript><link rel="stylesheet" href="styles.a654c67cd0cb36ef.css"></noscript><script >bazadebezolkohpepadr="1190102079"</script><script type="text/javascript" src="https://www.spirit.com/akam/13/46ef872d" defer></script></head>
<body>
<noscript>
<iframe
src="https://www.googletagmanager.com/ns.html?id=GTM-TRK4LPZ&gtm_auth=cVHzS7BYqjxUbMatudai8Q&gtm_preview=env-2&gtm_cookies_win=x"
height="0" width="0" style="display:none;visibility:hidden"></iframe>
</noscript>
<app-root></app-root>
<script src="runtime.f5673c34aa92eef5.js" type="module"></script><script src="polyfills.d4877e4ac0179a87.js" type="module"></script><script src="vendor.a23753ef92c43297.js" type="module"></script><script src="main.20c38a429a29b19e.js" type="module"></script>
<noscript><img src="https://www.spirit.com/akam/13/pixel_46ef872d?a=dD1jOTc4ZGQ1MTg5ZDlmZWY0MTc0Y2E4M2Q3ZTlkNzdkNDc3MTFjMDc0JmpzPW9mZg==" style="visibility: hidden; position: absolute; left: -999px; top: -999px;" /></noscript><script type="text/javascript" src="/E81TUokuhLEVcwLtKQ/h1r9GcEf7L/Qk1Q/MlBq/dHBqbWgB"></script></body></html>
{"errors":null,"messages":null,"data":{"token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJkb3RSZXpXZWIiLCJqdGkiOiJiOGRjOGQ1NC05YjIyLWZkNDAtMzFjZS1iMDg4ZTViOWE0MTkiLCJpc3MiOiJkb3RSRVogQVBJIn0.xtEGJwPyAlAorCWKX1WQRaJRd5j8ZTiRPhxdna4hBnA","idleTimeoutInMinutes":15},"metadata":null}
\ No newline at end of file
......@@ -5,15 +5,14 @@ import random
import time
import execjs
import requests
import tls_client
from loguru import logger
with open('js/encodepayload.js', 'r', encoding='utf-8') as f:
jsCode = f.read()
ctx = execjs.compile(jsCode)
ctxPC = execjs.compile(open('pc.js').read())
ctxStep2 = execjs.compile(open('step2.js').read())
ctxPC = execjs.compile(open('pc.js', 'r').read())
ctxStep2 = execjs.compile(open('step2.js', 'r').read())
def get_timestamp():
......@@ -46,32 +45,44 @@ class PxBypass():
self._init()
self._step_1()
self._step_2()
cks = self.session.cookies.get_dict()
res = []
for k,v in cks.items():
for k, v in cks.items():
res.append(f'{k}={v}')
print('cks = append(cks, &http.Cookie{Name: "' + k + '", Value: "'+v+'"})')
print('; '.join(res))
# self._step_2()
# self.__token()
print('cks = append(cks, &http.Cookie{Name: "' + k + '", Value: "' + v + '"})')
# print('; '.join(res))
self.__token()
def _init(self):
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",
"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, allow_redirects=True)
self.log.info(f"初始化请求 res {res.status_code}")
# headers = {
# "authority": "www.spriti.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",
# "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, allow_redirects=True)
# self.log.info(f"初始化请求 res {res.status_code}")
self.params = {}
self.session.cookies.update(
{
"_abck": "458AC263C1AF432E5C21C1B18E5CFEB4~0~YAAQLC0tF3O+BmGLAQAAPBuXZQqz7ojPmAs/5w92Jec/vQPtvAN4o646kbz0ZCoR9rCXsKNDRcZnAzR6pzrVTNmiqWdNyLGrLa1wZr63NscBHyDfsN4qN9k8esESjlcN3oImy3tDmbhqSdShpeIzs3ci4wWEx7YeQMkSyGETLcHy/KQR7T+sJbcEGJtsIZwIYMCkWES5XfaRDFPeLnFgIDFeRyMOujFAPKtbqeYF9/fkVRfXRm2qVBrH3odw1Ahn96U2pSW0R6oVpyI2FJH5Z+YHpkQeJRHim0KtnPFt3K3Sc3Jwpq+72WxW80Kgxs57fDEBh3Gbqfd4QagSku7XxfdDF93vyhUNlkVMsZhlIXwkdvluqcrzUQaY2iNj2sLDtCHhHoWnLLWjLPs0g5rrrO0Opar2TDKlrg==~-1~-1~1698219999",
"_pxhd": "3a00a3b04e381da0411bdccfeffcc207f08031e05bafeaf5504acace04788e78:70ff3591-7302-11ee-adc0-89185d2fb9d0",
"ak_bmsc": "C72E104CC8715DEF1805E70E27AE398C~000000000000000000000000000000~YAAQLC0tF3S+BmGLAQAAPBuXZRX8kjOyO7jCD4VXOHLBay3qXUgaXMnvEAVt3jxP2KG96BJcm4UjhqLG3deo1K8EJvrkY3kClpcI2fVgDDpm81Enq9qipxnJNGFTZQNvEZFuTsqoxPHd1uetFwVo0m9spGI6OY4NkTQdf2iBt3JdfMjKoHLDivjNl85soityCkZ1VRvHCgyGmJE/dZWlc3ht7a1fLMHILYhzBRbLe36wWSmk4bP0WF2q8Qx1u22orGe3cIEukCeGE4OgFF63txAAJcMh/wUXBUgKj1PKvm6hFPx0YYGbcTir7X0ZnTb0XHDh2FwU9/3NUaYI/nXM8ZZmxEfrRiMoxBHxWfcRqvMGpJUCXU/5y2DC9+E7s7RR02jCxxRNfhl3hsRvp0Op0lulP7XD",
"bm_sv": "CC1EC8F7B758F71ABE009B6CB45AA47E~YAAQLC0tF3W+BmGLAQAAPBuXZRVNDHugg12neZvQxV+6RKsIVkqhOiFIPODHm/UZBPtO0w++P1kLUbZCgnAZe6mFC9yM6CRhKH24SvlypxxEu6n336x5DwKE1U4/lJjcBpXvNlqTayCcKwKEgRyptbkr7KjdTGkYhqeOAzr45914qTlH8Iq9YLitS5CfMcbDQ/idHrYx0Jw1ok0JNx1lf6yvYCqOZRjuYeYZxVkZbQmR25l1pjNN1BALh0gJ/GME~1",
"bm_sz": "B28FB8D80950D150659C06C31B9F45FB~YAAQLC0tFzO+BmGLAQAAvxSXZRWaQKqVvyyxH8QA1zpxO9Uiq9ePiKzeUlIOGg8grvmUbM2AISNS/QE9g47/kycpJYulxjMq3Q4dgZyUwPt2y3w9aiuIMEbWzN/6wr7xGEg5fXB6M5Q2In6LnQWQL2kyTqNI/lh06+gYSFm/VzRy9aLpVSGx4rd7XEo/pOmvAacn5miPCxJgse2XFMbF0ldA1PfWjc5/dzjKYsepF6rt1BAMCd4nk5B4vrh654t5865csLIbKVQXQat1aPydJxX1hpz0VqpaDMSZqJ45LXTUH30=~3228209~4538931",
"userCountryLocation": "US", "userGeolocation": "-118.2487, 33.9733"}
)
for k, v in self.session.cookies.items():
self.params[k] = v
self.log.info(f"init cookie {self.params}")
with open('index.html','w') as f:
f.write(res.text)
# with open('index.html','w') as f:
# f.write(res.text)
def __uuid(self):
r = ["00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "0a", "0b", "0c", "0d", "0e", "0f", "10", "11",
......@@ -132,7 +143,7 @@ class PxBypass():
_uuid = self.__uuid()
self.uuid = _uuid
data = [{"t": "PX12095",
"d": {"PX11645": "https://www.flyfrontier.com/", "PX12207": 0, "PX12458": "MacIntel", "PX11902": 0,
"d": {"PX11645": "https://www.spirit.com/", "PX12207": 0, "PX12458": "MacIntel", "PX11902": 0,
"PX11560": random.randint(8549, 8549 * 3), "PX12248": 3600, "PX11385": t1, "PX12280": t2,
"PX11496": _uuid, "PX12564": None, "PX12565": -1,
"PX11379": False}}]
......@@ -166,9 +177,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.flyfrontier.com",
"origin": "https://www.spirit.com",
"pragma": "no-cache",
"referer": "https://www.flyfrontier.com/",
"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\"",
......@@ -233,27 +244,34 @@ class PxBypass():
def __token(self):
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)
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={
"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,ru;q=0.6",
"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": "\"Google Chrome\";v=\"117\", \"Not;A=Brand\";v=\"8\", \"Chromium\";v=\"117\"",
"sec-ch-ua-mobile": "?0",
"sec-ch-ua-platform": "\"macOS\"",
"sec-fetch-dest": "empty",
"sec-fetch-mode": "cors",
"sec-fetch-site": "same-origin",
"user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36",
"x-dtpc": "8$216560782_634h19vKIAKIMFGTUTKRWPPLDKCSORJAIECKGLH-0e0"
}, data=data)
print(response.text)
print(response)
print(response.status_code)
with open('index.html', 'w') as f:
f.write(response.text)
def _step_2(self):
self.log.info(self.m)
......@@ -269,7 +287,7 @@ class PxBypass():
pc = self.__gen_pc(data_str, f'{self.uuid}:{tag}:{ft}')
body = {
"payload": payload,
"appId": "PXVb73hTEg",
"appId": "PXkp4CLSb5",
"tag": tag,
"uuid": self.uuid,
"ft": ft,
......@@ -289,9 +307,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.flyfrontier.com",
"origin": "https://www.spirit.com",
"pragma": "no-cache",
"referer": "https://www.flyfrontier.com/",
"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\"",
......@@ -305,7 +323,7 @@ class PxBypass():
resp = response.json()
m = {}
if 'ob' in resp:
cookies = self.encrypt(base64.b64decode(resp['ob'].encode()), 866 % 128).decode()
cookies = self.encrypt(base64.b64decode(resp['ob'].encode()), 866 % 128).decode()
print(cookies.split('~~~~'))
for i in cookies.split('~~~~'):
tmp = i.split('|')
......
......@@ -332,22 +332,10 @@ function genPayload2(m, uuid) {
}
let m = {
'0III00I0': 'f8ca58ff-4706-11ee-8ad9-614247755465',
'00III0': 'cad902e272e8962eb647a943dcd3e2b33a51b2dd2984c00116b0e63df1ce9fd8',
'IIII00': 'cjnevo1ushun7urncgfg',
'IIIIII': 'fp',
'I00III': '15030756842869753411',
'I0I0II': 'f8ca555c-4706-11ee-8ad9-614247755465',
'0III0III': '1693380576466',
'IIII0I': 'ccc:300',
'0III0II0': '7651',
'I00II0': '1',
'I0I0I0': '1',
'IIIII0': '_px2',
'00I0I0': 'cu'
}
let m = {'0III00I0': '73baa694-7301-11ee-8463-9b1df7b79325', 'IIIIII': 'cc', 'I000I0': '7085e0da-7301-11ee-84f5-5582eedff628', 'I0I0II': '73baa2bc-7301-11ee-8463-9b1df7b79325', 'IIII00': 'cksbgu731eluem724ro0', '00III0': '20fbd80b9bce0b509a1beadcdc3ef7975778c3a9c129a0b6459c0033563cd176', '0III0II0': '4421', '0III0III': '1698216056908', 'IIIII0': '_px2', '0IIII000': '_pxde', 'I00III': '30232015987262911033', '0II0I0': 'score', '00I0I0': 'cu'}
console.log(genPayload2(m, 'f3920367-4706-11ee-b994-674b47685845'))
console.log(genPayload2(m, '8b823061-7040-1031-97ec-2f3858db48a3'
))
// console.log(JSON.stringify(data))
// console.log(data[0].d.PX11804)
\ 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