DEV Community

Cover image for RoseLia — OTP/MFA assessment platform. recon, JS/source-map API mining, flow discovery, auth probes and bruteforce with TLS impersonation.

RoseLia — OTP/MFA assessment platform. recon, JS/source-map API mining, flow discovery, auth probes and bruteforce with TLS impersonation.

RoseLia — Autonomous OTP / MFA Assessment Platform

AUTHOR: SYLHETYHACKVENGER (THE-ERROR808)

VERSION: 1.0.0

LICENSE: For authorized security assessments only.

ROSELIA

NEXT-GENERATION SECURITY RESEARCH PROJECT

ROSELIA
Security Research
Development
Stars
Forks
Issues
Last Commit

PRECISION • INNOVATION • SECURITY

An independent security research and development project built with a focus on technical precision and innovation.

ROSELIA // SECURITY RESEARCH // DEVELOPMENT


Overview

RoseLia is a next-generation, autonomous OTP/MFA security assessment platform engineered for professional penetration testers, red teams, and security researchers. Built entirely in Python 3, RoseLia combines aggressive reconnaissance, intelligent flow discovery, and high-concurrency brute-force capabilities into a single unified framework. The tool is designed to evaluate the security posture of one-time password (OTP), multi-factor authentication (MFA), and two-factor authentication (2FA) implementations across web applications and REST APIs. Unlike traditional brute-force tools, RoseLia employs a multi-phase methodology: it first maps the attack surface through 13 distinct reconnaissance stages, discovers authentication flows via state-machine analysis and server error parsing, then systematically probes for implementation flaws before engaging in distributed code-space traversal. The platform supports TLS impersonation via curl_cffi, adaptive rate-limit handling, multi-account rotation, resume-on-interrupt functionality, and real-time telemetry through an ANSI-colored status panel. RoseLia detects timing oracles, NoSQL injection, prototype pollution, HTTP parameter pollution, content-type confusion, race conditions, JWT weaknesses, cross-account code reuse, SSRF, XXE, LDAP injection, SSTI, and dozens of other vulnerability classes specific to authentication systems. It automatically extracts API endpoints from JavaScript bundles, webpack chunks, source maps, OpenAPI specifications, and sitemaps, then uses AST-based deobfuscation to recover hidden routes. The tool is architected for parallelism: reconnaissance uses threaded sessions with rotating user-agents, while brute-force operations leverage asyncio with configurable concurrency up to thousands of simultaneous requests. All findings are emitted as structured JSON with CWE classifications, severity ratings, evidence snapshots, and actionable remediation guidance. RoseLia is not a point-and-click exploit kit — it is a professional assessment instrument that assumes the operator understands the target's authorization scope, legal boundaries, and ethical responsibilities. Use only against systems you own or have explicit written permission to test.


Table of Contents

  1. Features at a Glance
  2. Architecture Overview
  3. Installation
  4. Quick Start
  5. Command-Line Interface
  6. Reconnaissance Engine
  7. Flow Discovery
  8. Brute-Force Engine
  9. Probe Modules
  10. Output & Reporting
  11. Configuration Reference
  12. Advanced Usage Patterns
  13. Performance Tuning
  14. Legal & Ethical Guidelines
  15. Troubleshooting
  16. FAQ
  17. Credits & Acknowledgments

Features at a Glance

Category Capability
Recon 13-stage automated reconnaissance pipeline
Wordlist 400+ built-in paths + custom wordlist support
JS Analysis Webpack chunk extraction, source-map parsing, AST deobfuscation
API Discovery OpenAPI/Swagger parsing, sitemap crawling, template-literal resolution
Flow Detection State-machine login flow, CSRF extraction, field discovery
Brute-Force Async concurrency up to 10,000 workers, resume support
Probes 35+ vulnerability classes specific to OTP/MFA
Stealth TLS impersonation (Chrome/Firefox/Safari), UA rotation, header randomization
Rate-Limit Adaptive 429 handling with Retry-After respect
Multi-Account Account rotation, per-account lockout tracking
Output JSON findings, hit files, resume files, live ANSI panel
Resume Interrupt-safe code-space traversal checkpointing


Architecture Overview

RoseLia is organized into five logical layers, each responsible for a distinct phase of the assessment lifecycle. Understanding this layering is critical for effective operation and for extending the tool.

Layer 1 — Transport

The transport layer abstracts HTTP communication behind two engines:

· AsyncEngine — asyncio-based high-concurrency client using curl_cffi when available (with TLS fingerprint impersonation), falling back to aiohttp.
· RotatingSession — synchronous threaded client with curl_cffi sync mode, falling back to requests with connection pooling.

Both engines apply randomized browser headers, accept-language rotation, and per-request user-agent selection from a curated pool of 10 modern browser profiles.

Layer 2 — Reconnaissance

The Recon class executes thirteen sequential stages:

  1. Wordlist probing — 400+ built-in paths
  2. Auth path enumeration — dedicated OTP/MFA/2FA paths
  3. OpenAPI discovery — Swagger 2.x and OpenAPI 3.x
  4. Sitemap crawling — including cross-origin references
  5. JS bundle enumeration — script tags, link preload, Vite manifests
  6. Webpack chunk extraction — parses webpack_require.u maps
  7. Source-map harvesting — inline and external maps
  8. JS API extraction — regex + AST + string-table deobfuscation
  9. HTML form/input analysis — captures form actions and field names
  10. Robots.txt parsing — including hidden paths in comments
  11. TLS SAN enumeration — extracts certificate subjectAltNames
  12. Security header & tech fingerprinting — 20+ frameworks detected
  13. CDN cache detection — flags cacheable auth responses

Noise filtering collapses identical (status, size) tuples appearing more than 20 times into noise endpoints, preventing SPA catch-all routes from polluting results.

Layer 3 — Flow Discovery

FlowFinder orchestrates:

· Registration probing — 9 payload shapes × 2 content types × N endpoints
· Login state machine — GET login page, extract CSRF, POST credentials
· Field discovery — iteratively parses "missing field: X" errors to reconstruct the exact verify payload
· Payload shape probing — 17 candidate payloads across JSON and form encodings
· Multi-baseline collection — default, CSRF-augmented, cookie-augmented responses

The result is a fully-populated Flow dataclass containing every URL, payload, baseline hash, and session cookie needed for downstream probing and brute-force.

Layer 4 — Probing

The Probes class runs 35+ independent vulnerability checks. Each probe is guarded by _need_verify, _need_request, _need_both, or _need_2acc preconditions, so missing flow elements produce clean SKIP messages rather than crashes.

Layer 5 — Brute-Force

The Brute class shards the 10^digits code space across N workers, applies random shuffle within each shard, honors --max-req and --per-account-max, respects 429 Retry-After, detects lockout phrases, and stops globally on first hit. Resume files allow restart after interruption; hit files persist successful codes with timestamps.


Installation

Prerequisites

· Python 3.9+
· pip
· Git (optional, for cloning)

Standard Install

git clone https://github.com/sylhetyhackvenger/ROSELIA 
cd ROSELIA 
python3 -m venv venv
source venv/bin/activate   # Linux/macOS
# venv\Scripts\activate    # Windows
pip install --upgrade pip
pip install aiohttp curl_cffi requests pyjwt esprima
Enter fullscreen mode Exit fullscreen mode

Minimal Install

If you cannot install curl_cffi (e.g., restricted environments), RoseLia degrades gracefully to aiohttp + requests. The only hard dependency is aiohttp:

pip install aiohttp
Enter fullscreen mode Exit fullscreen mode

Optional Dependencies

Package Enables
curl_cffi TLS fingerprint impersonation (Chrome/Firefox/Safari)
pyjwt JWT analysis probes
esprima AST-based JS constant extraction
requests Synchronous fallback transport

Verifying the Install

python3 -c "import aiohttp, sys; print(aiohttp.__version__)"
python3 -c "from curl_cffi.requests import AsyncSession; print('curl_cffi OK')"
python3 -c "import jwt; print('pyjwt OK')"
python3 -c "import esprima; print('esprima OK')"
Enter fullscreen mode Exit fullscreen mode

Platform Notes

· Linux/macOS — recommended; all features available.
· Windows — ANSI colors work in Windows Terminal and PowerShell 7+. Use colorama if needed.
· Termux (Android) — curl_cffi wheels are unavailable; falls back cleanly.
· Docker — see Dockerfile example in the repository.


Quick Start

  1. Basic Assessment Against a Target
python3 roselia.py https://target.example.com
Enter fullscreen mode Exit fullscreen mode

This runs reconnaissance, flow discovery, all probes, and brute-force with default settings (500 workers, 10^6 code space, 5000 attempts per account).

  1. Recon-Only Mode
python3 roselia.py https://target.example.com --recon-only
Enter fullscreen mode Exit fullscreen mode

Stops after the 13-stage reconnaissance pipeline and emits a JSON endpoint map.

  1. Aggressive Brute-Force
