- tools/scripts/llm-key-hunter: GitHub leak hunting pipeline (hunt_*, pivot miner, two-layer verify/content caches, per-provider verification) - usable_keys: verified key vault across 12 providers (deepseek, minimax, volcanoark, longcat, codingplan, zhipu free-tier, mimo, siliconflow, etc.) - .grok/skills/llm-key-hunter: operator skill for the hunt/verify/vault flow - NewAPI channel import scripts and CDP capture helpers - Result verdict buckets (excluding multi-GB blob caches and dedup dumps)
56 lines
2.0 KiB
Python
56 lines
2.0 KiB
Python
#!/usr/bin/env python3
|
|
"""Find a CN HTTP proxy that can reach api.openai.com."""
|
|
import urllib.request, threading, re
|
|
from pathlib import Path
|
|
from concurrent.futures import ThreadPoolExecutor, as_completed
|
|
|
|
PROXIES_FILE = Path(__file__).parent / "results/proxies/elite.txt"
|
|
TARGET = "https://api.openai.com/v1/models"
|
|
|
|
def parse_line(line):
|
|
# format: ip:portlatencyms[elite?]
|
|
m = re.match(r"(\d+\.\d+\.\d+\.\d+:\d+)", line.strip())
|
|
return m.group(1) if m else None
|
|
|
|
def test(px):
|
|
proxy = urllib.request.ProxyHandler({"http": f"http://{px}", "https": f"http://{px}"})
|
|
opener = urllib.request.build_opener(proxy)
|
|
opener.addheaders = [
|
|
("User-Agent", "curl/8.5.0"),
|
|
("Authorization", "Bearer sk-invalid-test"),
|
|
]
|
|
try:
|
|
r = opener.open(TARGET, timeout=12)
|
|
return px, r.getcode(), None
|
|
except urllib.error.HTTPError as e:
|
|
# 401 means we reached OpenAI — that's a WIN
|
|
return px, e.code, None
|
|
except Exception as e:
|
|
return px, 0, f"{type(e).__name__}: {str(e)[:80]}"
|
|
|
|
def main():
|
|
px_list = []
|
|
for line in PROXIES_FILE.read_text().splitlines():
|
|
p = parse_line(line)
|
|
if p: px_list.append(p)
|
|
print(f"testing {len(px_list)} proxies for OpenAI reachability...", flush=True)
|
|
|
|
hits = []
|
|
with ThreadPoolExecutor(max_workers=40) as pool:
|
|
futs = [pool.submit(test, p) for p in px_list]
|
|
for f in as_completed(futs):
|
|
px, code, err = f.result()
|
|
if code in (200, 401, 403, 400, 429, 404):
|
|
hits.append((px, code))
|
|
print(f" ✓ {px} -> HTTP {code}", flush=True)
|
|
print(f"\n{len(hits)} proxies reached OpenAI:")
|
|
for px, code in hits:
|
|
print(f" http://{px} ({code})")
|
|
# save best list
|
|
out = Path(__file__).parent / "results/proxies/openai_capable.txt"
|
|
out.write_text("\n".join(f"http://{px}" for px, _ in hits) + "\n")
|
|
print(f"saved -> {out}")
|
|
|
|
if __name__ == "__main__":
|
|
main()
|