Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug in omitempty fields in output #3892

Closed
ehsandeep opened this issue Jun 30, 2023 · 1 comment · Fixed by #3977
Closed

bug in omitempty fields in output #3892

ehsandeep opened this issue Jun 30, 2023 · 1 comment · Fixed by #3977
Labels
defcon31 Status: Completed Nothing further to be done with this issue. Awaiting to be closed. Type: Maintenance Updating phrasing or wording to make things clearer or removing ambiguity.

Comments

@ehsandeep
Copy link
Member

Nuclei version:

latest/dev

Current Behavior:

reference and matched-line added as null in json output

{
  "template": "http/technologies/tech-detect.yaml",
  "template-url": "https://github.com/projectdiscovery/nuclei-templates/blob/main/http/technologies/tech-detect.yaml",
  "template-id": "tech-detect",
  "template-path": "/Users/geekboy/nuclei-templates/http/technologies/tech-detect.yaml",
  "info": {
    "name": "Wappalyzer Technology Detection",
    "author": [
      "hakluke"
    ],
    "tags": [
      "tech"
    ],
    "reference": null,
    "severity": "info",
    "metadata": {
      "max-request": 1
    }
  },
  "matcher-name": "cloudflare",
  "type": "http",
  "host": "https://nuclei.sh",
  "matched-at": "https://nuclei.sh",
  "ip": "172.66.43.44",
  "timestamp": "2023-06-30T15:53:55.805352+05:30",
  "curl-command": "curl -X 'GET' -d '' -H 'Accept: */*' -H 'Accept-Language: en' -H 'User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2919.83 Safari/537.36' 'https://nuclei.sh'",
  "matcher-status": true,
  "matched-line": null
}

Expected Behavior:

Similar to the description and other optional fields, the output should exclude fields with no data.

{
  "template": "http/technologies/tech-detect.yaml",
  "template-url": "https://github.com/projectdiscovery/nuclei-templates/blob/main/http/technologies/tech-detect.yaml",
  "template-id": "tech-detect",
  "template-path": "/Users/geekboy/nuclei-templates/http/technologies/tech-detect.yaml",
  "info": {
    "name": "Wappalyzer Technology Detection",
    "author": [
      "hakluke"
    ],
    "tags": [
      "tech"
    ],
    "severity": "info",
    "metadata": {
      "max-request": 1
    }
  },
  "matcher-name": "cloudflare",
  "type": "http",
  "host": "https://nuclei.sh",
  "matched-at": "https://nuclei.sh",
  "ip": "172.66.43.44",
  "timestamp": "2023-06-30T15:53:55.805352+05:30",
  "curl-command": "curl -X 'GET' -d '' -H 'Accept: */*' -H 'Accept-Language: en' -H 'User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2919.83 Safari/537.36' 'https://nuclei.sh'",
  "matcher-status": true,
}

Steps To Reproduce:

echo nuclei.sh | nuclei -id tech-detect -j | jq .
@ehsandeep ehsandeep added Type: Maintenance Updating phrasing or wording to make things clearer or removing ambiguity. defcon31 labels Jun 30, 2023
@kchason
Copy link
Contributor

kchason commented Jul 24, 2023

I can look into this one, both fields are marked as ignore-empty but I'll do some troubleshooting

@kchason kchason mentioned this issue Jul 24, 2023
4 tasks
@tarunKoyalwar tarunKoyalwar linked a pull request Jul 24, 2023 that will close this issue
4 tasks
@ehsandeep ehsandeep added the Status: Completed Nothing further to be done with this issue. Awaiting to be closed. label Jul 28, 2023
@ehsandeep ehsandeep added this to the nuclei v2.9.10 milestone Jul 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defcon31 Status: Completed Nothing further to be done with this issue. Awaiting to be closed. Type: Maintenance Updating phrasing or wording to make things clearer or removing ambiguity.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants