Clarify some nuance around JSON extraction in the docs #4270
Closed
byt3bl33d3r
started this conversation in
Ideas
Replies: 2 comments
-
|
Thanks for bringing this up! We appreciate you showing off this use case and bringing a solution, too! |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
This discussion closed automatically due to inactivity. Feel free to reopen or start new if still relevant. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Heya,
I struggled with this for a while and I think it would definitely be worth adding to the docs as this is a common situation. I have a template that basically looks like the below and the application returns a JSON response on each request:
Running nuclei in debug mode (e.g.
nuclei -debug -stats -svd -u http://127.0.0.1 -t lfi.yaml) showed me thatexidandrunidwe're being correctly parsed but they were also being "cleared out" by the time Nuclei issues the last request. Everything that I read from the docs/blogs told me this should be working and I initially thought it was a bug.However, the problem was the following: Nuclei attempts to extract the values of the specified json keys on each request and as Nuclei uses JQ under the hood if a JSON response doesn't contain the specified key JQ returns
nullwhich is a valid value that Nuclei will assign toexidandrunid.In order to keep the values of
exidandrunidI had to modify theextractorsto have the following JQ expression:This way if the key doesn't exist in one of the many JSON response, JQ won't return
nulland Nuclei will keep the previously extracted valid values of the keys.Hopefully this makes sense.
Beta Was this translation helpful? Give feedback.
All reactions