Skip to main content
Version: 1.3.2

Analyze command

The analyze command is used to analyze a file the output files of JS recon modules to determine if they contain sensitive info or not.

Usage​

js-recon analyze [options]

Options​

OptionAliasDescriptionDefaultRequired
--rules <file/dir>-rRules file or directoryNo
--mapped-json <file>-mMapped JSON filemapped.jsonNo
--tech <tech>-tTechnology used in the JS files (run with -l/--list to see available options)No
--openapi <file>Path to OpenAPI spec fileNo
--list-lList available technologiesfalseNo
--validateValidate the rulesfalseNo
--output <file>-oOutput JSON file nameanalyze.jsonNo

Examples​

Validating custom rules​

Though the tool will validate all the templates automatically, you can also validate them manually using the --validate option.

Assuming that the rules are stored in the ./rules directory, you can run the following command to validate them:

js-recon analyze --validate -r ./rules

Analyzing OpenAPI spec file​

To run analysis on an OpenAPI spec file, make sure that you've generated it using the map command:

js-recon map -d output/<domain> -t <tech> --openapi

This will give a file called mapped-openapi.json in the working directory. To run analysis on this, run the following command:

js-recon analyze --openapi mapped-openapi.json -t <tech>

This will analyze the mapped-openapi.json file against the default rules that would be stored in $HOME/.js-recon/rules.

Built-in detection rules​

The bundled rules detect both request-level misconfigurations (for example, missing Authorization header) and client-side code patterns such as DOM XSS sinks and Client-Side Path Traversal (CSPT). See Predefined rules for the full catalogue and the constraints each rule applies to avoid false positives.