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

deprecate(remove): file write in extractor using to #4565

Merged
merged 10 commits into from
Jan 4, 2024

Conversation

tarunKoyalwar
Copy link
Member

@tarunKoyalwar tarunKoyalwar commented Jan 2, 2024

Proposed Changes

  • This PR changes how data is saved when using to in extractors to save extracted data to file

Caution

This is a breaking change and may break templates containing to field in extractors
Saving extracted values to file using to in extractors has been removed due to following reasons

  • confliction behaviour since one can achieve this by extracting the same from json output nuclei -j
  • data race when template is run with more than 1 target
  • out-of-bound write and other considerations

Note

Saving screenshot to file using to has been made with other filesystem restriction options (i.e -lfa) keeping usability in mind. Now when saving screenshots outside of cwd (i.e parent / sibling directories) -lfa will be required

@tarunKoyalwar tarunKoyalwar self-assigned this Jan 2, 2024
@tarunKoyalwar tarunKoyalwar changed the title fix race-condition & oow in extracted file output fix race-condition & out of bounds write while saving extracted values to file Jan 2, 2024
@tarunKoyalwar tarunKoyalwar marked this pull request as ready for review January 3, 2024 20:49
Copy link
Member

@Mzack9999 Mzack9999 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm - My observations:

  • The to: option should probably be replaced with a deterministic output path as we do in httpx to organize request/response/screenshot and report in the output json the path to the file within a field
  • Multiple templates might point/access to the same file, probably this particular output mechanisms needs a redesign to simplify them as described above

@tarunKoyalwar tarunKoyalwar marked this pull request as draft January 4, 2024 16:43
@tarunKoyalwar tarunKoyalwar marked this pull request as ready for review January 4, 2024 19:07
@tarunKoyalwar tarunKoyalwar changed the title fix race-condition & out of bounds write while saving extracted values to file deprecate(remove): file write in extractor using to Jan 4, 2024
Copy link
Member

@Mzack9999 Mzack9999 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

salute to the 'save to file' feature

@ehsandeep ehsandeep merged commit f663d1c into dev Jan 4, 2024
12 checks passed
@ehsandeep ehsandeep deleted the issue-4546-save-extracted-output branch January 4, 2024 21:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Save to file (extractors) doesn't respect default file system restriction
4 participants