commit d19e383777f16a34c098b74777d2da3e7f528134 Author: reform Date: Sun Nov 1 03:36:34 2026 +0300 init diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..edc1eb8 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +*.jsonl +*.txt +__pycache__/ +.2cap_key +fbkey.txt diff --git a/README.md b/README.md new file mode 100644 index 0000000..484ba37 --- /dev/null +++ b/README.md @@ -0,0 +1,30 @@ +# eden-autoreg + +Autoreg harness for [Eden AI](https://edenai.co) - an aggregator claiming **$10 free credit** on signup. + +## Why this repo is only a harness +Eden protects `/signup` with an **invisible Cloudflare Turnstile** that never renders a visible widget and whose +sitekey is not in the JS bundle. It is only visible in the challenge iframe URL: + +``` +https://challenges.cloudflare.com/cdn-cgi/challenge-platform/h/g/turnstile/f/av0/rch/ukhqk//light/... +``` + +With the key extracted, the form can be solved by an external solver and injected into the React state by hooking +`window.turnstile.render` before the bundle evaluates it (see `eden_ts2.py`). + +## Files +* `eden_ts2.py` - Camoufox + `addInitScript` hook: replaces `turnstile.render` and feeds the solver token into + `opts.callback`, then fills first/last name, business email, password, accepts terms, submits, + reads the 6-digit code from IMAP and opens `/billing` to capture the real balance. +* `mail_read.py` - IMAP helper (code extraction + folder dump). + +## Env / args +``` +python eden_ts2.py +``` +IMAP host is `secureimap.t-online.de` by default; the token must be solved for `https://app.edenai.run/signup`. + +## Status +Signup blocked at server-side Turnstile validation until a token is injected; sitekey extraction verified. +Balance after success is read from the billing page, not from marketing copy. diff --git a/eden_ts2.py b/eden_ts2.py new file mode 100644 index 0000000..b999798 --- /dev/null +++ b/eden_ts2.py @@ -0,0 +1,102 @@ +import sys, json, time, re, imaplib, email, html +from email.header import decode_header +from camoufox.sync_api import Camoufox + +TOKEN = sys.argv[3] +user, pw = sys.argv[1], sys.argv[2] +HOOK = """ +Object.defineProperty(window, 'turnstile', { + configurable: true, + set(v) { + this.__t = v; + if (v && typeof v.render === 'function') { + v.render = function(el, opts) { + try { if (opts && opts.callback) opts.callback(window.__TSDONE || ''); } catch(e) {} + return 'tsok'; + }; + } + }, + get() { return this.__t; } +}); +window.__TSDONE = %s; +""" % json.dumps('') + +def rd(h): + if not h: return '' + o=[] + for p,e in decode_header(h): + o.append(p.decode(e or 'utf-8','replace') if isinstance(p,bytes) else p) + return ''.join(o) + +def body(msg): + t='' + if msg.is_multipart(): + for p in msg.walk(): + if p.get_content_type()=='text/plain': + try: t+=p.get_payload(decode=True).decode(p.get_content_charset() or 'utf-8','replace') + except Exception: pass + elif p.get_content_type()=='text/html' and not t: + try: t+=html.unescape(re.sub(r'<[^>]+>',' ',p.get_payload(decode=True).decode(p.get_content_charset() or 'utf-8','replace'))) + except Exception: pass + else: + try: t=msg.get_payload(decode=True).decode(msg.get_content_charset() or 'utf-8','replace') + except Exception: t=str(msg.get_payload()) + return t + +def wait_code(wait=150): + end=time.time()+wait + while True: + try: + M=imaplib.IMAP4_SSL('secureimap.t-online.de',993,timeout=25) + M.login(user,pw); M.select('INBOX') + _,d=M.search(None,'ALL'); ids=d[0].split()[-12:] + for i in reversed(ids): + _,x=M.fetch(i,'(RFC822)') + if not x or not isinstance(x[0],tuple): continue + m=email.message_from_bytes(x[0][1]); s=rd(m.get('Subject')); f=rd(m.get('From')) + if 'eden' not in (f+' '+s).lower(): continue + b=body(m); c=re.findall(r'\b(\d{6})\b',b) + M.logout(); return (c[0] if c else None), s[:80] + M.logout() + except Exception: pass + if time.time()>end: return None,'timeout' + time.sleep(8) + +passw='Ed3n!'+str(int(time.time()))[-6:] +res={'email':user,'pass':passw} +with Camoufox(headless=True, geoip=False, humanize=True, os=['windows']) as br: + pg=br.new_page() + pg.add_init_script(HOOK.replace('window.__TSDONE = ""', 'window.__TSDONE = %s' % json.dumps(TOKEN))) + pg.goto('https://app.edenai.run/signup', wait_until='domcontentloaded', timeout=70000) + pg.wait_for_timeout(6000) + pg.evaluate("() => {const b=[...document.querySelectorAll('button')].find(x=>/Accept all/i.test(x.innerText)); if(b) b.click()}") + pg.wait_for_timeout(600) + ins=[el for el in pg.query_selector_all('input') if el.get_attribute('type') not in ('checkbox','hidden')] + for el,v in zip(ins,['Nikita','Kalb',user,passw]): + try: el.fill(v) + except Exception: pass + pg.evaluate("() => {const l=[...document.querySelectorAll('label')].find(x=>/I agree/i.test(x.innerText)); if(l) l.click()}") + pg.wait_for_timeout(500) + pg.evaluate("() => {const b=[...document.querySelectorAll('button')].find(x=>x.offsetParent && /^(sign up|create account)$/i.test(x.innerText.trim())); if(b) b.click()}") + pg.wait_for_timeout(12000) + res['url1']=pg.url + res['text1']=pg.evaluate("() => document.body.innerText")[-260:] + if 'verify' in pg.url or 'confirm' in pg.url or 'signup' in pg.url: + code,subj=wait_code(150) + res['code']=code; res['subj']=subj + if code: + try: pg.fill("input[autocomplete=one-time-code], input[name*=code], input[inputmode=numeric]", code) + except Exception: + try: + bx=pg.query_selector_all("input[maxlength='1']") + for i,ch in enumerate(code): bx[i].fill(ch) + except Exception as e: res['fill_err']=str(e)[:70] + pg.keyboard.press('Enter'); pg.wait_for_timeout(10000) + res['url2']=pg.url + try: + pg.goto('https://app.edenai.run/billing', wait_until='domcontentloaded', timeout=60000) + pg.wait_for_timeout(7000) + t=pg.evaluate("() => document.body.innerText") + res['billing']=re.sub(r'\n{2,}','\n',t)[:500] + except Exception as e: res['billing_err']=str(e)[:70] +print(json.dumps(res, ensure_ascii=False)[:2200]); print('DONE') diff --git a/mail_read.py b/mail_read.py new file mode 100644 index 0000000..ea898c7 --- /dev/null +++ b/mail_read.py @@ -0,0 +1,71 @@ +import sys, imaplib, email, re, time, html +from email.header import decode_header + +def rd(h): + if not h: return '' + out = [] + for part, enc in decode_header(h): + if isinstance(part, bytes): + out.append(part.decode(enc or 'utf-8', 'replace')) + else: + out.append(part) + return ''.join(out) + +def body_text(msg): + txt = '' + if msg.is_multipart(): + for p in msg.walk(): + if p.get_content_type() == 'text/plain': + try: txt += p.get_payload(decode=True).decode(p.get_content_charset() or 'utf-8', 'replace') + except Exception: pass + elif p.get_content_type() == 'text/html' and not txt: + try: txt += html.unescape(re.sub(r'<[^>]+>', ' ', p.get_payload(decode=True).decode(p.get_content_charset() or 'utf-8', 'replace'))) + except Exception: pass + else: + try: txt = msg.get_payload(decode=True).decode(msg.get_content_charset() or 'utf-8', 'replace') + except Exception: txt = str(msg.get_payload()) + return txt + +def read(user, pw, host, sender_filter='', wait=90, limit=5, code_only=False): + end = time.time() + wait + last = '' + while True: + try: + M = imaplib.IMAP4_SSL(host, 993, timeout=30) + M.login(user, pw) + M.select('INBOX') + typ, data = M.search(None, 'ALL') + ids = data[0].split()[-limit * 3:] + found = [] + for i in reversed(ids): + typ, d = M.fetch(i, '(RFC822)') + if not d or not isinstance(d[0], tuple): continue + msg = email.message_from_bytes(d[0][1]) + subj = rd(msg.get('Subject')) + frm = rd(msg.get('From')) + if sender_filter and sender_filter.lower() not in (frm + ' ' + subj).lower(): + continue + b = body_text(msg) + codes = re.findall(r'\b([0-9]{6}|[0-9A-Za-z]{6})\b', b) + links = re.findall(r'https?://[^\s"<>)]{20,200}', b) + found.append({'date': msg.get('Date'), 'from': frm[:80], 'subj': subj[:100], + 'codes': list(dict.fromkeys(codes))[:5], + 'links': [l for l in links if 'unsub' not in l.lower()][:6], + 'snippet': re.sub(r'\s+', ' ', b)[:400]}) + M.logout() + if found: + return {'ok': True, 'msgs': found} + last = 'no-mail' + except Exception as e: + last = 'ERR ' + str(e)[:120] + if time.time() > end: + return {'ok': False, 'err': last} + time.sleep(8) + +if __name__ == '__main__': + user, pw = sys.argv[1], sys.argv[2] + flt = sys.argv[3] if len(sys.argv) > 3 else '' + wait = int(sys.argv[4]) if len(sys.argv) > 4 else 90 + host = sys.argv[5] if len(sys.argv) > 5 else 'secureimap.t-online.de' + import json + print(json.dumps(read(user, pw, host, flt, wait), ensure_ascii=False)[:3000]) \ No newline at end of file