AWS WAF Token Engine v2
by @yeatdiddy
═══════════════════════════════════════════════════════════


WHAT'S INCLUDED
───────────────
  token_worker.js   main solver script
  data.json         required data file  (must stay in same folder)
  README.txt        this file


REQUIREMENTS
────────────
  Node.js v18 or higher
  Download: https://nodejs.org


SETUP (first time only)
───────────────────────
  Open a terminal / command prompt in this folder and run:

    npm install http-proxy-agent https-proxy-agent

  That's it. No other setup needed.


RUNNING THE SOLVER
──────────────────
  node token_worker.js

  You should see:

    ╔══════════════════════════════════════════╗
    ║  WAF Token Engine v2  ·  @yeatdiddy     ║
    ╚══════════════════════════════════════════╝

    port  :  6767
    ui    :  http://localhost:6767
    api   :  http://localhost:6767/token?url=<URL>


USING THE UI
────────────
  Open your browser and go to:

    http://localhost:6767

  Paste the target URL and click "Grab Token".


USING THE API
─────────────
  Basic (no proxy):

    http://localhost:6767/token?url=https://example.com/login


  With proxy (ip:port):

    http://localhost:6767/token?url=https://example.com/login&proxy=1.2.3.4:8080


  With proxy auth (ip:port:user:pass):

    http://localhost:6767/token?url=https://example.com/login&proxy=1.2.3.4:8080:myuser:mypass


  Skip auto-discovery with a direct challenge URL:

    http://localhost:6767/token?url=https://example.com/login&chal=https://xxxx.edge.sdk.awswaf.com/xxxx/xxxx


RESPONSE FORMAT
───────────────
  Success:
    {
      "by":    "@yeatdiddy",
      "ok":    true,
      "token": "xxxxxxxx-xxxx-...",
      "time":  "0.84s"
    }

  Failure:
    {
      "by":  "@yeatdiddy",
      "ok":  false,
      "err": "reason here"
    }


ENVIRONMENT VARIABLES
─────────────────────
  Set a global default proxy so you don't pass it every request:

    Windows:
      set PROXY=http://user:pass@1.2.3.4:8080

    Linux / Mac:
      export PROXY=http://user:pass@1.2.3.4:8080

  Or use split variables:

    set PROXY_IP=1.2.3.4
    set PROXY_PORT=8080
    set PROXY_USER=myuser
    set PROXY_PASS=mypass

  Custom port (default is 6767):

    set PORT=9000
    node token_worker.js


STOPPING THE SERVER
───────────────────
  Press Ctrl+C in the terminal.


═══════════════════════════════════════════════════════════