python3 roselia.py https://target.example.com \
  --workers 2000 \
  --rps 500 \
  --digits 6 \
  --max-req 1000000 \
  --per-account-max 10000 \
  --hits hits.jsonl \
  --resume resume.txt
Enter fullscreen mode Exit fullscreen mode
  1. Multi-Account Assessment
python3 roselia.py https://target.example.com \
  --accounts accounts.txt \
  --workers 1000 \
  --hits hits.jsonl
Enter fullscreen mode Exit fullscreen mode

Where accounts.txt contains one account identifier per line.

  1. Distributed Workers

Split the code space across multiple machines:

# Machine 1
python3 roselia.py https://target --worker-id 0 --total-workers 4 --workers 500

# Machine 2
python3 roselia.py https://target --worker-id 1 --total-workers 4 --workers 500

# ... and so on
Enter fullscreen mode Exit fullscreen mode

Command-Line Interface

RoseLia uses argparse with sensible defaults. The full flag set is documented below.

Target & Scope

Flag Type Default Description
target positional required Base URL (e.g., https://app.example.com)
--scope str "" Comma-separated hostnames permitted for cross-origin testing
--exclude str "" Comma-separated path prefixes to skip

Reconnaissance

Flag Type Default Description
--recon-only flag off Stop after recon
--wordlist path built-in Custom path wordlist (one per line)
--no-js flag off Skip JS bundle analysis
--no-source-maps flag off Skip source-map harvesting
--no-sitemap flag off Skip sitemap crawling

Flow Discovery

Flag Type Default Description
--register flag on Probe open registration
--no-register flag off Skip registration
--account str auto Pre-existing account identifier
--password str auto Pre-existing password
--login-url str auto Override login endpoint
--verify-url str auto Override verify endpoint
--request-url str auto Override OTP request endpoint

Brute-Force

Flag Type Default Description
--workers int 500 Async concurrency
--rps int 0 Requests per second cap (0 = unlimited)
--digits int 6 OTP length
--max-req int 1000000 Global request cap
--per-account-max int 5000 Per-account attempt cap
--worker-id int 0 Shard index
--total-workers int 1 Total shards
--accounts path — File with one account per line
--hits path — JSONL file for successful codes
--resume path — Resume checkpoint file
--no-brute flag off Disable brute-force
--no-probes flag off Disable probes

Transport

Flag Type Default Description
--timeout int 8 Per-request timeout (seconds)
--no-curl flag off Disable curl_cffi
--proxy str — HTTP/SOCKS proxy URL
--insecure flag on Ignore TLS errors
--no-random-ua flag off Pin a single UA

Output

Flag Type Default Description
--json path findings.json JSON findings output
--quiet flag off Suppress live panel
--verbose flag off Verbose per-request logging


Reconnaissance Engine

The recon engine is the foundation of every assessment. Without accurate endpoint discovery, flow detection and probing will fail. This section documents each of the 13 stages in detail.

Stage 1 — Wordlist Probing

The built-in wordlist contains 400+ paths covering:

· VCS artifacts — .git/HEAD, .git/config, .svn/entries, .hg/hgrc
· Environment files — .env, .env.local, .env.prod, .env.backup
· CI/CD configs — Dockerfile, docker-compose.yml, package.json
· Java/Spring — actuator/*, WEB-INF/web.xml, META-INF/MANIFEST.MF
· PHP — phpinfo.php, wp-config.php, xmlrpc.php
· OpenAPI — swagger.json, openapi.json, v2/api-docs, v3/api-docs
· Auth paths — 150+ OTP/MFA/2FA endpoint permutations
· Admin panels — admin/, administrator/, manager/html, phpmyadmin
· Backups — backup.zip, db.sql, dump.sql, backup.tar.gz

Each path is probed with a GET request and classified by (status, size). Paths returning 200 with >20 bytes are fed to _analyze() which detects git exposure, env leaks, phpinfo, actuator, Swagger, and stack traces.

Noise Filtering: After probing, identical (status, size) tuples appearing more than 20 times are marked as noise. This eliminates SPA catch-all routes (which return the same 200/412KB response for every path) from downstream processing.

Stage 2 — Auth Path Enumeration

A dedicated AUTH_PATHS list of ~80 endpoints is probed independently. These are the paths most likely to accept OTP verification:

/otp/verify, /otp/check, /otp/validate, /otp/confirm
/mfa/verify, /mfa/challenge, /mfa/check
/2fa/verify, /2fa/check
/auth/otp/verify, /auth/mfa/verify, /auth/2fa/verify
/api/otp/verify, /api/mfa/verify, /api/2fa/verify
/api/auth/otp/verify, /api/auth/mfa/verify, /api/auth/2fa/verify
/api/v1/otp/verify, /api/v1/auth/mfa/verify
/v1/otp/verify, /v2/otp/verify
/login/otp, /login/verify, /login/mfa, /login/2fa
/verify-otp, /verify-mfa, /verify-2fa, /verify-code
/confirm-otp, /confirm-code, /validate-otp, /submit-otp
Enter fullscreen mode Exit fullscreen mode

Statuses 200, 400, 401, 403, 405, 422, 428 are all considered "live" — a 400/405 indicates the endpoint exists and rejects the request shape, which is exactly what we want to find.

Stage 3 — OpenAPI Discovery

If any of /swagger.json, /openapi.json, /api-docs, /v2/api-docs, /v3/api-docs, or /.well-known/openid-configuration returns JSON, RoseLia parses the paths object and extracts every path containing otp, mfa, 2fa, verify, confirm, challenge, token, login, or auth. Each discovered path is added to api_endpoints with its HTTP methods and source URL.

Stage 4 — Sitemap Crawling

If /sitemap.xml exists, RoseLia:

  1. Extracts all entries
  2. Detects cross-origin hosts (logged as informational)
  3. Fetches the first 30 URLs
  4. Extracts and <link href> JS references from each page</li> <li>Adds all same-origin JS bundles to js_urls</li> </ol> <p>Stage 5 — JS Bundle Enumeration</p> <p>RoseLia probes the homepage plus /login, /register, /signup, /app, /account, /user for <script> tags and <link rel="preload"> references. It also probes common build outputs directly:<br> </p> <div class="highlight"><pre class="highlight plaintext"><code>/static/js/main.js /static/js/main.chunk.js /static/js/bundle.js /_next/static/_buildManifest.js /main.js /app.js /bundle.js /assets/index.js /js/app.js /js/main.js </code></pre></div> <p></p> <p>Stage 6 — Webpack Chunk Extraction</p> <p>For every discovered JS bundle under 400KB, RoseLia runs a regex that parses the webpack chunk map:<br> </p> <div class="highlight"><pre class="highlight javascript"><code><span class="n">__webpack_require__</span><span class="p">.</span><span class="n">u</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="n">e</span><span class="p">)</span> <span class="p">{</span> <span class="k">return</span> <span class="s2">"static/js/"</span> <span class="o">+</span> <span class="p">{</span><span class="mi">1</span><span class="p">:</span><span class="s2">"abc123"</span><span class="p">,</span> <span class="mi">2</span><span class="p">:</span><span class="s2">"def456"</span><span class="p">}</span><span class="p">[</span><span class="n">e</span><span class="p">]</span> <span class="o">+</span> <span class="s2">".chunk.js"</span> <span class="p">}</span> </code></pre></div> <p></p> <p>All chunk URLs are resolved against the base URL and recursively queued for analysis.</p> <p>Stage 7 — Source-Map Harvesting</p> <p>RoseLia looks for both:</p> <p>· External maps — //# sourceMappingURL=main.js.map<br> · Inline maps — //# sourceMappingURL=data:application/json;base64,...</p> <p>Each map is parsed, and sourcesContent entries are scanned for API paths using a regex that requires at least two path segments and excludes static-asset extensions. sources entries are also scanned for /api/, /auth/, /otp/, /mfa/, /2fa/ prefixes.</p> <p>Stage 8 — JS API Extraction</p> <p>This is the most sophisticated recon stage. For each JS bundle, RoseLia applies three techniques:</p> <p>Technique A — Regex extraction against 15 patterns including fetch(), axios.get/post(), baseUrl:, endpoint:, url:, path:.</p> <p>Technique B — String-table deobfuscation — detects patterns like:<br> </p> <div class="highlight"><pre class="highlight javascript"><code><span class="kd">var</span> <span class="n">_0x4f2a</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"/api/v1/otp/verify"</span><span class="p">,</span> <span class="s2">"/api/v1/otp/request"</span><span class="p">,</span> <span class="p">.</span><span class="p">.</span><span class="p">.</span><span class="p">]</span><span class="p">;</span> <span class="n">_0x4f2a</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="c1">// resolves to "/api/v1/otp/verify"</span> </code></pre></div> <p></p> <p>Technique C — AST constant extraction (requires esprima) — parses the JS into an AST, walks all VariableDeclarator nodes, and collects string constants that begin with /.</p> <p>Template-literal resolution — patterns like <code>/api/${version}/otp/verify</code> are expanded against [&quot;v1&quot;,&quot;v2&quot;,&quot;v3&quot;,&quot;1&quot;,&quot;2&quot;,&quot;3&quot;].</p> <p>All discovered paths are then probed with GET to confirm liveness.</p> <p>Secret scanning — the same JS bundles are scanned for AWS keys, Stripe live keys, GitHub tokens, GitLab tokens, Slack tokens, Google API keys, JWTs, and private keys. Any match is emitted as a high-severity finding.</p> <p>Stage 9 — HTML Analysis</p> <p>The homepage is parsed for <meta name="generator">, <form action>, and <input name>. Form actions are added as POST endpoints; input names are stored in tech[&quot;inputs&quot;] for later use in payload construction.</p> <p>Stage 10 — Robots.txt Parsing</p> <p>RoseLia parses Disallow: and Allow: directives, then probes each discovered path. It also extracts paths embedded in comments (e.g., # /hidden-admin/) — a common leak vector.</p> <p>Stage 11 — TLS SAN Enumeration</p> <p>RoseLia opens a raw TLS connection, retrieves the peer certificate, and extracts all DNS SAN entries. Wildcard SANs (*.example.com) are skipped; exact SANs are added as SAN:hostname pseudo-endpoints.</p> <p>Stage 12 — Security Header &amp; Tech Fingerprinting</p> <p>RoseLia inspects:</p> <p>· Server, X-Powered-By, X-Vercel-ID, X-Amz-Cf-ID, CF-Ray, X-Cache, X-Served-By<br> · Presence of CSP, HSTS, X-Frame-Options</p> <p>It also greps the HTML for 18 framework signatures: nginx, Apache, IIS, Cloudflare, Express, PHP, ASP.NET, jQuery, React, Vue, Angular, Next.js, Nuxt, Django, Rails, Laravel, Flask, Werkzeug.</p> <p>Stage 13 — CDN Cache Detection</p> <p>RoseLia checks for Age:, X-Cache: hit, CF-Cache-Status: headers. Any positive match produces an informational finding because cacheable auth responses can enable cross-user code leakage.</p> <hr> <p>Flow Discovery</p> <p>The FlowFinder class automates discovery of the target&#39;s authentication state machine. This is the most critical phase — without a working Flow, probes are skipped and brute-force is disabled.</p> <p>Phase 1 — Endpoint Selection</p> <p>From the recon endpoint map, RoseLia selects candidates by keyword:</p> <p>· Verify candidates — paths containing verify, confirm, validate, submit, check<br> · Request candidates — paths containing request, send, issue, resend, generate<br> · Register candidates — paths containing register, signup<br> · Login candidates — paths containing login, signin<br> · Reset candidates — paths containing reset + (request, forgot, initiate, send)</p> <p>The longest matching path wins (deeper endpoints are more specific).</p> <p>Phase 2 — Registration</p> <p>RoseLia generates a synthetic identity:<br> </p> <div class="highlight"><pre class="highlight plaintext"><code>email: rose&lt;7-digit-random&gt;@example.test password: R0s3!&lt;7-digit-random&gt; phone: +880170000&lt;4-digit-random&gt; </code></pre></div> <p></p> <p>It then tries 9 payload shapes across all register candidates and both content types:<br> </p> <div class="highlight"><pre class="highlight python"><code><span class="p">{</span><span class="s2">"email"</span><span class="p">:</span> <span class="n">e</span><span class="p">,</span> <span class="s2">"password"</span><span class="p">:</span> <span class="n">p</span><span class="p">}</span> <span class="p">{</span><span class="s2">"email"</span><span class="p">:</span> <span class="n">e</span><span class="p">,</span> <span class="s2">"password"</span><span class="p">:</span> <span class="n">p</span><span class="p">,</span> <span class="s2">"password2"</span><span class="p">:</span> <span class="n">p</span><span class="p">}</span> <span class="p">{</span><span class="s2">"email"</span><span class="p">:</span> <span class="n">e</span><span class="p">,</span> <span class="s2">"password"</span><span class="p">:</span> <span class="n">p</span><span class="p">,</span> <span class="s2">"username"</span><span class="p">:</span> <span class="n">u</span><span class="p">}</span> <span class="p">{</span><span class="s2">"username"</span><span class="p">:</span> <span class="n">u</span><span class="p">,</span> <span class="s2">"password"</span><span class="p">:</span> <span class="n">p</span><span class="p">}</span> <span class="p">{</span><span class="s2">"phone"</span><span class="p">:</span> <span class="n">ph</span><span class="p">,</span> <span class="s2">"password"</span><span class="p">:</span> <span class="n">p</span><span class="p">}</span> <span class="p">{</span><span class="s2">"mobile"</span><span class="p">:</span> <span class="n">ph</span><span class="p">,</span> <span class="s2">"password"</span><span class="p">:</span> <span class="n">p</span><span class="p">}</span> <span class="p">{</span><span class="s2">"phone"</span><span class="p">:</span> <span class="n">ph</span><span class="p">,</span> <span class="s2">"password"</span><span class="p">:</span> <span class="n">p</span><span class="p">,</span> <span class="s2">"name"</span><span class="p">:</span> <span class="n">u</span><span class="p">}</span> <span class="p">{</span><span class="s2">"name"</span><span class="p">:</span> <span class="n">u</span><span class="p">,</span> <span class="s2">"email"</span><span class="p">:</span> <span class="n">e</span><span class="p">,</span> <span class="s2">"password"</span><span class="p">:</span> <span class="n">p</span><span class="p">}</span> <span class="p">{</span><span class="s2">"name"</span><span class="p">:</span> <span class="n">u</span><span class="p">,</span> <span class="s2">"phone"</span><span class="p">:</span> <span class="n">ph</span><span class="p">,</span> <span class="s2">"password"</span><span class="p">:</span> <span class="n">p</span><span class="p">}</span> </code></pre></div> <p></p> <p>A registration is considered successful if:</p> <ol> <li>Status ∈ {200, 201, 202}</li> <li>Response is NOT an auth page</li> <li>Response IS JSON</li> <li>Response contains a success key OR an identity key (id, user_id, account_id, token)</li> </ol> <p>On success, flow.account and flow.password are populated, and an &quot;open registration&quot; informational finding is emitted.</p> <p>Phase 3 — Login State Machine</p> <p>If a login URL exists, LoginFlow runs:</p> <ol> <li>GET login page — capture cookies and CSRF token</li> <li>Extract CSRF — 6 regex patterns covering _csrf, csrf_token, csrfmiddlewaretoken, authenticity_token, _token, csrf-token meta</li> <li>POST credentials — try JSON then form encoding</li> <li>Follow redirect — if Location contains otp, verify, or mfa, log as &quot;flow captured&quot;</li> </ol> <p>Phase 4 — Field Discovery</p> <p>This is the cleverest part of RoseLia. Rather than guessing the verify payload, it asks the server:<br> </p> <div class="highlight"><pre class="highlight python"><code><span class="n">payload</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"account"</span><span class="p">:</span> <span class="n">flow</span><span class="p">.</span><span class="n">account</span><span class="p">}</span> <span class="k">for</span> <span class="n">i</span> <span class="k">in</span> <span class="nb">range</span><span class="p">(</span><span class="mi">8</span><span class="p">)</span><span class="p">:</span> <span class="n">r</span> <span class="o">=</span> <span class="n">sess</span><span class="p">.</span><span class="nf">post</span><span class="p">(</span><span class="n">flow</span><span class="p">.</span><span class="n">verify_url</span><span class="p">,</span> <span class="n">json</span><span class="o">=</span><span class="n">payload</span><span class="p">)</span> <span class="n">missing</span> <span class="o">=</span> <span class="nf">extract_missing_fields</span><span class="p">(</span><span class="n">r</span><span class="p">.</span><span class="n">text</span><span class="p">)</span> <span class="k">if</span> <span class="ow">not</span> <span class="n">missing</span><span class="p">:</span> <span class="k">break</span> <span class="k">for</span> <span class="n">field</span> <span class="k">in</span> <span class="n">missing</span><span class="p">:</span> <span class="n">payload</span><span class="p">[</span><span class="n">field</span><span class="p">]</span> <span class="o">=</span> <span class="nf">intelligent_default</span><span class="p">(</span><span class="n">field</span><span class="p">)</span> </code></pre></div> <p></p> <p>extract_missing_fields() matches patterns like:<br> </p> <div class="highlight"><pre class="highlight plaintext"><code>missing 'code' required: email "otp" not provided </code></pre></div> <p></p> <p>The intelligent_default() function maps field names to plausible values:</p> <p>Field Default<br> code, otp, token, pin, otpcode &quot;000000&quot;<br> email flow.account<br> username, user flow.account<br> account flow.account<br> password flow.password<br> <em>csrf</em> flow.csrf_token<br> anything else &quot;1&quot;</p> <p>After ≤8 iterations, the exact required payload is reconstructed. A finding is emitted documenting the discovered schema.</p> <p>Phase 5 — Payload Shape Probing</p> <p>If field discovery fails, RoseLia falls back to trying 17 candidate payloads:<br> </p> <div class="highlight"><pre class="highlight python"><code><span class="p">{</span><span class="s2">"account"</span><span class="p">:</span> <span class="n">a</span><span class="p">,</span> <span class="s2">"code"</span><span class="p">:</span> <span class="s2">"000000"</span><span class="p">}</span> <span class="p">{</span><span class="s2">"email"</span><span class="p">:</span> <span class="n">a</span><span class="p">,</span> <span class="s2">"code"</span><span class="p">:</span> <span class="s2">"000000"</span><span class="p">}</span> <span class="p">{</span><span class="s2">"username"</span><span class="p">:</span> <span class="n">a</span><span class="p">,</span> <span class="s2">"code"</span><span class="p">:</span> <span class="s2">"000000"</span><span class="p">}</span> <span class="p">{</span><span class="s2">"phone"</span><span class="p">:</span> <span class="n">p</span><span class="p">,</span> <span class="s2">"code"</span><span class="p">:</span> <span class="s2">"000000"</span><span class="p">}</span> <span class="p">{</span><span class="s2">"mobile"</span><span class="p">:</span> <span class="n">p</span><span class="p">,</span> <span class="s2">"code"</span><span class="p">:</span> <span class="s2">"000000"</span><span class="p">}</span> <span class="p">{</span><span class="s2">"account"</span><span class="p">:</span> <span class="n">a</span><span class="p">,</span> <span class="s2">"otp"</span><span class="p">:</span> <span class="s2">"000000"</span><span class="p">}</span> <span class="p">{</span><span class="s2">"email"</span><span class="p">:</span> <span class="n">a</span><span class="p">,</span> <span class="s2">"otp"</span><span class="p">:</span> <span class="s2">"000000"</span><span class="p">}</span> <span class="p">{</span><span class="s2">"account"</span><span class="p">:</span> <span class="n">a</span><span class="p">,</span> <span class="s2">"token"</span><span class="p">:</span> <span class="s2">"000000"</span><span class="p">}</span> <span class="p">{</span><span class="s2">"account"</span><span class="p">:</span> <span class="n">a</span><span class="p">,</span> <span class="s2">"otpCode"</span><span class="p">:</span> <span class="s2">"000000"</span><span class="p">}</span> <span class="p">{</span><span class="s2">"account"</span><span class="p">:</span> <span class="n">a</span><span class="p">,</span> <span class="s2">"otp_code"</span><span class="p">:</span> <span class="s2">"000000"</span><span class="p">}</span> <span class="p">{</span><span class="s2">"user"</span><span class="p">:</span> <span class="p">{</span><span class="s2">"email"</span><span class="p">:</span> <span class="n">a</span><span class="p">}</span><span class="p">,</span> <span class="s2">"code"</span><span class="p">:</span> <span class="s2">"000000"</span><span class="p">}</span> <span class="p">{</span><span class="s2">"code"</span><span class="p">:</span> <span class="s2">"000000"</span><span class="p">}</span> <span class="p">{</span><span class="s2">"otp"</span><span class="p">:</span> <span class="s2">"000000"</span><span class="p">}</span> <span class="p">{</span><span class="s2">"token"</span><span class="p">:</span> <span class="s2">"000000"</span><span class="p">}</span> <span class="p">{</span><span class="s2">"verification_code"</span><span class="p">:</span> <span class="s2">"000000"</span><span class="p">}</span> <span class="p">{</span><span class="s2">"pin"</span><span class="p">:</span> <span class="s2">"000000"</span><span class="p">}</span> </code></pre></div> <p></p> <p>Each is tried as JSON and form-encoded. The first non-CF-block, non-auth-page, non-error response is selected as the canonical verify payload.</p> <p>Phase 6 — Multi-Baseline Collection</p> <p>RoseLia sends a known-wrong code (111111) through three request variants:</p> <ol> <li>default — payload as-is</li> <li>csrf — payload + CSRF field</li> <li>cookies — payload + session cookies</li> </ol> <p>For each, it captures (status, len, sha256, body[:200]). These baselines are later used by is_success() to distinguish a hit from a generic 200.</p> <p>Phase 7 — Second Account Registration</p> <p>If registration succeeded once, RoseLia registers a second account (account_2). This enables cross-account code reuse testing in the probes phase.</p> <hr> <p>Brute-Force Engine</p> <p>The Brute class is a distributed, resumable, lockout-aware code-space traversal engine.</p> <p>Code-Space Sharding</p> <p>Given digits=6 and total_workers=4, worker 0 handles codes 000000–249999, worker 1 handles 250000–499999, and so on. Within each shard, codes are randomly shuffled to defeat trivial rate-limit heuristics based on sequential order.</p> <p>Concurrency Model</p> <p>RoseLia uses an asyncio.Semaphore to bound in-flight requests:<br> </p> <div class="highlight"><pre class="highlight python"><code><span class="n">sem</span> <span class="o">=</span> <span class="n">asyncio</span><span class="p">.</span><span class="nc">Semaphore</span><span class="p">(</span><span class="n">workers</span><span class="p">)</span> <span class="k">async</span> <span class="k">def</span> <span class="nf">bounded</span><span class="p">(</span><span class="n">code</span><span class="p">)</span><span class="p">:</span> <span class="k">async</span> <span class="k">with</span> <span class="n">sem</span><span class="p">:</span> <span class="k">await</span> <span class="nb">self</span><span class="p">.</span><span class="nf">_try_one</span><span class="p">(</span><span class="nb">next</span><span class="p">(</span><span class="n">accounts_cycle</span><span class="p">)</span><span class="p">,</span> <span class="n">code</span><span class="p">)</span> </code></pre></div> <p></p> <p>Tasks are dispatched in batches of workers * 4, with asyncio.wait(FIRST_COMPLETED) between batches to prevent unbounded memory growth.</p> <p>Rate Limiting</p> <p>If --rps is set, RoseLia inserts await asyncio.sleep(1/rps) between task dispatches, enforcing a global request rate across all workers.</p> <p>429 Handling</p> <p>When a 429 is received:</p> <ol> <li>Parse Retry-After header (seconds or HTTP-date)</li> <li>Set global retry_after value</li> <li>All in-flight _try_one calls block on await asyncio.sleep(retry_after)</li> </ol> <p>This prevents hammering during rate-limit windows.</p> <p>Lockout Detection</p> <p>is_lockout() matches 20+ phrases:<br> </p> <div class="highlight"><pre class="highlight plaintext"><code>too many attempts, account locked, temporarily, try again later, rate limit, blocked for, suspicious activity, verify you are human, captcha, recaptcha, hcaptcha, turnstile </code></pre></div> <p></p> <p>When triggered, the account is added to account_locked and all future _try_one calls for that account short-circuit.</p> <p>Per-Account Limits</p> <p>If --per-account-max is set, each account is limited to N attempts. When exceeded, the account is locked and rotation moves to the next account. This is essential for targets with per-account rate limits.</p> <p>Code Refresh</p> <p>Every 300 seconds, _refresh_loop() re-requests a fresh OTP for each unlocked account via flow.request_url. This keeps codes fresh in case the target rotates them.</p> <p>Hit Detection</p> <p>For each response, is_success() compares against the stored baseline:</p> <ol> <li>301/302/303/307/308 → check Location for success keywords</li> <li>204 → success</li> <li>200 → compare SHA256 against baseline hash (identical = failure)</li> <li>200 → parse JSON, check success/fail keys</li> <li>200 → check success/fail text</li> <li>200 → if length &gt; baseline + 100 and no fail keywords → success</li> </ol> <p>On hit:</p> <ol> <li>Append (account, code) to hits</li> <li>Emit critical finding with evidence</li> <li>Write to --hits file</li> <li>Invoke on_hit callback</li> <li>Call self.stop.set() to halt all workers globally</li> </ol> <p>Resume Support</p> <p>Every attempted code is appended to --resume file. On restart, _load_resume() reads the file and excludes already-tried codes from the shard. This makes brute-force interrupt-safe.</p> <p>Distributed Mode</p> <p>Multiple machines can share the code space via --worker-id and --total-workers. Each machine writes to its own --hits and --resume files; results are merged post-assessment.</p> <hr> <p>Probe Modules</p> <p>RoseLia implements 35+ probes, each targeting a specific class of OTP/MFA implementation flaw. Every probe is precondition-guarded and emits either + (positive), - (negative), or SKIP (precondition unmet).</p> <p>Timing Oracle (timing)</p> <p>Target: Non-constant-time string comparison.</p> <p>Method: For each of 6 positions, send 10 codes varying one digit (d00000, 0d0000, ...) and measure latency. If one digit is 2.5× slower than the median, retry 3 more times; if all 3 confirm, mark as an oracle. Then recover the full code position-by-position using 25 samples per candidate.</p> <p>Verified recovery: The recovered code is sent to the verify endpoint. If is_success() returns True, a critical finding is emitted. Otherwise, a low-severity &quot;unverified candidate&quot; finding.</p> <p>CWE: 208 (Observable Timing Discrepancy)</p> <p>Length Oracle (length)</p> <p>Target: Response length varies by correct-prefix length.</p> <p>Method: For each position, send 10 codes varying one digit. Group responses by (status, len). If exactly one digit produces an anomalous response, record it. Recover full code position-by-position.</p> <p>NoSQL Injection (nosql)</p> <p>Targets: MongoDB/CouchDB verify endpoints accepting objects as code.</p> <p>Payloads:<br> </p> <div class="highlight"><pre class="highlight python"><code><span class="p">{</span><span class="s2">"code"</span><span class="p">:</span> <span class="p">{</span><span class="s2">"$ne"</span><span class="p">:</span> <span class="kc">None</span><span class="p">}</span><span class="p">}</span> <span class="p">{</span><span class="s2">"code"</span><span class="p">:</span> <span class="p">{</span><span class="s2">"$ne"</span><span class="p">:</span> <span class="s2">""</span><span class="p">}</span><span class="p">}</span> <span class="p">{</span><span class="s2">"code"</span><span class="p">:</span> <span class="p">{</span><span class="s2">"$gt"</span><span class="p">:</span> <span class="s2">""</span><span class="p">}</span><span class="p">}</span> <span class="p">{</span><span class="s2">"code"</span><span class="p">:</span> <span class="p">{</span><span class="s2">"$regex"</span><span class="p">:</span> <span class="s2">".*"</span><span class="p">}</span><span class="p">}</span> <span class="p">{</span><span class="s2">"code"</span><span class="p">:</span> <span class="p">{</span><span class="s2">"$exists"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span><span class="p">}</span> <span class="p">{</span><span class="s2">"code"</span><span class="p">:</span> <span class="p">[</span><span class="s2">"000000"</span><span class="p">,</span> <span class="s2">"111111"</span><span class="p">]</span><span class="p">}</span> </code></pre></div> <p></p> <p>CWE: 943 (Improper Neutralization of Special Elements in Data Query Logic)</p> <p>Prototype Pollution (proto)</p> <p>Targets: Node.js targets with naive Object.assign() in verify logic.</p> <p>Payloads:<br> </p> <div class="highlight"><pre class="highlight python"><code><span class="p">{</span><span class="s2">"__proto__"</span><span class="p">:</span> <span class="p">{</span><span class="s2">"verified"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span><span class="p">}</span> <span class="p">{</span><span class="s2">"constructor"</span><span class="p">:</span> <span class="p">{</span><span class="s2">"prototype"</span><span class="p">:</span> <span class="p">{</span><span class="s2">"verified"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span><span class="p">}</span><span class="p">}</span> </code></pre></div> <p></p> <p>CWE: 1321 (Improperly Controlled Modification of Object Prototype Attributes)</p> <p>HTTP Parameter Pollution (hpp)</p> <p>Target: Duplicate JSON keys in raw body ({&quot;code&quot;:&quot;000000&quot;,&quot;code&quot;:&quot;111111&quot;}). Some parsers take the first value, some the last, and some merge — leading to bypass.</p> <p>CWE: 88 (Argument Injection)</p> <p>Method Confusion (method)</p> <p>Target: Verify endpoint accepting PATCH/PUT/OPTIONS in addition to POST, often bypassing CSRF middleware that only guards POST.</p> <p>CWE: 650 (Trusting HTTP Permission Methods on the Server Side)</p> <p>Content-Type Confusion (ct)</p> <p>Targets: Endpoints accepting text/plain, application/x-www-form-urlencoded, or application/xml when only JSON is expected.</p> <p>CWE: 436 (Interpretation of HTTP Content-Type Header)</p> <p>Race Condition (race)</p> <p>Targets: Verify endpoints without atomic code consumption.</p> <p>Method: Fire 10 concurrent requests with the same code. If &gt;1 succeeds, the code was consumed multiple times.</p> <p>CWE: 362 (Concurrent Execution using Shared Resource)</p> <p>JWT Analysis (jwt)</p> <p>Targets: JWT tokens found in verify-endpoint HTML or cookies.</p> <p>Checks:</p> <ol> <li>Weak HMAC secret — brute-forces pyjwt.decode() against 60 common keys (secret, password, jwtsecret, etc.)</li> <li>alg=none — decodes header, checks if algorithm is none</li> </ol> <p>CWE: 521 (Weak Password Requirements) / 347 (Improperly Verified Signature)</p> <p>Cross-Account Code Reuse (cross-account)</p> <p>Targets: Verify endpoints that don&#39;t bind OTP to the requesting account.</p> <p>Method: Request an OTP for account A. Extract the 6-digit code from the response. Submit the same code with account B&#39;s identifier. If accepted, critical finding.</p> <p>CWE: 287 (Improper Authentication)</p> <p>Cross-Flow Code Reuse (cross-flow)</p> <p>Targets: Password-reset codes accepted at the OTP verify endpoint (or vice versa).</p> <p>Method: Request a password reset for account A. Extract the 6-digit code. Submit it to the OTP verify endpoint.</p> <p>Session Fixation (session_fixation)</p> <p>Targets: Verify endpoints accepting a pre-existing session cookie that was set before authentication.</p> <p>Method: Set a known session cookie, complete the verify flow, and check whether the cookie value is rotated. No rotation = fixation.</p> <p>CWE: 384 (Session Fixation)</p> <p>Backup Code Testing (backup_code)</p> <p>Targets: Verify endpoints accepting backup codes (8–10 digits) when OTP is 6 digits.</p> <p>Method: Try common backup codes (00000000, 12345678, 11111111, etc.) against the verify endpoint.</p> <p>SSRF (ssrf)</p> <p>Targets: Verify endpoints accepting a URL parameter (e.g., callback, webhook).</p> <p>Payloads: Internal IPs (127.0.0.1, 169.254.169.254), cloud metadata endpoints, file:// URIs.</p> <p>CWE: 918 (Server-Side Request Forgery)</p> <p>X-Forwarded-For (xff)</p> <p>Targets: Per-IP rate limits keyed on X-Forwarded-For without validation.</p> <p>Method: Send verify requests with rotating XFF headers. If lockout is bypassed, informational finding.</p> <p>CWE: 290 (Authentication Bypass by Spoofing)</p> <p>CORS Misconfiguration (cors)</p> <p>Targets: Verify endpoints returning Access-Control-Allow-Origin: * or reflecting arbitrary Origin.</p> <p>CWE: 942 (Permissive Cross-domain Policy)</p> <p>Host Header Injection (host_header)</p> <p>Targets: Verify endpoints using Host: header for password-reset link generation.</p> <p>Method: Send request with Host: attacker.example. If the response includes attacker.example, informational finding.</p> <p>CWE: 644 (Improper Neutralization of HTTP Headers)</p> <p>Cache Deception (cache_deception)</p> <p>Targets: Verify endpoints where a trailing /<anything>.css triggers cache storage while returning the same response.</p> <p>Method: Send request to /verify/foo.css and compare to /verify. If identical and cacheable, potential cache deception.</p> <p>CWE: 525 (Use of Web Browser Cache Containing Sensitive Information)</p> <p>Cache Poisoning (cache_poison)</p> <p>Targets: Verify endpoints vulnerable to response-header injection.</p> <p>Method: Send X-Forwarded-Host: attacker.example and observe whether it appears in the response or headers.</p> <p>CWE: 349 (Acceptance of Extraneous Untrusted Data)</p> <p>Open Redirect (open_redirect)</p> <p>Targets: Verify endpoints accepting a redirect_uri parameter.</p> <p>Method: Send ?redirect_uri=<a href="https://attacker.example">https://attacker.example</a>. If the 302 Location matches the attacker host exactly, critical finding.</p> <p>CWE: 601 (URL Redirection to Untrusted Site)</p> <p>XXE (xxe)</p> <p>Targets: Verify endpoints accepting XML payloads.</p> <p>Payload:<br> </p> <div class="highlight"><pre class="highlight xml"><code><span class="cp">&lt;?xml version="1.0"?&gt;</span> <span class="cp">&lt;!DOCTYPE r [ &lt;!ENTITY xxe SYSTEM "file:///etc/passwd"&gt;</span> ]&gt; <span class="nt">&lt;r&gt;&lt;code&gt;</span><span class="ni">&amp;xxe;</span><span class="nt">&lt;/code&gt;&lt;/r&gt;</span> </code></pre></div> <p></p> <p>Sent with Content-Type: application/xml. If /etc/passwd content appears in the response, critical finding.</p> <p>CWE: 611 (Improper Restriction of XML External Entity Reference)</p> <p>LDAP Injection (ldap)</p> <p>Targets: Verify endpoints backed by LDAP user lookup.</p> <p>Payload: {&quot;account&quot;: &quot;<em>)(uid=</em>&quot;, &quot;code&quot;: &quot;000000&quot;}</p> <p>CWE: 90 (LDAP Injection)</p> <p>SSTI (ssti)</p> <p>Targets: Verify endpoints reflecting account name into templates.</p> <p>Payload: {&quot;account&quot;: &quot;{{7*7}}&quot;, &quot;code&quot;: &quot;000000&quot;} — if 49 appears in response, likely vulnerable.</p> <p>CWE: 1336 (Server-Side Template Injection)</p> <p>Method Fuzzing (method_fuzz)</p> <p>Target: Enumerate all HTTP methods (GET, POST, PUT, PATCH, DELETE, OPTIONS, TRACE, CONNECT, PROPFIND). TRACE enabled = likely finding.</p> <p>CWE: 749 (Exposed Dangerous Method or Function)</p> <p>Method Override (method_override)</p> <p>Targets: Servers honoring X-HTTP-Method-Override or _method parameters, bypassing POST-only CSRF guards.</p> <p>CWE: 650</p> <p>H2C Probe (h2c_probe)</p> <p>Targets: HTTP/2 cleartext upgrade support — often a sign of misconfigured reverse proxies.</p> <p>JSONP Probe (jsonp_probe)</p> <p>Targets: Verify endpoints accepting ?callback= and reflecting into JS.</p> <p>CWE: 79 (Cross-site Scripting)</p> <p>Auth Header Bypass (auth_header_bypass)</p> <p>Targets: Verify endpoints reading authentication from X-User-Id, X-Auth-User, X-Remote-User, etc., which can be spoofed.</p> <p>CWE: 290</p> <p>URL Rewrite Bypass (url_rewrite_bypass)</p> <p>Targets: WAF bypass via path traversal (/api/v1/verify/../v1/verify), URL encoding (%2f), double encoding (%252f), and semicolon insertion (/verify;.css).</p> <p>CWE: 22 (Path Traversal)</p> <p>CSRF for MFA (csrf_mfa)</p> <p>Targets: Verify endpoints lacking CSRF protection — allows an attacker site to submit arbitrary codes on behalf of a victim.</p> <p>CWE: 352 (Cross-Site Request Forgery)</p> <p>MFA Downgrade (mfa_downgrade)</p> <p>Targets: Verify endpoints accepting mfa=false, skip_mfa=1, or otp_required=false parameters.</p> <p>CWE: 287</p> <p>GraphQL Introspection (graphql_introspect)</p> <p>Targets: GraphQL endpoints exposed alongside the OTP flow.</p> <p>Method: Send query { __schema { types { name } } }. If full schema is returned, informational finding.</p> <p>CWE: 200 (Exposure of Sensitive Information)</p> <p>ID Enumeration (id_enum)</p> <p>Targets: OTP request endpoints returning different responses for existing vs. non-existing accounts.</p> <p>Method: Compare response bodies for a known account vs. a random account.</p> <p>CWE: 204 (Observable Response Discrepancy)</p> <p>Mass Assignment (mass_assignment)</p> <p>Targets: Verify endpoints accepting extra fields like verified: true, role: admin, is_admin: 1.</p> <p>Method: Add each extra field to the verify payload and check for success.</p> <p>CWE: 915 (Improperly Controlled Modification of Dynamically-Determined Object Attributes)</p> <p>URL Parameter Pollution (param_pollution_url)</p> <p>Target: Duplicate query parameters (?code=000000&amp;code=111111) — different parsers take different values.</p> <p>CWE: 235 (Improper Handling of Extra Parameters)</p> <p>Response Manipulation (response_manip)</p> <p>Target: Verify endpoints where success is determined client-side by inspecting response fields like success: false — a client can flip this via devtools. Detects this pattern by inspecting response schema.</p> <p>CWE: 602 (Client-Side Enforcement of Server-Side Security)</p> <p>Subdomain Takeover (subdomain_takeover)</p> <p>Target: SAN hostnames from TLS certificate enumeration that resolve to dangling CNAME records.</p> <p>Method: DNS-resolve each SAN hostname. If NXDOMAIN but CNAME points to a known takeover provider (Heroku, AWS S3, GitHub Pages, etc.), critical finding.</p> <p>CWE: 350 (Reliance on Reverse DNS Resolution)</p> <hr> <p>Output &amp; Reporting</p> <p>Live ANSI Panel</p> <p>RoseLia emits a continuously-updated status line at the bottom of the terminal:<br> </p> <div class="highlight"><pre class="highlight plaintext"><code>▸ req 1234 rps 48.2 hits 1 cf 0 err 2 st brute-force </code></pre></div> <p></p> <p>Plus per-event log lines:<br> </p> <div class="highlight"><pre class="highlight plaintext"><code>[12:34:56] [RECON] /api/v1/otp/verify 200 (412b) [12:34:58] [ev] {"account":"rose123@example.test","code":"482916"} [12:35:01] [HIT] rose123@example.test -&gt; 482916 (14203 reqs) [12:35:01] [CRIT] F001 OTP brute-force: 482916 </code></pre></div> <p></p> <p>Section headers use box-drawing characters:<br> </p> <div class="highlight"><pre class="highlight plaintext"><code>╭─ RECON-1 wordlist (paths) ──────────────────────────────────╮ ▸ paths tested 418 ▸ unique endpoints 24 ▸ noise filtered 12 ╰──────────────────────────────────────────────────────────────╯ </code></pre></div> <p></p> <p>JSON Findings</p> <p>Every finding is emitted as a JSON object:<br> </p> <div class="highlight"><pre class="highlight json"><code><span class="p">{</span> <span class="nl">"id"</span><span class="p">:</span> <span class="s2">"F001"</span><span class="p">,</span> <span class="nl">"title"</span><span class="p">:</span> <span class="s2">"OTP brute-force: 482916"</span><span class="p">,</span> <span class="nl">"severity"</span><span class="p">:</span> <span class="s2">"critical"</span><span class="p">,</span> <span class="nl">"category"</span><span class="p">:</span> <span class="s2">"bruteforce"</span><span class="p">,</span> <span class="nl">"endpoint"</span><span class="p">:</span> <span class="s2">"https://target.example.com/api/v1/otp/verify"</span><span class="p">,</span> <span class="nl">"description"</span><span class="p">:</span> <span class="s2">"rose123@example.test: 482916 accepted"</span><span class="p">,</span> <span class="nl">"evidence"</span><span class="p">:</span> <span class="p">{</span> <span class="nl">"account"</span><span class="p">:</span> <span class="s2">"rose123@example.test"</span><span class="p">,</span> <span class="nl">"code"</span><span class="p">:</span> <span class="s2">"482916"</span><span class="p">,</span> <span class="nl">"attempts"</span><span class="p">:</span> <span class="mi">14203</span><span class="p">,</span> <span class="nl">"status"</span><span class="p">:</span> <span class="mi">200</span><span class="p">,</span> <span class="nl">"body"</span><span class="p">:</span> <span class="s2">"{\"success\":true,\"token\":\"eyJ...\"}"</span> <span class="p">}</span><span class="p">,</span> <span class="nl">"remediation"</span><span class="p">:</span> <span class="s2">"rate-limit per-account + per-IP, longer codes, constant-time verify"</span><span class="p">,</span> <span class="nl">"cwe"</span><span class="p">:</span> <span class="s2">"CWE-307"</span> <span class="p">}</span> </code></pre></div> <p></p> <p>The full findings array is written to --json (default findings.json).</p> <p>Hits File</p> <p>Each successful code is appended as a JSONL line:<br> </p> <div class="highlight"><pre class="highlight json"><code><span class="p">{</span><span class="nl">"account"</span><span class="p">:</span><span class="s2">"rose123@example.test"</span><span class="p">,</span><span class="nl">"code"</span><span class="p">:</span><span class="s2">"482916"</span><span class="p">,</span><span class="nl">"ts"</span><span class="p">:</span><span class="s2">"2024-05-15T12:35:01Z"</span><span class="p">}</span> </code></pre></div> <p></p> <p>Resume File</p> <p>Each attempted code is appended as a plain line:<br> </p> <div class="highlight"><pre class="highlight plaintext"><code>000000 000001 000002 ... </code></pre></div> <p></p> <p>Severity Mapping</p> <p>Severity Color Examples<br> critical red OTP brute-force, timing recovery, .git exposure<br> high orange NoSQL injection, JWT weak key, API spec leak<br> medium yellow Content-type confusion, method confusion<br> low cyan Unverified timing candidate, method not rejected<br> info neon Open registration, missing CSP, cache detected</p> <hr> <p>Configuration Reference</p> <p>RoseLia reads no external config file — all configuration is via CLI flags. However, for repeatability, wrap your invocation in a shell script:<br> </p> <div class="highlight"><pre class="highlight shell"><code><span class="c">#!/usr/bin/env bash</span> <span class="c"># assess-target.sh</span> <span class="nb">set</span> -euo pipefail python3 roselia.py <span class="s2">"$1"</span> \ --workers 1000 \ --digits 6 \ --max-req 500000 \ --per-account-max 5000 \ --hits <span class="s2">"hits-$(date +%s).jsonl"</span> \ --resume <span class="s2">"resume-$(date +%s).txt"</span> \ --json <span class="s2">"findings-$(date +%s).json"</span> \ --timeout 8 </code></pre></div> <p></p> <p>For distributed assessments, use a wrapper that computes --worker-id from a host-index environment variable.</p> <hr> <p>Advanced Usage Patterns</p> <p>Pattern 1 — Recon-Only API Audit</p> <p>Target: a JSON API with no HTML.<br> </p> <div class="highlight"><pre class="highlight shell"><code>python3 roselia.py https://api.example.com \ --recon-only \ --no-js \ --no-sitemap \ --json api-recon.json </code></pre></div> <p></p> <p>This skips JS analysis (which would find nothing) and sitemap crawling (absent) while still hitting all 400 wordlist paths and OpenAPI specs.</p> <p>Pattern 2 — Brute-Force With Pre-Existing Account</p> <p>Target: a system where you have valid test credentials but not full admin.<br> </p> <div class="highlight"><pre class="highlight shell"><code>python3 roselia.py https://target.example.com \ --account testuser@example.com \ --password <span class="s1">'Test123!'</span> \ --verify-url https://target.example.com/api/auth/mfa/verify \ --request-url https://target.example.com/api/auth/mfa/request \ --no-register \ --no-probes \ --workers 2000 \ --rps 200 </code></pre></div> <p></p> <p>This skips registration (fails on locked-down systems) and probes (may trigger WAF), running only the brute-force.</p> <p>Pattern 3 — Timing Oracle Attack</p> <p>Target: suspected timing side-channel.<br> </p> <div class="highlight"><pre class="highlight shell"><code>python3 roselia.py https://target.example.com \ --account target@example.com \ --no-register \ --no-brute </code></pre></div> <p></p> <p>The timing probe runs in the probes phase and attempts full code recovery.</p> <p>Pattern 4 — Distributed Assessment (4 machines)</p> <p>Machine 0:<br> </p> <div class="highlight"><pre class="highlight shell"><code>python3 roselia.py https://target \ --worker-id 0 --total-workers 4 \ --workers 500 --hits hits-0.jsonl --resume resume-0.txt </code></pre></div> <p></p> <p>Machine 1:<br> </p> <div class="highlight"><pre class="highlight shell"><code>python3 roselia.py https://target \ --worker-id 1 --total-workers 4 \ --workers 500 --hits hits-1.jsonl --resume resume-1.txt </code></pre></div> <p></p> <p>After all machines finish, merge:<br> </p> <div class="highlight"><pre class="highlight shell"><code>cat hits-*.jsonl <span class="o">|</span> sort -u <span class="o">&gt;</span> hits-all.jsonl </code></pre></div> <p></p> <p>Pattern 5 — Targeted Probe Run</p> <p>Target: you have a fully-mapped flow and want to run probes only.<br> </p> <div class="highlight"><pre class="highlight shell"><code>python3 roselia.py https://target \ --account known@example.com \ --password <span class="s1">'KnownPass1!'</span> \ --no-brute \ --verbose </code></pre></div> <p></p> <p>Pattern 6 — Stealth Mode</p> <p>Target: WAF-protected site where aggressive probing triggers blocks.<br> </p> <div class="highlight"><pre class="highlight shell"><code>python3 roselia.py https://target \ --workers 50 \ --rps 5 \ --timeout 15 \ --no-brute </code></pre></div> <p></p> <p>Low concurrency + rate limit + long timeout produces slow but reliable results.</p> <hr> <p>Performance Tuning</p> <p>Brute-force throughput depends on five factors:</p> <ol> <li>Server response time — dominates per-request latency</li> <li>Concurrency — in-flight requests</li> <li>Target rate limits — 429 responses cap throughput</li> <li>Worker count — CPU-limited at high concurrency</li> <li>Network latency — round-trip delay</li> </ol> <p>Rules of Thumb</p> <p>Server latency Recommended workers Recommended rps<br> &lt;50ms 2000+ 0 (unlimited)<br> 50–200ms 500–1000 0<br> 200–500ms 200–500 0<br> 500ms–1s 100–200 20–50<br> 1s 50–100 5–20</p> <p>Memory Footprint</p> <p>RoseLia materializes its shard into a Python list. For digits=6 (10^6 codes), each worker&#39;s shard is ~250k strings ≈ 30MB. For digits=8 (10^8 codes), use --max-req to bound the shard:<br> </p> <div class="highlight"><pre class="highlight shell"><code>--digits 8 --max-req 5000000 --workers 1000 </code></pre></div> <p></p> <p>This caps each shard at 5M codes ≈ 600MB.</p> <p>CPU Saturation</p> <p>At --workers &gt; 2000, Python&#39;s GIL becomes a bottleneck even with asyncio. Use --workers 1000 and multiple --worker-id shards across processes for higher total throughput.</p> <p>curl_cffi vs aiohttp</p> <p>curl_cffi provides TLS fingerprint impersonation, which bypasses Cloudflare/Akamai bot detection. However, it has higher per-request overhead (~15% slower). Use curl_cffi when the target blocks aiohttp, otherwise aiohttp is faster.</p> <hr> <p>Legal &amp; Ethical Guidelines</p> <p>Authorized Use Only</p> <p>RoseLia is a professional security assessment tool intended for:</p> <p>· Authorized penetration tests — under a signed Statement of Work (SOW)<br> · Bug bounty programs — within the program&#39;s scope and rules<br> · CTF competitions — where the target is explicitly in-scope<br> · Internal red-team exercises — with written approval from a CISO<br> · Security research — against systems you own</p> <p>Prohibited Use</p> <p>Do NOT use RoseLia to:</p> <p>· Test systems you do not own and have not received written, explicit permission to test<br> · Perform denial-of-service attacks (high --rps against production systems)<br> · Access, modify, or exfiltrate data beyond the scope of your authorization<br> · Bypass authentication on systems where you are not the authorized owner<br> · Assist in any activity that violates local, state, federal, or international law</p> <p>OTP Brute-Force Specifics</p> <p>OTP brute-force is inherently noisy and will trigger rate limits, lockouts, and security alerts on the target system. Before running brute-force:</p> <ol> <li>Confirm written authorization — email from a client with scope</li> <li>Notify the SOC/blue team — tell them exactly when you&#39;ll be testing</li> <li>Agree on an emergency stop procedure — a phone number to call if the target escalates</li> <li>Set conservative rate limits — do not saturate the target&#39;s infrastructure</li> <li>Stop immediately on lockout — do not push through (RoseLia honors this via --per-account-max)</li> </ol> <p>Data Handling</p> <p>RoseLia writes findings, hits, and resume files to disk. These may contain PII, tokens, and credentials. Handle them accordingly:</p> <p>· Store on encrypted disk<br> · Delete after engagement conclusion<br> · Never upload to public repositories<br> · Report any accidental credential disclosure to the target immediately</p> <p>Legal Disclaimer</p> <p>The authors of RoseLia accept no liability for misuse of this tool. You are solely responsible for ensuring your use complies with all applicable laws and regulations, including:</p> <p>· Computer Fraud and Abuse Act (CFAA) — United States<br> · Computer Misuse Act — United Kingdom<br> · Cybercrime Act — Australia<br> · GDPR — European Union (if PII is accessed)<br> · PDPA — Singapore</p> <p>If you are unsure whether you are authorized to test a target, do not run RoseLia. Consult with legal counsel first.</p> <hr> <p>Troubleshooting</p> <p>ModuleNotFoundError: No module named &#39;aiohttp&#39;<br> </p> <div class="highlight"><pre class="highlight shell"><code>pip install aiohttp </code></pre></div> <p></p> <p>curl_cffi install fails on Termux or Alpine</p> <p>Use the fallback transport — RoseLia works without curl_cffi:<br> </p> <div class="highlight"><pre class="highlight shell"><code>python3 roselia.py https://target --no-curl </code></pre></div> <p></p> <p>All wordlist paths return 200 (412032b)</p> <p>The target is a single-page application (SPA) with a catch-all route. RoseLia&#39;s noise filter marks these as noise after the first 20, but if every path is 200 (412032b), the filter marks all of them. Workaround: use --wordlist with paths that the SPA doesn&#39;t catch-all (e.g., /api/, /.well-known/).</p> <p>Brute-force stops immediately with &quot;no verify endpoint&quot;</p> <p>Flow discovery failed to identify the verify endpoint. Manually specify:<br> </p> <div class="highlight"><pre class="highlight shell"><code>--verify-url https://target/api/v1/otp/verify </code></pre></div> <p></p> <p>Brute-force runs but finds no hits after millions of requests</p> <p>Possible causes:</p> <ol> <li>Code space larger than 10^6 — try --digits 7 or --digits 8</li> <li>Per-account lockout after ~5 attempts — try --per-account-max 5 --accounts accounts.txt (many accounts)</li> <li>Baseline detection broken — try --no-probes to isolate</li> <li>Per-IP lockout — use --proxy with rotating residential proxies</li> </ol> <p>Target returns Cloudflare 403 for every request</p> <p>curl_cffi is not active. Verify:<br> </p> <div class="highlight"><pre class="highlight shell"><code>python3 -c <span class="s2">"from curl_cffi.requests import AsyncSession; print('OK')"</span> </code></pre></div> <p></p> <p>If curl_cffi is installed but 403s persist, try a different impersonation profile:<br> </p> <div class="highlight"><pre class="highlight shell"><code>--no-random-ua </code></pre></div> <p></p> <p>(RoseLia pins one profile per session when this flag is set.)</p> <p>RuntimeError: Event loop is closed on exit</p> <p>This is a known harmless artifact of asyncio cleanup on Python 3.9. RoseLia installs a custom sys.unraisablehook to suppress it. If you still see it, upgrade Python to 3.10+.</p> <p>Brute-force hangs at &quot;worker N/M | slice 0 codes&quot;</p> <p>The resume file has recorded all codes in this worker&#39;s shard. Delete the resume file or use a different --worker-id:<br> </p> <div class="highlight"><pre class="highlight shell"><code>rm resume.txt <span class="c"># or</span> --worker-id 2 --total-workers 4 </code></pre></div> <p></p> <p>Findings contain false positives on timing probe</p> <p>The timing probe requires a 2.5× latency ratio with 3/3 confirmation. On very fast targets (&lt;5ms response), statistical noise can pass this threshold. If you suspect false positives, check the evidence.positions array — if more than 3 positions are flagged, the target likely has jitter rather than a real oracle.</p> <hr> <p>FAQ</p> <p>Q: Can RoseLia test SMS-based OTP?<br> A: Yes, if you provide the phone number via --account +8801700000000. RoseLia does not have SMS interception capability — it relies on you providing the phone and, if needed, the received code via --account and --password for existing sessions.</p> <p>Q: Does RoseLia work on 8-digit OTPs?<br> A: Yes, --digits 8 covers 10^8 = 100 million codes. At 1000 req/s, full traversal takes ~28 hours. Use --max-req to cap.</p> <p>Q: Can I use RoseLia with a SOCKS5 proxy?<br> A: Yes, via --proxy socks5://127.0.0.1:9050. Note that curl_cffi supports SOCKS5 natively; aiohttp requires aiohttp-socks.</p> <p>Q: How do I integrate RoseLia with Burp Suite?<br> A: Point RoseLia at Burp&#39;s proxy (--proxy <a href="http://127.0.0.1:8080">http://127.0.0.1:8080</a> --insecure), then inspect the traffic in Burp&#39;s HTTP history.</p> <p>Q: Does RoseLia write to the target&#39;s database?<br> A: RoseLia only sends HTTP requests. It cannot directly modify a database. However, brute-forcing a valid OTP will authenticate a session, which may cause the target to write session records. This is unavoidable for any auth testing.</p> <p>Q: What if the target&#39;s OTP is alphanumeric?<br> A: RoseLia currently supports digit-only OTPs (--digits N produces zero-padded numeric strings). Alphanumeric support requires modifying Brute._slice() to generate from string.ascii_letters + string.digits.</p> <p>Q: Can I resume a brute-force after a crash?<br> A: Yes, use --resume resume.txt. RoseLia appends every attempted code; on restart, it skips already-tried codes.</p> <p>Q: Why does the tool skip all probes on my target?<br> A: Flow discovery failed. Provide --verify-url manually and re-run. Use --verbose to see the exact reason for each skip.</p> <p>Q: Is RoseLia detectable?<br> A: Yes. Any auth testing generates logs on the target. RoseLia&#39;s TLS impersonation and UA rotation defeat passive fingerprinting but do not hide the volume of requests. Coordinate with the target&#39;s SOC.</p> <p>Q: Can RoseLia be run headless (no terminal)?<br> A: Yes, use --quiet to suppress the live panel. The --json and --hits files still capture all output. The panel is purely cosmetic.</p> <p>Q: Does RoseLia support GraphQL targets?<br> A: Partially. It can discover GraphQL endpoints via recon and run introspection, but it does not currently generate GraphQL-specific OTP verify payloads. You would need to override --verify-url to a GraphQL endpoint and provide --payload-file (not yet implemented).</p> <p>Q: Where are hits stored by default?<br> A: Nowhere. --hits is required to persist hits. Without it, hits are only in the live panel and the findings.json file.</p> <hr> <p>Credits &amp; Acknowledgments</p> <p>Author</p> <p>SYLHETYHACKVENGER (THE-ERROR808)<br> GitHub: @sylhetyhackvenger</p> <p>Inspirations</p> <p>RoseLia&#39;s architecture draws from decades of collective security-tooling knowledge:</p> <p>· curl_cffi by lexiforest — for TLS fingerprint impersonation<br> · aiohttp by the aio-libs team — for async HTTP<br> · requests by Kenneth Reitz — for the synchronous fallback<br> · pyjwt by José Padilla — for JWT analysis<br> · esprima by the esprima team — for AST extraction<br> · Nuclei — for the concept of template-driven probes<br> · ffuf, gobuster, dirsearch — for wordlist recon patterns<br> · Burp Suite Intruder — for the baseline-hit comparison model</p> <p>Special Thanks</p> <p>· The bug-bounty community, for documenting common OTP implementation flaws<br> · The OWASP Foundation, for the Authentication Cheat Sheet that shaped many of the probe designs<br> · The CWE team at MITRE, for the standardized weakness taxonomy used throughout the findings output<br> · The many unnamed researchers whose public writeups on OTP bypass techniques informed the probe suite</p> <p>Contributing</p> <p>RoseLia is not accepting external contributions at this time. If you discover a vulnerability in RoseLia itself, please email the author privately — do not open a public issue.</p> <hr> <p>Changelog</p> <p>v1.0.0 — Initial Release</p> <p>· 13-stage reconnaissance pipeline<br> · 400+ path wordlist<br> · Webpack chunk and source-map extraction<br> · AST-based JS API discovery<br> · OpenAPI/Swagger parsing<br> · Login state machine with CSRF extraction<br> · Iterative field discovery via error parsing<br> · Multi-baseline hit detection<br> · Async brute-force with 10,000-worker ceiling<br> · Distributed sharding<br> · Resume support<br> · 429 Retry-After handling<br> · Lockout detection (20+ phrases)<br> · 35+ vulnerability probes<br> · JSON findings output with CWE mapping<br> · TLS SAN enumeration<br> · CDN cache detection<br> · Live ANSI status panel</p> <hr> <p>License<br> </p> <div class="highlight"><pre class="highlight plaintext"><code>RoseLia — Autonomous OTP / MFA Assessment Platform Copyright (C) 2024 SYLHETYHACKVENGER (THE-ERROR808) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see &lt;https://www.gnu.org/licenses/&gt;. -------------------------------------------------------------------------- ADDITIONAL NOTICE: This software is intended SOLELY for authorized security testing. Use against systems without explicit written permission is a violation of law in most jurisdictions and is strictly prohibited. The author disclaims all responsibility for misuse. </code></pre></div> <p></p> <hr> <p>Final Note</p> <p>RoseLia is not a tool for &quot;hacking&quot; — it is a tool for measuring, documenting, and remediating. Every feature is designed to produce actionable findings that improve the target&#39;s security posture. Every probe emits a CWE classification and a specific remediation recommendation. Every hit is logged with evidence that a client can use to prioritize fixes.</p> <p>If you are a professional penetration tester, use RoseLia as part of a structured engagement:</p> <ol> <li>Recon — understand the target&#39;s auth flow</li> <li>Probe — identify implementation flaws</li> <li>Exploit — demonstrate real impact (with authorization)</li> <li>Report — deliver findings with remediation guidance</li> <li>Retest — verify fixes</li> </ol> <p>If you are a bug-bounty hunter, respect the program&#39;s scope, rate limits, and disclosure policy. A critical finding is only valuable if it is reported responsibly.</p> <p>If you are a security researcher, treat every target as a production system protecting real users. Never exfiltrate data beyond what is necessary to prove impact. Never publish details before the vendor has patched.</p> <p>Test honestly. Report responsibly. Build safer systems.</p> <p>— SYLHETYHACKVENGER (THE-ERROR808)</p>

Top comments (0)