Commit 2d7eaa35 authored by wang's avatar wang

1

parents
Pipeline #448 canceled with stages
### Python template
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
.idea
node_modules/
# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/
# Translations
*.mo
*.pot
# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal
# Flask stuff:
instance/
.webassets-cache
# Scrapy stuff:
.scrapy
# Sphinx documentation
docs/_build/
# PyBuilder
.pybuilder/
target/
# Jupyter Notebook
.ipynb_checkpoints
# IPython
profile_default/
ipython_config.py
# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version
# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock
# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock
# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/#use-with-ide
.pdm.toml
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/
# Celery stuff
celerybeat-schedule
celerybeat.pid
# SageMath parsed files
*.sage.py
# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
# Spyder project settings
.spyderproject
.spyproject
# Rope project settings
.ropeproject
# mkdocs documentation
/site
# mypy
.mypy_cache/
.dmypy.json
dmypy.json
# Pyre type checker
.pyre/
# pytype static type analyzer
.pytype/
# Cython debug symbols
cython_debug/
# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
This diff is collapsed.
Copyright (c) 2010 Elijah Insua
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
This diff is collapsed.
{
"name": "jsdom",
"version": "17.0.0",
"description": "A JavaScript implementation of many web standards",
"keywords": [
"dom",
"html",
"whatwg",
"w3c"
],
"maintainers": [
"Elijah Insua <tmpvar@gmail.com> (http://tmpvar.com)",
"Domenic Denicola <d@domenic.me> (https://domenic.me/)",
"Sebastian Mayr <sebmaster16@gmail.com> (https://blog.smayr.name/)",
"Joris van der Wel <joris@jorisvanderwel.com>",
"Timothy Gu <timothygu99@gmail.com> (https://timothygu.me/)",
"Magne Andersson <code@zirro.se> (https://zirro.se/)",
"Pierre-Marie Dartus <dartus.pierremarie@gmail.com>"
],
"license": "MIT",
"repository": "jsdom/jsdom",
"dependencies": {
"abab": "^2.0.5",
"acorn": "^8.4.1",
"acorn-globals": "^6.0.0",
"cssom": "^0.5.0",
"cssstyle": "^2.3.0",
"data-urls": "^3.0.0",
"decimal.js": "^10.3.1",
"domexception": "^2.0.1",
"escodegen": "^2.0.0",
"form-data": "^4.0.0",
"html-encoding-sniffer": "^2.0.1",
"http-proxy-agent": "^4.0.1",
"https-proxy-agent": "^5.0.0",
"is-potential-custom-element-name": "^1.0.1",
"nwsapi": "^2.2.0",
"parse5": "6.0.1",
"saxes": "^5.0.1",
"symbol-tree": "^3.2.4",
"tough-cookie": "^4.0.0",
"w3c-hr-time": "^1.0.2",
"w3c-xmlserializer": "^2.0.0",
"webidl-conversions": "^6.1.0",
"whatwg-encoding": "^1.0.5",
"whatwg-mimetype": "^2.3.0",
"whatwg-url": "^9.0.0",
"ws": "^8.0.0",
"xml-name-validator": "^3.0.0"
},
"_dependenciesComments": {
"parse5": "Pinned to exact version number because we monkeypatch its internals (see htmltodom.js)"
},
"peerDependencies": {
"canvas": "^2.5.0"
},
"peerDependenciesMeta": {
"canvas": {
"optional": true
}
},
"devDependencies": {
"@domenic/eslint-config": "^1.2.0",
"benchmark": "^2.1.4",
"browserify": "^17.0.0",
"chai": "^4.3.4",
"eslint": "^7.32.0",
"eslint-plugin-html": "^6.1.2",
"eslint-plugin-jsdom-internal": "link:./scripts/eslint-plugin",
"js-yaml": "^4.1.0",
"karma": "^6.3.4",
"karma-browserify": "^8.1.0",
"karma-chrome-launcher": "^3.1.0",
"karma-mocha": "^2.0.1",
"karma-mocha-webworker": "^1.3.0",
"minimatch": "^3.0.4",
"mocha": "^9.0.3",
"mocha-sugar-free": "^1.4.0",
"pngjs": "^6.0.0",
"rimraf": "^3.0.2",
"server-destroy": "^1.0.1",
"watchify": "^4.0.0",
"webidl2js": "^16.2.0",
"yargs": "^17.0.1"
},
"browser": {
"canvas": false,
"vm": "./lib/jsdom/vm-shim.js",
"./lib/jsdom/living/websockets/WebSocket-impl.js": "./lib/jsdom/living/websockets/WebSocket-impl-browser.js"
},
"scripts": {
"prepare": "yarn convert-idl && yarn generate-js-globals",
"pretest": "yarn prepare && yarn init-wpt",
"test-wpt": "mocha test/web-platform-tests/run-wpts.js",
"test-tuwpt": "mocha test/web-platform-tests/run-tuwpts.js",
"test-mocha": "mocha",
"test-api": "mocha test/api",
"test": "mocha test/index.js",
"test-browser-iframe": "karma start test/karma.conf.js",
"test-browser-worker": "karma start test/karma-webworker.conf.js",
"test-browser": "yarn test-browser-iframe && yarn test-browser-worker",
"lint": "eslint . --cache --ext .js,.html",
"init-wpt": "git submodule update --init --recursive",
"reset-wpt": "rimraf ./test/web-platform-tests/tests && yarn init-wpt",
"update-wpt": "git submodule update --recursive --remote && cd test/web-platform-tests/tests && python3 wpt.py manifest --path ../wpt-manifest.json",
"update-authors": "git log --format=\"%aN <%aE>\" | sort -f | uniq > AUTHORS.txt",
"benchmark": "node ./benchmark/runner",
"benchmark-browser": "node ./benchmark/runner --bundle",
"convert-idl": "node ./scripts/webidl/convert.js",
"generate-js-globals": "node ./scripts/generate-js-globals.js"
},
"main": "./lib/api.js",
"engines": {
"node": ">=12"
}
}
import json
import os
import time
import uuid
from concurrent.futures import ThreadPoolExecutor, wait, ALL_COMPLETED
import tls_client
import logging
import traceback
from threading import Thread
import requests
from reese84_bypass import Reese84ByPass
import pathlib
root_logger = logging.getLogger()
root_logger.setLevel(logging.WARNING)
root_logger.handlers = []
if not pathlib.Path('nacos-data/snapshot/').exists():
pathlib.Path('nacos-data/snapshot/').mkdir(parents=True)
def get_proxy():
get_proxy_url = 'http://ymx-lcc.unififi.com/proxy/get-proxy'
r = requests.post(get_proxy_url, json={
'name': 'Y4',
'type':'shopping'
})
return r.json()
def add_header(cookies: dict, px: str, thread_id=0):
headers = {
"Host": "www.allegiantair.com",
"pragma": "no-cache",
"cache-control": "no-cache",
"sec-ch-ua": "\"Not.A/Brand\";v=\"8\", \"Chromium\";v=\"114\", \"Google Chrome\";v=\"114\"",
"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/114.0.0.0 Safari/537.36",
"content-type": "application/json",
"accept": "*/*",
"x-apollo-operation-name": "flights",
"sec-ch-ua-platform": "\"macOS\"",
"origin": "https://www.allegiantair.com",
"sec-fetch-site": "same-origin",
"sec-fetch-mode": "cors",
"sec-fetch-dest": "empty",
"accept-language": "en-US,en;q=0.9,zh-CN;q=0.8,zh;q=0.7"
}
cks = []
for k, v in cookies.items():
cks.append(f'{k}={v}')
headers['cookie'] = '; '.join(cks)
data = {
"brush_fromdate": "2023-06-19",
"brush_fromto": "BOS-JFK",
"brush_header": headers,
"brush_name": f"rever_{thread_id}",
"brush_proxy": px,
"brush_type": "cookieY4"
}
r = requests.post("http://ymx-lcc.unififi.com/header/add", json=data)
print(r.json())
def exec(thread_id):
id_ = uuid.uuid4().hex
try:
px = get_proxy()['url']
cf = Reese84ByPass(target="https://www.allegiantair.com/", proxy=px, thread_name=thread_id)
cookies = cf.start()
# cf.test()
add_header(cookies, px, thread_id)
# except json.decoder.JSONDecodeError:
# print('json huoqu shibai ')
except Exception as e:
print(e)
traceback.print_exc()
def run():
brush_thread = 3
while True:
print(f'本次并发数 {brush_thread}')
# pool = ThreadPoolExecutor(max_workers=brush_thread)
# all_task = [pool.submit(exec, (i)) for i in range(brush_group)]
# brush_check = CONFIG['internal']['reverse']['making']['brush_check']
# wait(all_task, return_when=ALL_COMPLETED)
# print(f'休息 {brush_check} 秒')
# time.sleep(brush_check)
with ThreadPoolExecutor(max_workers=brush_thread) as executor:
objs = []
for t in range(1, brush_thread + 1):
task = executor.submit(exec, t)
objs.append(task)
while 1:
time.sleep(1)
for n, o in enumerate(objs):
if o.done():
task = executor.submit(exec, n + 1)
objs[n] = task
if __name__ == '__main__':
run()
This diff is collapsed.
{
"name": "shape-bypass",
"version": "1.0.0",
"description": "",
"main": "ast.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"@babel/core": "^7.22.10",
"abab": "^2.0.5",
"acorn": "^8.4.1",
"acorn-globals": "^6.0.0",
"canvas": "^2.11.2",
"cssom": "^0.5.0",
"cssstyle": "^2.3.0",
"data-urls": "^3.0.0",
"decimal.js": "^10.3.1",
"domexception": "^2.0.1",
"escodegen": "^2.0.0",
"express": "^4.18.2",
"fingerprint-generator": "^2.1.37",
"form-data": "^4.0.0",
"ghost-cursor": "^1.1.18",
"html-encoding-sniffer": "^2.0.1",
"http-proxy-agent": "^4.0.1",
"https-proxy-agent": "^5.0.0",
"is-potential-custom-element-name": "^1.0.1",
"nwsapi": "^2.2.0",
"parse5": "6.0.1",
"saxes": "^5.0.1",
"symbol-tree": "^3.2.4",
"tough-cookie": "^4.0.0",
"w3c-hr-time": "^1.0.2",
"w3c-xmlserializer": "^2.0.0",
"webidl-conversions": "^6.1.0",
"whatwg-encoding": "^1.0.5",
"whatwg-mimetype": "^2.3.0",
"whatwg-url": "^9.0.0",
"ws": "^8.0.0",
"xml-name-validator": "^3.0.0"
}
}
import json
import platform
import subprocess
import time
from pathlib import Path
import tls_client
from loguru import logger
req_level = logger.level('REQU', no=100, color='<fg 34>')
js_level = logger.level('VMJS', no=100, color='<fg 185>')
work_dir = '/data/log/lcc-y4/'
if platform.platform().startswith('mac'):
work_dir = '/Users/wang/Documents/company/lcc-y4/'
class Reese84ByPass(object):
__session = tls_client.Session('chrome_112')
def __init__(self, target, proxy, thread_name='test'):
self.__target = target
if proxy != '':
self.__session.proxies = {
'http': proxy,
'https': proxy,
}
Path(work_dir).joinpath(thread_name).mkdir(exist_ok=True, parents=True)
self.log = logger.bind(module_name=thread_name)
self.log.info(f'proxy:{proxy} target:{target}')
def start(self):
self._init()
self._repare_js()
self.__auth_token()
self.__get_session_token()
return self._get_cookie()
def _init(self):
t1 = time.time()
url = "https://www.volaris.com/flight"
response = self.__session.get(url, headers={
"Host": "www.volaris.com",
"pragma": "no-cache",
"cache-control": "no-cache",
"sec-ch-ua-mobile": "?0",
"sec-ch-ua-platform": "\"macOS\"",
"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",
"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",
"sec-fetch-site": "none",
"sec-fetch-mode": "navigate",
"sec-fetch-user": "?1",
"sec-fetch-dest": "document",
"accept-language": "en-US,en;q=0.9,zh-CN;q=0.8,zh;q=0.7,ru;q=0.6"
})
self.log.log('REQU', f'initUrl: code:{response.status_code} cost:{(time.time() - t1):.3f}s')
def _repare_js(self):
t1 = time.time()
r1 = self.__session.get('https://www.volaris.com/Germand-and-haue-lent-Layest-Lord-former-Guill-m')
self.log.log('REQU', f'JSURL: code:{r1.status_code} cost:{(time.time() - t1):.3f}s')
envCode = open('run.js', 'r').read()
with open('vm_env.js', 'w') as f:
f.write(envCode + r1.text)
t2 = time.time()
p = subprocess.Popen(['node', f'vm_env.js'], stdin=subprocess.PIPE, stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
output, err = p.communicate(timeout=10)
if p.returncode == 0:
datas = output.decode().split('\n')
else:
raise Exception("执行 JS 超时")
self.log.log('VMJS', f'执行JS: cost:{(time.time() - t2):.3f}s')
try:
data = json.loads(datas[-2])
except:
data = json.loads(datas[-1])
# print(len(data['solution']['interrogation']['p']))
t3 = time.time()
url = "https://www.volaris.com/Germand-and-haue-lent-Layest-Lord-former-Guill-m?d=www.volaris.com"
response = self.__session.post(url, headers={
"Host": "www.volaris.com",
"pragma": "no-cache",
"cache-control": "no-cache",
"sec-ch-ua": "\"Not/A)Brand\";v=\"99\", \"Google Chrome\";v=\"115\", \"Chromium\";v=\"115\"",
"accept": "application/json; charset=utf-8",
"content-type": "text/plain; charset=utf-8",
"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/115.0.0.0 Safari/537.36",
"sec-ch-ua-platform": "\"macOS\"",
"origin": "https://www.volaris.com",
"sec-fetch-site": "same-origin",
"sec-fetch-mode": "cors",
"sec-fetch-dest": "empty",
"referer": "https://www.volaris.com/flight",
"accept-language": "en-US,en;q=0.9,zh-CN;q=0.8,zh;q=0.7,ru;q=0.6"
}, json=data)
self.log.log('REQU', f'JSURL: code:{response.status_code} cost:{(time.time() - t3):.3f}s')
assert response.json().get('return', False) != True, BaseException("js提交出错")
self.__session.cookies.update({
'reese84': response.json()['token']
})
def __auth_token(self):
t1 = time.time()
url = "https://www.volaris.com/assets/config/volarisAppConfig.json"
response = self.__session.get(url, headers={
"Host": "www.volaris.com",
"pragma": "no-cache",
"cache-control": "no-cache",
"sec-ch-ua": "\"Not/A)Brand\";v=\"99\", \"Google Chrome\";v=\"115\", \"Chromium\";v=\"115\"",
"accept": "*/*",
"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/115.0.0.0 Safari/537.36",
"sec-ch-ua-platform": "\"macOS\"",
"sec-fetch-site": "same-origin",
"sec-fetch-mode": "cors",
"sec-fetch-dest": "empty",
"referer": "https://www.volaris.com/",
"accept-language": "en-US,en;q=0.9,zh-CN;q=0.8,zh;q=0.7,ru;q=0.6"
})
self.auth_token = f"{response.headers.get('Travel')}.{response.headers.get('Origin')}.{response.headers.get('Destination')}"
self.log.log('REQU', f'appConfig: code:{response.status_code} cost:{(time.time() - t1):.3f}s')
def __get_session_token(self):
t1 = time.time()
headers = {
"Host": "apigw.volaris.com",
"Pragma": "no-cache",
"Cache-Control": "no-cache",
"sec-ch-ua": "\"Not/A)Brand\";v=\"99\", \"Google Chrome\";v=\"115\", \"Chromium\";v=\"115\"",
"Accept": "application/json",
"cookies": f"Bearer {self.auth_token}",
"Content-Type": "application/json",
"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/115.0.0.0 Safari/537.36",
"sec-ch-ua-platform": "\"macOS\"",
"Origin": "https://www.volaris.com",
"Sec-Fetch-Site": "same-site",
"Sec-Fetch-Mode": "cors",
"Sec-Fetch-Dest": "empty",
"Referer": "https://www.volaris.com/",
"Accept-Language": "en-US,en;q=0.9,zh-CN;q=0.8,zh;q=0.7,ru;q=0.6"
}
url = "https://apigw.volaris.com/prod/api/session"
response = self.__session.get(url, headers=headers)
self.token = response.json()['token']
def _get_cookie(self):
return {
"Host": "apigw.volaris.com",
"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/115.0.0.0 Safari/537.36",
"Content-Type": "application/json",
"Authorization": self.token,
"cookies": f"Bearer {self.auth_token}",
"Accept": "application/json",
"sec-ch-ua-platform": "\"macOS\"",
"Origin": "https://www.volaris.com",
"Referer": "https://www.volaris.com/",
"Accept-Language": "en-US,en;q=0.9,zh-CN;q=0.8,zh;q=0.7,ru;q=0.6",
"cookie": self.__session.cookies.get_dict()
}
if __name__ == '__main__':
r = Reese84ByPass('https://www.volaris.com/', '')
print(r.start())
This diff is collapsed.
This diff is collapsed.
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