more handler, unfinished excel dump, added proxy alternative

This commit is contained in:
ArkanDash
2025-03-03 20:14:51 +07:00
parent f269800704
commit 54bb351e5b
10 changed files with 837 additions and 12 deletions

39
proxy2.py Normal file
View File

@@ -0,0 +1,39 @@
from mitmproxy import ctx, http
from mitmproxy.proxy import layer
def load(loader):
ctx.options.connection_strategy = "lazy"
ctx.options.upstream_cert = False
ctx.options.ssl_insecure = True
ctx.options.allow_hosts = ['nova-static.yostar.cn', 'nova.yostar.cn', 'sdk-api.yostar.cn', 'static-stellasora.yostar.net', "udata-api.open.yostar.net"]
SERVER_HOST = "localhost"
SERVER_PORT = 5000
TARGET_HOSTS = [
"nova-static.yostar.cn",
"nova.yostar.cn",
"sdk-api.yostar.cn",
"static-stellasora.yostar.net",
"udata-api.open.yostar.net"
]
KILL_HOST_LIST = [
'log.aliyuncs.com',
'er.ns.aliyuncs.com',
'toy.log.nexon.io',
'm-api.nexon.com'
]
def request(flow: http.HTTPFlow) -> None:
if any(flow.request.pretty_host.endswith(host) for host in KILL_HOST_LIST):
flow.kill()
return
if flow.request.pretty_host in TARGET_HOSTS:
flow.request.scheme = 'http'
flow.request.host = SERVER_HOST
flow.request.port = SERVER_PORT
return
else:
flow.kill()
return