autoreg-skills-max: initial public release (restored, redacted, hardened)
This commit is contained in:
194
skills/github-autoreg/templates/reg.py
Normal file
194
skills/github-autoreg/templates/reg.py
Normal file
@@ -0,0 +1,194 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
GitHub AutoReg — mass registration via persistent Chrome profile + .de IMAP
|
||||
Usage: python reg.py --count 10 --emails mails.txt
|
||||
"""
|
||||
import asyncio, json, random, string, sys, time, traceback, imaplib, ssl, re
|
||||
from pathlib import Path
|
||||
from argparse import ArgumentParser
|
||||
|
||||
# === CONFIG ===
|
||||
DEFAULT_EMAILS = r"C:\Users\User\Desktop\_ARCHIVE_CANDIDATES\Downloads_backup_01.07.2026\working_mails_RECOVERED.txt"
|
||||
CHROME_PROFILE = r"C:\Users\User\gh_work\chrome_profile"
|
||||
OUTPUT_FILE = Path("accounts.txt")
|
||||
STATE_FILE = Path("state.json")
|
||||
GITHUB_SIGNUP = "https://github.com/signup"
|
||||
DELAY_MIN, DELAY_MAX = 120, 300
|
||||
|
||||
IMAP_SERVERS = {
|
||||
't-online.de': ('imap.t-online.de', 993),
|
||||
'web.de': ('imap.web.de', 993),
|
||||
'gmx.de': ('imap.gmx.net', 993),
|
||||
}
|
||||
|
||||
|
||||
def load_emails(filepath):
|
||||
emails, seen = [], set()
|
||||
with open(filepath, 'r', encoding='utf-8', errors='ignore') as f:
|
||||
for line in f:
|
||||
if ':' not in line: continue
|
||||
email, pw = line.strip().split(':', 1)
|
||||
email = email.strip().strip('"').strip("'").strip('`')
|
||||
pw = pw.strip().strip('"').strip("'")
|
||||
if email in seen: continue
|
||||
seen.add(email)
|
||||
if any(d in email.lower() for d in ['@t-online.de', '@web.de', '@gmx.de']):
|
||||
emails.append((email, pw))
|
||||
return emails
|
||||
|
||||
|
||||
def check_imap(email, pw):
|
||||
domain = email.split('@')[1].lower()
|
||||
server, port = IMAP_SERVERS.get(domain, (None, None))
|
||||
if not server: return False
|
||||
ctx = ssl.create_default_context()
|
||||
ctx.check_hostname = False; ctx.verify_mode = ssl.CERT_NONE
|
||||
try:
|
||||
mail = imaplib.IMAP4_SSL(server, port, ssl_context=ctx, timeout=10)
|
||||
mail.login(email, pw); mail.logout()
|
||||
return True
|
||||
except: return False
|
||||
|
||||
|
||||
def get_code(email, pw, timeout=120):
|
||||
domain = email.split('@')[1].lower()
|
||||
server, port = IMAP_SERVERS.get(domain, (None, None))
|
||||
if not server: return None
|
||||
ctx = ssl.create_default_context()
|
||||
ctx.check_hostname = False; ctx.verify_mode = ssl.CERT_NONE
|
||||
start = time.time()
|
||||
while time.time() - start < timeout:
|
||||
try:
|
||||
mail = imaplib.IMAP4_SSL(server, port, ssl_context=ctx, timeout=10)
|
||||
mail.login(email, pw); mail.select('INBOX'); mail.noop()
|
||||
status, data = mail.search(None, '(FROM "noreply@github.com" UNSEEN)')
|
||||
if status == 'OK' and data[0]:
|
||||
for msg_id in reversed(data[0].split()):
|
||||
status, msg_data = mail.fetch(msg_id, '(RFC822)')
|
||||
if status == 'OK':
|
||||
body = msg_data[0][1].decode('utf-8', errors='ignore')
|
||||
codes = re.findall(r'\b(\d{6,8})\b', body)
|
||||
if codes: mail.logout(); return codes[0]
|
||||
mail.logout()
|
||||
except: pass
|
||||
time.sleep(5)
|
||||
return None
|
||||
|
||||
|
||||
async def reg_one(email, email_pw):
|
||||
from playwright.async_api import async_playwright
|
||||
username = f"{email.split('@')[0][:20]}-{random.randint(100,9999)}"
|
||||
gh_pw = ''.join(random.choice(string.ascii_letters + string.digits + "!@#$%^&*") for _ in range(16))
|
||||
|
||||
p = await async_playwright().start()
|
||||
ctx = await p.chromium.launch_persistent_context(
|
||||
CHROME_PROFILE, headless=False,
|
||||
args=["--disable-blink-features=AutomationControlled", "--no-sandbox"],
|
||||
viewport={"width": 1280, "height": 900},
|
||||
user_agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 Chrome/[REDACTED-IP] Safari/537.36")
|
||||
await ctx.add_init_script("Object.defineProperty(navigator,'webdriver',{get:()=>false});delete navigator.__proto__.webdriver;window.chrome={runtime:{}};")
|
||||
page = await ctx.new_page()
|
||||
|
||||
try:
|
||||
await page.goto(GITHUB_SIGNUP, wait_until="networkidle", timeout=30000)
|
||||
await page.wait_for_timeout(3000)
|
||||
await page.evaluate("document.querySelectorAll('.flash-close,[aria-label=\"Dismiss\"]').forEach(e=>e.click());document.querySelectorAll('.flash').forEach(e=>e.remove());")
|
||||
await page.wait_for_timeout(1000)
|
||||
|
||||
print(f" [*] {email} → {username}")
|
||||
await page.evaluate("""
|
||||
(d) => {
|
||||
const setV = (s,v) => { const e=document.querySelector(s); if(e){e.value=v;e.dispatchEvent(new Event('input',{bubbles:true}));e.dispatchEvent(new Event('change',{bubbles:true}));} };
|
||||
setV('input[type="email"]',d.email); setV('input[name="user[email]"]',d.email);
|
||||
setV('input[type="password"]',d.pw); setV('input[name="user[password]"]',d.pw);
|
||||
setV('input[name="user[login]"]',d.user);
|
||||
}
|
||||
""", {"email":email, "pw":gh_pw, "user":username})
|
||||
await page.wait_for_timeout(2000)
|
||||
|
||||
try:
|
||||
btn = await page.wait_for_selector('button:has-text("Create account")', timeout=5000)
|
||||
await btn.evaluate("e=>e.disabled=false"); await page.wait_for_timeout(500)
|
||||
await btn.click(force=True)
|
||||
except:
|
||||
await page.evaluate("const f=document.querySelector('form');if(f){f.removeAttribute('novalidate');f.requestSubmit?f.requestSubmit():f.submit();}")
|
||||
|
||||
await page.wait_for_timeout(5000)
|
||||
url = page.url
|
||||
|
||||
if "account_verifications" in url or "verify" in url.lower():
|
||||
print(" [*] Waiting for code...")
|
||||
code = get_code(email, email_pw, 120)
|
||||
if not code: print(" [!] No code"); return None
|
||||
print(f" [*] Code: {code}")
|
||||
|
||||
filled = False
|
||||
for sel in ['input[inputmode="numeric"]','input[type="text"]','input[name="verification_code"]','input[autocomplete="one-time-code"]']:
|
||||
try:
|
||||
digits = await page.query_selector_all(sel)
|
||||
if len(digits) >= 6:
|
||||
for i,d in enumerate(code[:len(digits)]): await digits[i].fill(d)
|
||||
filled = True; break
|
||||
elif len(digits) == 1: await digits[0].fill(code); filled = True; break
|
||||
except: continue
|
||||
if not filled: await page.keyboard.type(code, delay=50)
|
||||
|
||||
await page.wait_for_timeout(3000)
|
||||
url = page.url
|
||||
|
||||
if "signup" not in url.lower() and "join" not in url.lower() and "account_verifications" not in url.lower() and "verify" not in url.lower() and "github.com" in url:
|
||||
print(f" [OK] {username}")
|
||||
return {"email":email, "email_pw":email_pw, "username":username, "gh_pw":gh_pw, "time":time.strftime("%Y-%m-%d %H:%M:%S")}
|
||||
else:
|
||||
body = await page.evaluate("()=>document.body.innerText[:200]")
|
||||
print(f" [X] {url[:100]} | {body}")
|
||||
return None
|
||||
except Exception as e:
|
||||
print(f" [X] {e}"); traceback.print_exc(); return None
|
||||
finally:
|
||||
await ctx.close(); await p.stop()
|
||||
|
||||
|
||||
async def main():
|
||||
p = ArgumentParser(description="GitHub AutoReg")
|
||||
p.add_argument("--count", type=int, default=10)
|
||||
p.add_argument("--emails", default=DEFAULT_EMAILS)
|
||||
p.add_argument("--delay-min", type=int, default=DELAY_MIN)
|
||||
p.add_argument("--delay-max", type=int, default=DELAY_MAX)
|
||||
args = p.parse_args()
|
||||
|
||||
emails = load_emails(args.emails)
|
||||
print(f"[*] {len(emails)} .de emails")
|
||||
|
||||
state = json.loads(STATE_FILE.read_text()) if STATE_FILE.exists() else {"processed":[], "accounts":[]}
|
||||
processed = set(state["processed"])
|
||||
emails = [(e,p) for e,p in emails if e not in processed]
|
||||
print(f"[*] {len(emails)} remaining")
|
||||
|
||||
if not emails: return print("[*] All done. Delete state.json to reset.")
|
||||
if not check_imap(emails[0][0], emails[0][1]):
|
||||
for e,p in emails[:10]:
|
||||
if check_imap(e,p): break
|
||||
else: return print("[X] No working IMAP")
|
||||
|
||||
ok = 0
|
||||
for i, (email, pw) in enumerate(emails):
|
||||
if i >= args.count: break
|
||||
print(f"\n--- {i+1}/{args.count} ---")
|
||||
r = await reg_one(email, pw)
|
||||
if r:
|
||||
ok += 1
|
||||
state["accounts"].append(r)
|
||||
with open(OUTPUT_FILE, 'a') as f:
|
||||
f.write(f"{r['email']}|{r['email_pw']}|{r['username']}|{r['gh_pw']}\n")
|
||||
print(f" [OK] Total: {ok}")
|
||||
state["processed"].append(email)
|
||||
STATE_FILE.write_text(json.dumps(state, indent=2))
|
||||
if i < min(args.count, len(emails)) - 1:
|
||||
d = random.uniform(args.delay_min, args.delay_max)
|
||||
print(f" [*] Wait {d:.0f}s..."); time.sleep(d)
|
||||
|
||||
print(f"\nDone! Created: {ok}/{args.count}")
|
||||
|
||||
if __name__ == "__main__":
|
||||
asyncio.run(main())
|
||||
149
skills/github-autoreg/templates/reg_mailtm.py
Normal file
149
skills/github-autoreg/templates/reg_mailtm.py
Normal file
@@ -0,0 +1,149 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
GitHub AutoReg — mail.tm version (temporary emails, no email list needed)
|
||||
|
||||
ИСПОЛЬЗОВАНИЕ:
|
||||
python reg_mailtm.py # 10 аккаунтов
|
||||
python reg_mailtm.py --count 50 # 50 аккаунтов
|
||||
"""
|
||||
|
||||
import asyncio, random, string, time, traceback, sys
|
||||
from pathlib import Path
|
||||
from argparse import ArgumentParser
|
||||
|
||||
# Add src to path
|
||||
sys.path.insert(0, str(Path(__file__).parent))
|
||||
|
||||
from src.mailtm_utils import create_email, wait_for_code
|
||||
from src.browser_utils import (
|
||||
create_context, fill_signup_form, dismiss_flash_alerts,
|
||||
click_create_account, fill_verification_code, is_success_url,
|
||||
GITHUB_SIGNUP,
|
||||
)
|
||||
|
||||
OUTPUT_FILE = Path("accounts.txt")
|
||||
MAX_ACCOUNTS = 10
|
||||
DELAY_MIN, DELAY_MAX = 120, 300
|
||||
|
||||
|
||||
def gen_password(length: int = 16) -> str:
|
||||
chars = string.ascii_letters + string.digits + "!@#$%^&*"
|
||||
return ''.join(random.choice(chars) for _ in range(length))
|
||||
|
||||
|
||||
def gen_username() -> str:
|
||||
prefixes = ["dev", "code", "web", "pro", "neo", "zen", "hex", "vox",
|
||||
"byte", "core", "edge", "node", "peak", "nova", "echo", "sigma"]
|
||||
return f"{random.choice(prefixes)}{random.randint(100, 9999)}"
|
||||
|
||||
|
||||
async def register_one() -> dict | None:
|
||||
"""Регистрация одного GitHub аккаунта через mail.tm"""
|
||||
# 1. Создаём временную почту
|
||||
print(" [*] Creating temp email...")
|
||||
mail = create_email()
|
||||
print(f" [*] Email: {mail['email']}")
|
||||
|
||||
username = gen_username()
|
||||
gh_password = gen_password()
|
||||
|
||||
from playwright.async_api import async_playwright
|
||||
p = await async_playwright().start()
|
||||
|
||||
try:
|
||||
ctx = await create_context(p)
|
||||
page = await ctx.new_page()
|
||||
|
||||
# 2. Загружаем signup
|
||||
await page.goto(GITHUB_SIGNUP, wait_until="networkidle", timeout=30000)
|
||||
await page.wait_for_timeout(3000)
|
||||
await dismiss_flash_alerts(page)
|
||||
|
||||
# 3. Заполняем форму
|
||||
print(f" [*] Username: {username}")
|
||||
await fill_signup_form(page, mail["email"], gh_password, username)
|
||||
|
||||
# 4. Submit
|
||||
print(" [*] Submit...")
|
||||
await click_create_account(page)
|
||||
await page.wait_for_timeout(5000)
|
||||
url = page.url
|
||||
|
||||
# 5. Ждём код
|
||||
if "account_verifications" in url or "verify" in url.lower():
|
||||
print(" [*] Waiting for code...")
|
||||
code = wait_for_code(mail["token"], timeout=120)
|
||||
|
||||
if not code:
|
||||
print(" [!] No code received")
|
||||
await page.screenshot(path=f"fail_{username}.png")
|
||||
return None
|
||||
|
||||
print(f" [*] Code: {code}")
|
||||
await fill_verification_code(page, code)
|
||||
await page.wait_for_timeout(3000)
|
||||
url = page.url
|
||||
|
||||
# 6. Проверяем
|
||||
if is_success_url(url):
|
||||
print(f" [OK] {username}")
|
||||
return {
|
||||
"email": mail["email"],
|
||||
"email_password": mail["password"],
|
||||
"username": username,
|
||||
"github_password": gh_password,
|
||||
"time": time.strftime("%Y-%m-%d %H:%M:%S"),
|
||||
}
|
||||
else:
|
||||
body = await page.evaluate("() => document.body.innerText[:300]")
|
||||
print(f" [X] Failed: {url[:100]} | {body[:100]}")
|
||||
await page.screenshot(path=f"fail_{username}.png")
|
||||
return None
|
||||
|
||||
except Exception as e:
|
||||
print(f" [X] {e}")
|
||||
traceback.print_exc()
|
||||
return None
|
||||
finally:
|
||||
await ctx.close()
|
||||
await p.stop()
|
||||
|
||||
|
||||
async def main():
|
||||
parser = ArgumentParser(description="GitHub AutoReg — mail.tm version")
|
||||
parser.add_argument("--count", type=int, default=MAX_ACCOUNTS, help="Accounts to create")
|
||||
parser.add_argument("--delay-min", type=int, default=DELAY_MIN)
|
||||
parser.add_argument("--delay-max", type=int, default=DELAY_MAX)
|
||||
args = parser.parse_args()
|
||||
|
||||
print("=" * 60)
|
||||
print("GitHub AutoReg — mail.tm")
|
||||
print(f" Count: {args.count}")
|
||||
print(f" Delay: {args.delay_min}-{args.delay_max}s")
|
||||
print("=" * 60)
|
||||
|
||||
ok = 0
|
||||
for i in range(args.count):
|
||||
print(f"\n--- {i+1}/{args.count} ---")
|
||||
result = await register_one()
|
||||
|
||||
if result:
|
||||
ok += 1
|
||||
with open(OUTPUT_FILE, 'a', encoding='utf-8') as f:
|
||||
f.write(f"{result['email']}|{result['email_password']}|"
|
||||
f"{result['username']}|{result['github_password']}\n")
|
||||
print(f" [OK] Total: {ok}")
|
||||
|
||||
if i < args.count - 1:
|
||||
delay = random.uniform(args.delay_min, args.delay_max)
|
||||
print(f" [*] Wait {delay:.0f}s...")
|
||||
time.sleep(delay)
|
||||
|
||||
print(f"\n{'=' * 60}")
|
||||
print(f"Done! Created: {ok}/{args.count}")
|
||||
print(f"Accounts: {OUTPUT_FILE.absolute()}")
|
||||
print(f"{'=' * 60}")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
asyncio.run(main())
|
||||
96
skills/github-autoreg/templates/socks5_bridge.py
Normal file
96
skills/github-autoreg/templates/socks5_bridge.py
Normal file
@@ -0,0 +1,96 @@
|
||||
"""
|
||||
In-process SOCKS5 bridge for Playwright — stable, no external processes.
|
||||
Drop into any Playwright script that needs SOCKS5 proxy (Proxyshard.com, etc.)
|
||||
|
||||
Usage:
|
||||
bridge = SocksBridge(sid="your-sid-here")
|
||||
await bridge.start()
|
||||
browser = await p.chromium.launch(
|
||||
headless=False,
|
||||
proxy={'server': bridge.url}, # http://127.0.0.1:<random_port>
|
||||
)
|
||||
...
|
||||
bridge.close()
|
||||
"""
|
||||
import asyncio, struct, random
|
||||
|
||||
class SocksBridge:
|
||||
"""
|
||||
Async SOCKS5 → HTTP proxy bridge running in-process.
|
||||
Handles CONNECT tunneling. Auth: username/password (RFC 1929).
|
||||
"""
|
||||
def __init__(self, sid, socks_host="relay-eu.proxyshard.com", socks_port=1080,
|
||||
socks_pass="35qaexbj9fv8qjub", listen_port=None):
|
||||
self.sid = sid
|
||||
self.user = f"plan-premium-country-de-sid-{sid}-ttl-8000000"
|
||||
self.passwd = [REDACTED]
|
||||
self.socks_host = socks_host
|
||||
self.socks_port = socks_port
|
||||
self.lp = listen_port or random.randint(12000, 20000)
|
||||
self.srv = None
|
||||
|
||||
async def _connect(self, host, port):
|
||||
"""SOCKS5 handshake + CONNECT to target."""
|
||||
r, w = await asyncio.open_connection(self.socks_host, self.socks_port)
|
||||
# Greeting: SOCKS5 + 2 auth methods (noauth + user/pass)
|
||||
w.write(b'\x05\x02\x00\x02')
|
||||
await w.drain()
|
||||
resp = await r.readexactly(2)
|
||||
if resp[1] == 0x02:
|
||||
# Auth required
|
||||
ub = self.user.encode()
|
||||
pb = self.passwd.encode()
|
||||
w.write(b'\x01' + bytes([len(ub)]) + ub + bytes([len(pb)]) + pb)
|
||||
await w.drain()
|
||||
await r.readexactly(2)
|
||||
# CONNECT request
|
||||
hb = host.encode()
|
||||
w.write(b'\x05\x01\x00\x03' + bytes([len(hb)]) + hb + struct.pack('>H', port))
|
||||
await w.drain()
|
||||
await r.readexactly(10)
|
||||
return r, w
|
||||
|
||||
async def _handle(self, cr, cw):
|
||||
"""Handle one HTTP CONNECT client."""
|
||||
try:
|
||||
req = await cr.readuntil(b'\r\n\r\n')
|
||||
t = req.decode().split()[1]
|
||||
host, ps = t.split(':') if ':' in t else (t, '443')
|
||||
rr, rw = await self._connect(host, int(ps))
|
||||
cw.write(b'HTTP/1.0 200 Connection Established\r\n\r\n')
|
||||
await cw.drain()
|
||||
|
||||
async def relay(r1, w1):
|
||||
try:
|
||||
while True:
|
||||
d = await r1.read(65536)
|
||||
if not d:
|
||||
break
|
||||
w1.write(d)
|
||||
await w1.drain()
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
await asyncio.gather(relay(cr, rw), relay(rr, cw))
|
||||
except Exception:
|
||||
pass
|
||||
finally:
|
||||
try:
|
||||
cw.close()
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
async def start(self):
|
||||
"""Start listening. Returns port number."""
|
||||
self.srv = await asyncio.start_server(self._handle, '127.0.0.1', self.lp)
|
||||
return self.lp
|
||||
|
||||
@property
|
||||
def url(self):
|
||||
"""Proxy URL for Playwright proxy={'server': ...}."""
|
||||
return f"http://127.0.0.1:{self.lp}"
|
||||
|
||||
def close(self):
|
||||
"""Stop the bridge."""
|
||||
if self.srv:
|
||||
self.srv.close()
|
||||
Reference in New Issue
Block a user