Commit 8ccbc087 authored by wang's avatar wang

开始按压验证码

parent 0dcac129
......@@ -6,15 +6,15 @@ import json
import random
import time
import traceback
import uuid
from urllib.parse import quote
import execjs
import requests
import tls_client
from loguru import logger
from env import PxEnv
from utils import PxUtils
# with open('js/encodepayload.js', 'r', encoding='utf-8') as f:
# jsCode = f.read()
# # ctx = execjs.compile(jsCode)
......@@ -75,8 +75,8 @@ class PxBypass():
ft = "317"
appId = "PXVb73hTEg"
cookies = {}
def __init__(self, target_url):
self.pxHeaders = {
......@@ -143,8 +143,6 @@ class PxBypass():
self.performanceNow += int(time.time() * 1000 - self.startTs)
self.px12280 = self.startTs2 + self.performanceNow
def run(self):
self._init()
self.seq = 0
......@@ -157,7 +155,6 @@ class PxBypass():
self._step_2(True)
# time.sleep(2)
# self._step_2(False)
#
# # # if self.session.cookies.get_dict().get('_px2', None) == None:
......@@ -165,7 +162,8 @@ class PxBypass():
self._step_3()
time.sleep(2)
self._token()
# self._token()
return self.header()
def _init(self):
cks = '_px2=eyJ1IjoiOGRjYjQ3NjAtODl2jYi0xMWVlLTkwMmUtODE4MTcxMjRjOTBlIiwidiI6IjhlOGIyMGMzLTg5Y2ItMTFlZS05YWI1LTAwMjc4Njk4ZmY1ZiIsInQiOjYyMDIzMzg4MDAwNCwiaCI6Ijk4NjYzMWNkZDBmNTBjMWE5NjZjYjgwOGNlNzFjYTJkMWNkYzc2MjdjYTc4MTBlZDVhODdmN2FiMzYzOGU1OTgifQ==; pxcts=8e8b30eb-89cb-11ee-9ab5-ccabb13183c7; _px2=eyJ1IjoiOGRjYjQ3NjAtODljYi0xMWVlLTkwMmUtODE4MTcxMjRjOTBlIiwidiI6IjhlOGIyMGMzLTg5Y2ItMTFlZS05YWI1LTAwMjc4Njk4ZmY1ZiIsInQiOjYyMDIzMzg4MDAwNCwiaCI6Ijk4NjYzMWNkZDBmNTBjMWE5NjZjYjgwOGNlNzFjYTJkMWNkYzc2MjdjYTc4MTBlZDVhODdmN2FiMzYzOGU1OTgifQ=='
......@@ -199,80 +197,80 @@ class PxBypass():
f.write(res.text)
def _uuid(self):
# return str(uuid.uuid4())
# return "b8a39670-7866-11ee-9655-63a4f05cd5d1"
# return ctxStep2.call('genUuid')
r = ["00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "0a", "0b", "0c", "0d", "0e", "0f", "10",
"11",
"12", "13", "14", "15", "16", "17", "18", "19", "1a", "1b", "1c", "1d", "1e", "1f", "20", "21", "22",
"23",
"24", "25", "26", "27", "28", "29", "2a", "2b", "2c", "2d", "2e", "2f", "30", "31", "32", "33", "34",
"35",
"36", "37", "38", "39", "3a", "3b", "3c", "3d", "3e", "3f", "40", "41", "42", "43", "44", "45", "46",
"47",
"48", "49", "4a", "4b", "4c", "4d", "4e", "4f", "50", "51", "52", "53", "54", "55", "56", "57", "58",
"59",
"5a", "5b", "5c", "5d", "5e", "5f", "60", "61", "62", "63", "64", "65", "66", "67", "68", "69", "6a",
"6b",
"6c", "6d", "6e", "6f", "70", "71", "72", "73", "74", "75", "76", "77", "78", "79", "7a", "7b", "7c",
"7d",
"7e", "7f", "80", "81", "82", "83", "84", "85", "86", "87", "88", "89", "8a", "8b", "8c", "8d", "8e",
"8f",
"90", "91", "92", "93", "94", "95", "96", "97", "98", "99", "9a", "9b", "9c", "9d", "9e", "9f", "a0",
"a1",
"a2", "a3", "a4", "a5", "a6", "a7", "a8", "a9", "aa", "ab", "ac", "ad", "ae", "af", "b0", "b1", "b2",
"b3",
"b4", "b5", "b6", "b7", "b8", "b9", "ba", "bb", "bc", "bd", "be", "bf", "c0", "c1", "c2", "c3", "c4",
"c5",
"c6", "c7", "c8", "c9", "ca", "cb", "cc", "cd", "ce", "cf", "d0", "d1", "d2", "d3", "d4", "d5", "d6",
"d7",
"d8", "d9", "da", "db", "dc", "dd", "de", "df", "e0", "e1", "e2", "e3", "e4", "e5", "e6", "e7", "e8",
"e9",
"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)]
# random.shuffle(ys)
Gs = random.randint(1100, 9999)
Ws = 0
s = Gs
h = get_timestamp()
d = bs + 1
m = int(h - Ws + (d - bs) / 1e4)
Ws = h
bs = d
Gs = s
f = []
u = 0
# (1e4 * (268435455 & (f + 122192928e5)) + s) % 4294967296
h += 122192928e5
h = int(h)
p = (1e4 * (268435455 & h) + 0) % 4294967296
# p = 4180087664
f[:3] = int(p).to_bytes(4, byteorder='big')
Q = int(h / 4294967296 * 1e4) & 268435455
# Q = 32386116
f.append(unsinged_right_shift(Q, 8) & 255)
f.append(255 & Q)
f.append(unsinged_right_shift(Q, 24) & 15 | 16)
f.append(unsinged_right_shift(Q, 16) & 255)
# s = 6488
f.append(unsinged_right_shift(s, 8) | 128)
f.append(255 & s)
for i in ys:
f.append(i)
# print(f)
# 18992390-8912-11ee-a2e1-b3b33c4f608f
# 70e50290-8911-11ee-bc61-f92af0d8127e
# f = [112,229,2,144,137,17,17,238,188,97,249,42,240,216,18,126]
res = [r[f[0]], r[f[1]], r[f[2]], r[f[3]], '-', r[f[4]], r[f[5]], '-', r[f[6]], r[f[7]], '-', r[f[8]],
r[f[9]],
'-',
r[f[10]], r[f[11]], r[f[12]], r[f[13]], r[f[14]], r[f[15]]]
return ''.join(res)
# return str(uuid.uuid4())
# return "b8a39670-7866-11ee-9655-63a4f05cd5d1"
# return ctxStep2.call('genUuid')
r = ["00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "0a", "0b", "0c", "0d", "0e", "0f", "10",
"11",
"12", "13", "14", "15", "16", "17", "18", "19", "1a", "1b", "1c", "1d", "1e", "1f", "20", "21", "22",
"23",
"24", "25", "26", "27", "28", "29", "2a", "2b", "2c", "2d", "2e", "2f", "30", "31", "32", "33", "34",
"35",
"36", "37", "38", "39", "3a", "3b", "3c", "3d", "3e", "3f", "40", "41", "42", "43", "44", "45", "46",
"47",
"48", "49", "4a", "4b", "4c", "4d", "4e", "4f", "50", "51", "52", "53", "54", "55", "56", "57", "58",
"59",
"5a", "5b", "5c", "5d", "5e", "5f", "60", "61", "62", "63", "64", "65", "66", "67", "68", "69", "6a",
"6b",
"6c", "6d", "6e", "6f", "70", "71", "72", "73", "74", "75", "76", "77", "78", "79", "7a", "7b", "7c",
"7d",
"7e", "7f", "80", "81", "82", "83", "84", "85", "86", "87", "88", "89", "8a", "8b", "8c", "8d", "8e",
"8f",
"90", "91", "92", "93", "94", "95", "96", "97", "98", "99", "9a", "9b", "9c", "9d", "9e", "9f", "a0",
"a1",
"a2", "a3", "a4", "a5", "a6", "a7", "a8", "a9", "aa", "ab", "ac", "ad", "ae", "af", "b0", "b1", "b2",
"b3",
"b4", "b5", "b6", "b7", "b8", "b9", "ba", "bb", "bc", "bd", "be", "bf", "c0", "c1", "c2", "c3", "c4",
"c5",
"c6", "c7", "c8", "c9", "ca", "cb", "cc", "cd", "ce", "cf", "d0", "d1", "d2", "d3", "d4", "d5", "d6",
"d7",
"d8", "d9", "da", "db", "dc", "dd", "de", "df", "e0", "e1", "e2", "e3", "e4", "e5", "e6", "e7", "e8",
"e9",
"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)]
# random.shuffle(ys)
Gs = random.randint(1100, 9999)
Ws = 0
s = Gs
h = get_timestamp()
d = bs + 1
m = int(h - Ws + (d - bs) / 1e4)
Ws = h
bs = d
Gs = s
f = []
u = 0
# (1e4 * (268435455 & (f + 122192928e5)) + s) % 4294967296
h += 122192928e5
h = int(h)
p = (1e4 * (268435455 & h) + 0) % 4294967296
# p = 4180087664
f[:3] = int(p).to_bytes(4, byteorder='big')
Q = int(h / 4294967296 * 1e4) & 268435455
# Q = 32386116
f.append(unsinged_right_shift(Q, 8) & 255)
f.append(255 & Q)
f.append(unsinged_right_shift(Q, 24) & 15 | 16)
f.append(unsinged_right_shift(Q, 16) & 255)
# s = 6488
f.append(unsinged_right_shift(s, 8) | 128)
f.append(255 & s)
for i in ys:
f.append(i)
# print(f)
# 18992390-8912-11ee-a2e1-b3b33c4f608f
# 70e50290-8911-11ee-bc61-f92af0d8127e
# f = [112,229,2,144,137,17,17,238,188,97,249,42,240,216,18,126]
res = [r[f[0]], r[f[1]], r[f[2]], r[f[3]], '-', r[f[4]], r[f[5]], '-', r[f[6]], r[f[7]], '-', r[f[8]],
r[f[9]],
'-',
r[f[10]], r[f[11]], r[f[12]], r[f[13]], r[f[14]], r[f[15]]]
return ''.join(res)
def _step_1(self):
t1 = int(time.time() * 1000)
......@@ -339,7 +337,7 @@ class PxBypass():
print('; '.join(cks))
url = 'https://booking.flyfrontier.com/Flight/InternalSelect?o1=DEN&d1=LAS&dd1=2023-11-30&ADT=1&umnr=false&mon=true'
response = requests.post('http://52.52.23.116/tls/forward',
# response = requests.post('http://127.0.0.1:58000/tls/forward',
# response = requests.post('http://127.0.0.1:58000/tls/forward',
json=dict(url=url, headers={
"authority": "booking.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",
......@@ -380,8 +378,8 @@ class PxBypass():
# data_str =
# data = json.loads(data_str)
p = PxEnv(self.target_url, self.sid, self.vid, self.ts, self.num1, self.num2,
self.str1, self.uuid,
self.startTs, self.startTs2, self.performanceNow, self.px12280)
self.str1, self.uuid,
self.startTs, self.startTs2, self.performanceNow, self.px12280)
data = [p.get_px11590()]
# data_str2 = ctxStep2.call('genPayload3', self.target_url, self.sid, self.vid, self.ts, self.num1, self.num2,
# self.str1, self.uuid,
......@@ -396,7 +394,7 @@ class PxBypass():
return a % 128
def _step_11(self):
data =[{"t":"PX12167","d":{"PX11648":True}}]
data = [{"t": "PX12167", "d": {"PX11648": True}}]
self.do_collector(data)
......@@ -504,6 +502,31 @@ class PxBypass():
tmp[0]: tmp[1]
})
def header(self):
cks = []
for k, v in self.cookies.items():
cks.append(f'{k}={v}')
for k, v in self.session.cookies.get_dict().items():
cks.append(f'{k}={v}')
headers = {
"authority": "booking.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",
"cache-control": "no-cache",
"pragma": "no-cache",
"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": "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/117.0.0.0 Safari/537.36",
"cookie": '; '.join(cks)
}
return headers
if __name__ == '__main__':
url = "https://booking.flyfrontier.com/Flight/InternalSelect?o1=DEN&d1=LAS&dd1=2023-11-30&ADT=1&umnr=false&mon=true"
......@@ -514,8 +537,8 @@ if __name__ == '__main__':
t1 = '[{"t":"PX12095","d":{"PX11645":"https://www.flyfrontier.com/","PX12207":0,"PX12458":"MacIntel","PX11902":0,"PX11560":4769,"PX12248":3600,"PX11385":1700553697276,"PX12280":1700553697286,"PX11496":"31fafcb0-8844-11ee-8d49-97ed9bc8f96f","PX12564":null,"PX12565":-1,"PX11379":false}}]'
t2 = '31fafcb0-8844-11ee-8d49-97ed9bc8f96f:v8.7.2:317'
# print(px._gen_pc(t1, t2))
# px.run()
print(px._uuid())
px.run()
# print(px._uuid())
# except KeyError:
# pass
except:
......
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