Skip to main content
Version: 1.3.1

Run command

The run command is a powerful feature that automates most of the JavaScript reconnaissance workflow by executing a series of modules in a predefined order. This command is ideal for users who want to perform a basic analysis of a target without running each module individually.

Workflow

The run command executes the following modules in sequence. The exact steps depend on the detected framework — Next.js runs the full pipeline described below, Vue.js and Svelte/Astro run a shorter lazyload → map → analyze → report pipeline, and the tool will exit after lazyload for any unsupported framework.

  1. Lazy Load (Initial): Downloads the initial set of JavaScript files from the target URL.
  2. Strings (Initial): Extracts strings, URLs, and paths from the downloaded JavaScript files.
  3. Lazy Load (Subsequent Requests - for Next.js): Downloads additional JavaScript files discovered from the extracted URLs and paths.
  4. Strings (Final): Performs another round of string extraction on the newly downloaded files to find more endpoints, secrets, and other valuable information.
  5. Lazy Load (Re-pass): Re-runs subsequent-request crawling with the freshly extracted paths. The first crawl can only use paths that were visible in the initial chunks; dynamic-route paths like /post/1 are typically only discovered after the first crawl + strings extraction, so this re-pass picks up the chunks for those routes (for example, dynamic React pages whose code only ships when the URL is visited).
  6. Strings (Re-pass): Final strings extraction across all chunks (initial + both crawl passes) so any new endpoints from the freshly fetched code are also indexed.
  7. Map: Maps all the functions and their relationships within the JavaScript files to provide a clear overview of the application's structure.
  8. Endpoints: Analyzes the JS files and mapped.json to identify and list all client-side endpoints.
  9. Analyze: Runs the analyze module to check the code against the rules.
  10. Report: Generates a report based on the results of the analyze module.

Usage

js-recon run -u <url/file> [options]

Required arguments

  • -u, --url <url/file>: The target URL or a file containing a list of URLs (one per line).

Options

OptionAliasDescriptionDefaultRequired
--url <url>-uTarget URLYes
--output <directory>-oOutput directoryoutputNo
--strict-scopeDownload JS files from only the input URL domainfalseNo
--scope <scope>-sDownload JS files from specific domains (comma-separated)*No
--threads <threads>-tNumber of threads to use1No
--rules <file/dir>-rRules file or directory (passed to analyze module)No
--command <command>-cRun an interactive-mode command non-interactively, forwarded to the map step. Repeatable, and a single value can chain commands with && (for example, -c "list fetch && esquery * fetch").No
--api-gatewayGenerate requests using API GatewayfalseNo
--api-gateway-config <file>API Gateway config file.api_gateway_config.jsonNo
--cache-file <file>File to store response cache.resp_cache.jsonNo
--disable-cacheDisable response cachingfalseNo
--cache-onlyOnly use the response cache; never make network requests. See Load command.falseNo
--yes-yAuto-approve executing JS code from the targetfalseNo
--secretsScan for secretsfalseNo
--ai <options>Use AI to analyze the code (comma-separated; available: description)No
--ai-threads <threads>Number of threads to use for AI5No
--ai-provider <provider>Service provider to use for AI (available: openai, ollama)openaiNo
--ai-endpoint <endpoint>Endpoint to use for AI service (for Ollama, etc)No
--openai-api-key <key>OpenAI API keyNo
--model <model>AI model to usegpt-4o-miniNo
--map-openapi-chunk-tagAdd chunk ID tag to OpenAPI spec for each request found (map module)falseNo
--no-graphql--ngqlDisable GraphQL operation extraction in the map stepenabledNo
--timeoutRequest timeout in ms30000No
--insecure-kDisable SSL certificate verificationfalseNo
--no-sandboxDisable browser sandboxfalseNo
--sourcemap-dir <directory>Directory to write reconstructed source mapsextractedNo
--researchEnable research modefalseNo
--research-output <file>Output file for research moderesearch.jsonNo
--max-iterations <iterations>Maximum number of recursive crawl iterations10No
--max-js-size <mb>Maximum JS file size in MB to parse (Vue only)2No
--lazyload-timeout <minutes>Hard timeout for each lazyload step in minutes. The step stops and the pipeline continues after this many minutes. Use 0 to disable.30No
--max-heap <mb>Cap the V8 heap in MB before any pipeline work starts. 0 sets the limit to 100% of available RAM (os.totalmem()); any positive integer sets an explicit ceiling. Useful on memory-constrained hosts and containers to prevent SIGSEGV (exit 139) in the map step.0No
--max-pages <pages>Maximum number of HTML pages the Next.js crawler will visit across all recursive passes. 0 disables the limit. Prevents memory exhaustion on event-heavy sites with large link graphs. See Lazyload — page visit cap.200No
-h, --helpdisplay help for commandNo

Ctrl-C / Interrupt handling

Pressing Ctrl-C while run is active shows an interactive menu instead of immediately killing the process:

[!] Interrupted. What would you like to do?
1. Skip the current step
2. Skip the current target and move to the next (batch mode only)
3. Exit (or "2. Exit" in single-URL mode)
ChoiceEffect
1 — Skip stepThe current pipeline step (lazyload, strings, map, etc.) is abandoned and the next step starts immediately. The skipped step may still finish in the background, but its result is not waited for.
2 — Skip target (batch only)Remaining steps for the current target are abandoned and run moves to the next URL in the list.
Last — ExitThe process exits cleanly (process.exit(0)).

Pressing Ctrl-C a second time during the menu prompt falls through to the OS default (immediate termination).

Example

Run all modules on target, scan for secrets, and generate AI descriptions

js-recon run -u https://example.com --secrets --ai description

This command will perform a full analysis on https://example.com, save the JavaScript files to the output directory, scan for secrets, and use AI to generate descriptions for the mapped functions.