Skip to content

extractors add variable support #2647

@capiton0

Description

@capiton0

Please describe your feature request:

This is the json data returned from the target site:

{
 "subdomain": ["www","m","mail"]
}

This is the extractors syntax I use:

    extractors:
      - type: json
        part: body
        name: subdomain
        json:
          - '.subdomain[]'

The final output:

[test:status-1] [http] [info] https://test.com/subdomains [www,m,mail]

Describe the use case of this feature:

I want to add variables to the output

variables:
 domain: "xxx.com"

     extractors:
      - type: json
        part: body
        name: subdomain
        json:
          - '"\(.subdomain[]).{{domain}}"'

or

nuclei -var domain=xxx.com
     extractors:
      - type: json
        part: body
        name: subdomain
        json:
          - '"\(.subdomain[]).{{domain}}"'

Let the final output look like this:

[test:status-1] [http] [info] https://test.com/subdomains [www.xxx.com,m.xxx.com,mail.xxx.com]

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type: EnhancementMost issues will probably ask for additions or changes.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions