Files
netlify-autoreg/README.md
T

155 lines
7.2 KiB
Markdown

# netlify-autoreg
Automated account registration + full API reverse for **app.netlify.com**.
No 2captcha. The captcha is solved by the real browser session that owns the page,
because Netlify's reCAPTCHA Enterprise token is bound to browser origin, action and
score: solver tokens from third-party services are silently dropped with
`Please complete the security check and try again`.
## What's inside
| file | purpose |
|---|---|
| `netlify_farm.py` | registration wave: captcha -> signup -> IMAP verify -> token -> site -> deploy |
| `proxy_helpers.py` | Chrome bootstrap (with `--proxy-server`), ZTE mobile rotation, egress probe |
| `mailbox.py` | multi-provider mailbox pool: IMAP presets, host autodetect, POP3 (rediffmail), SEARCH fallback |
| `captcha.py` | captcha layer: page detection, in-page enterprise execute, external solvers (2captcha/rucaptcha/capmonster) |
| `dashboard.py` | web control panel: account table, check/wave/deploy jobs, live log |
| `deploy_all.py` | re-deploy every site in the bank and verify HTTP 200 |
| `docs/REVERSE.md` | every endpoint, request body and response we observed |
| `docs/API.md` | API surface, PAT, AI Gateway status |
## Pipeline
```
Chrome (CDP, real profile, optional --proxy-server)
-> GET /signup/email
-> grecaptcha.enterprise.execute(SITEKEY, {action: "SIGNUP"}) ~2400 chars
-> POST api.netlify.com/auth/signup?provider=email... -> {code_id}
-> IMAP (t-online) "[Netlify] Let's verify your email" -> #verify_token=<code_id>-<code>
-> POST api.netlify.com/auth/verify {code_id, code} -> access_token nfu_...
-> POST api/v1/sites {name} -> site_id
-> PATCH api/v1/sites/{id} {"sso_login": false} (new accounts are SSO-locked -> 401)
-> POST api/v1/sites/{id}/deploys (zip) -> state=ready, HTTP 200
```
## Quick start
```bash
# direct (home IP)
python netlify_farm.py --count 5 --site \
--mails "C:/path/to/mails.txt" --bank "C:/path/to/netlify_bank.jsonl"
# through a proxy, rotating the mobile uplink before every account
python netlify_farm.py --count 5 --site \
--proxy http://127.0.0.1:8899 --port 9244 --rotate \
--profile "C:/tmp/nl_prof_zte" \
--mails "C:/path/to/mails.txt" --bank "C:/path/to/netlify_bank.jsonl"
# dashboard
python dashboard.py --port 8791 # http://127.0.0.1:8791/
```
`--proxy` starts Chrome with `--proxy-server` and sends the HTTP calls through the
same proxy, so signup, verify and the site API share one egress.
`--rotate` calls the ZTE rotator (PPP reconnect) before each account.
Bank record:
```json
{"email":"...@t-online.de","password":"...","token":"nfu_...","user_id":"...",
"account_id":"...","site_id":"...","site_domain":"...","ts":"2026-11-11T18:37:00"}
```
## Requirements
- Windows + real Chrome (Netlify fingerprints the browser; Camoufox/headless get
`Please complete the security check`)
- `playwright` (CDP client only, we connect to a running Chrome)
- IMAP-readable mailbox pool. **gmail `+alias` is rejected** (`Email address is
invalid`); t-online works.
- Python 3.11
## Dashboard
`dashboard.py` serves one page on `127.0.0.1:8791`:
- account table: email, status (`alive` / `suspended` / `rate_limited`), last check,
site domain and its HTTP code
- **Проверить все / 5** — login probe per account, writes `state.json`
- **Деплой всем** — `PATCH sso_login=false` + zip deploy + 200 check per site
- **Волна N** — spawns the farm, streams its stdout into the panel over SSE
- per-row: refresh token, redeploy
## Limitations (read before scaling)
1. **Captcha cannot be outsourced.** 2captcha Enterprise tokens with the correct
sitekey and `action: SIGNUP` are rejected: origin and score do not match. Every
account costs one real page execution in a real Chrome.
2. **`nfu_` tokens are short-lived** (tens of minutes) and rotate. The password is
the durable credential: `login()` re-issues a token without a captcha.
3. **Login is IP rate-limited.** After roughly 20 `POST /auth/login` calls from one
IP the endpoint answers `429`; the dashboard backs off 60 s per hit. Rotation or
a proxy pool is required for bulk status checks.
4. **Mobile rotation does not always change the IP.** The ZTE uplink reconnects in
~15-20 s but the carrier can hand back the same address (observed: identical IP
after a full PPP cycle). Treat `--rotate` as best-effort.
5. **Manual moderation is real.** `{"message":"Account suspended","spam":"manual"}`
is a human decision. It hit every account created during the messy phase (gmail
addresses with no mailbox, repeated failures on one IP) and none created by the
steady flow. No retry undoes it.
6. **AI Gateway works, but only from Edge Functions.** Lambda functions see 37 env
vars and no AI keys. A Deno edge function gets `NETLIFY_AI_GATEWAY_KEY` (JWT, 497
chars) plus `OPENAI_/ANTHROPIC_/GEMINI_/OPENROUTER_/META_/TYPESAFE_` key+base pair,
all pointing at `https://<your-site>/.netlify/ai`. The JWT expires in minutes;
any call to your own edge function issues a fresh one. See `edge/envdump.ts`
and `aigw_smoke.py`.
7. **Mailbox pool is the real bottleneck**, not the API: one working mailbox per
account, readable over IMAP.
## Mailboxes — many providers
`mailbox.py` keeps a union of any number of pool files and resolves the IMAP host by
domain with fallbacks (`imap.<domain>`, `mail.<domain>`, preset table). Providers tested
alive with real credentials: `t-online.de`, `aliyun.com`, `singnet.com.sg`, `rambler.ru`,
`gmx.net`, `icn.od.ua`, plus gmail/outlook/rambler/mail.ru/yandex presets. `rediffmail.com`
goes through POP3 (no IMAP). Servers that reject `SEARCH FROM` (aliyun, rambler) are
handled by an `ALL` + Python header filter fallback.
```bash
python netlify_farm.py --count 2 --site --mails "pool_a.txt,pool_b.txt,pool_c.txt" --captcha auto
```
Verified 11.11.26: one run created accounts on `aliyun.com` and `singnet.com.sg`,
both verified over IMAP, both sites serving 200.
## Captcha
`captcha.py` does three things:
1. **detect(page)** — reports recaptcha v2 / enterprise / hcaptcha / turnstile, extracted
sitekeys and the `sa`/action parameter from the iframes.
2. **execute_in_page(page)** — runs `grecaptcha.enterprise.execute(sitekey, {action})`
inside the page that will submit the form. This is the only path Netlify accepts.
3. **solve(provider, key, kind, url, sitekey, action)** — external solvers: 2captcha,
rucaptcha, capmonster; task types `recaptcha_v2`, `recaptcha_v2_enterprise`,
`recaptcha_v3`, `hcaptcha`, `turnstile`.
Modes: `--captcha auto` (in-page only, default), `--captcha off`, or an explicit provider
(`--captcha 2captcha --captcha-key ...`) to fall back when the in-page token fails.
Note: solver tokens for Netlify's invisible Enterprise are still rejected server-side
(origin/score bound) — the external path exists for other targets and for experimenting,
not as a Netlify shortcut.
## Docs
- [`docs/REVERSE.md`](docs/REVERSE.md) — endpoints, bodies, responses
- [`docs/API.md`](docs/API.md) — API surface, PAT, AI Gateway status
## Notes
No credentials, tokens or account data are stored in this repository. The bank
file and `mails.txt` are local and git-ignored.