docs+scripts: model matrix with prices, email rules, IPv6 egress rotation (pxserve + wave runner)

This commit is contained in:
reform
2026-11-22 15:39:31 +02:00
parent 43189c1ed8
commit 714231485b
3 changed files with 180 additions and 4 deletions
+27
View File
@@ -0,0 +1,27 @@
#!/bin/bash
# Параллельная волна по IPv6-адресам kf-x1: 3 воркера, каждый адрес = свой pxserve + 2 аккаунта.
cd "$(dirname "$0")/.." || exit 1
PY=C:/Users/User/AppData/Local/Programs/Python/Python311/python.exe
K=C:/Users/User/.ssh/id_ed25519
SSH="ssh -o BatchMode=yes -o StrictHostKeyChecking=no -o ConnectTimeout=12 -i $K root@31.77.251.176"
START=${1:-16}
END=${2:-60}
WORKERS=${3:-3}
LOG=ipv6_wave.log
worker() {
w=$1
for i in $(seq $START $END); do
[ $((i % WORKERS)) -ne $w ] && continue
port=$((8910+i))
$SSH "ip -6 addr add 2a0c:b641:614:15::$i/64 dev eth0 nodad 2>/dev/null; nohup python3 /root/pxserve.py $port '' '2a0c:b641:614:15::$i' '<твой.внешний.ip>' >/root/pxr$i.log 2>&1 &" >/dev/null 2>&1
sleep 2
echo "=== ::$i порт $port w$w $(date +%H:%M) ===" >> $LOG
timeout 420 env -u PYTHONPATH PYTHONIOENCODING=utf-8 $PY ul_bigwave.py "http://31.77.251.176:$port" --new=2 --deadline=380 --norec 2>&1 \
| grep -E "signup:|KEY ok|ИТОГО|limit" | tail -6 >> $LOG
done
}
for w in $(seq 0 $((WORKERS-1))); do worker $w & done
wait
echo "DONE $(date +%H:%M)" >> $LOG
+106
View File
@@ -0,0 +1,106 @@
#!/usr/bin/env python3
"""Мини-CONNECT-прокси для egress-боксов: HTTP CONNECT без MITM + Basic-auth + опциональный bind source IP.
Запуск: python3 pxserve.py <port> <user:pass> [source_ip]
"""
import base64
import os
import socket
import sys
import threading
PORT = int(sys.argv[1]) if len(sys.argv) > 1 else 8899
AUTH = sys.argv[2] if len(sys.argv) > 2 else ""
SRC = sys.argv[3] if len(sys.argv) > 3 else ""
ALLOW = set((sys.argv[4] if len(sys.argv) > 4 else "").split(",")) - {""}
NEED = "Basic " + base64.b64encode(AUTH.encode()).decode() if AUTH else ""
def pipe(a, b):
try:
while True:
d = a.recv(65536)
if not d:
break
b.sendall(d)
except Exception:
pass
finally:
for s in (a, b):
try:
s.shutdown(socket.SHUT_RDWR)
except Exception:
pass
try:
s.close()
except Exception:
pass
def handle(c):
try:
if ALLOW and c.getpeername()[0] not in ALLOW:
c.close(); return
c.settimeout(30)
buf = b""
while b"\r\n\r\n" not in buf:
d = c.recv(4096)
if not d:
return
buf += d
head = buf.split(b"\r\n\r\n")[0].decode("latin1")
lines = head.split("\r\n")
parts = lines[0].split()
if len(parts) < 2:
return
method, target = parts[0], parts[1]
hdrs = {}
for l in lines[1:]:
if ":" in l:
k, v = l.split(":", 1)
hdrs[k.strip().lower()] = v.strip()
if NEED and hdrs.get("proxy-authorization", "") != NEED:
c.sendall(b"HTTP/1.1 407 Proxy Authentication Required\r\nProxy-Authenticate: Basic\r\nContent-Length: 0\r\n\r\n")
return
if method != "CONNECT":
c.sendall(b"HTTP/1.1 405 Method Not Allowed\r\nContent-Length: 0\r\n\r\n")
return
host, _, port = target.rpartition(":")
port = int(port)
host = host.strip("[]")
fam = socket.AF_INET6 if ":" in SRC else socket.AF_INET
infos = socket.getaddrinfo(host, port, fam, socket.SOCK_STREAM)
if not infos:
raise OSError("no addr family match")
af, st, pr, cn, sa = infos[0]
s = socket.socket(af, st, pr)
s.settimeout(30)
if SRC:
s.bind((SRC, 0))
s.connect(sa)
s.settimeout(None)
c.sendall(b"HTTP/1.1 200 Connection Established\r\n\r\n")
c.settimeout(None)
threading.Thread(target=pipe, args=(c, s), daemon=True).start()
threading.Thread(target=pipe, args=(s, c), daemon=True).start()
except Exception:
try:
c.close()
except Exception:
pass
def main():
srv = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
srv.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
srv.bind(("0.0.0.0", PORT))
srv.listen(128)
print("pxserve on %d auth=%s src=%s" % (PORT, bool(AUTH), SRC or "-"), flush=True)
while True:
c, _ = srv.accept()
threading.Thread(target=handle, args=(c,), daemon=True).start()
if __name__ == "__main__":
main()