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

Replacing ccache with generic gcache #3523

Merged
merged 19 commits into from
Apr 16, 2023
Merged

Conversation

Mzack9999
Copy link
Member

@Mzack9999 Mzack9999 commented Apr 10, 2023

Proposed changes

This PR implements the following changes:

  • Really stop execution after first interactsh match (previously: only first match was printed as output, but execution continued under the hood)
  • Replace ccache with auto-prune gcache (doesn't crash if used after close)
  • Drop the need of some lock mechanism to avoid data-race

Checklist

  • Pull request is created against the dev branch
  • All checks passed (lint, unit/integration/regression tests etc.) with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

Notes

  • The logic needs still a radical rework to avoid contrived intersected callbacks, ideally the flow should look like the following one:
    • Requests invoke .URL() and their unique id gets registered
    • Asyncronously interactions are received and matched with the requestId
    • No matching logic/output whatsover should be contained in the interactsh package wrapper (this will avoid endless cases of data race and missed interactions)
    • On request id eviction the matching/extraction/output logic is executed in the caller protocol context

Tracked at #3437 (the current PR implement preparatory changes)

@Mzack9999 Mzack9999 added the Type: Enhancement Most issues will probably ask for additions or changes. label Apr 10, 2023
@Mzack9999 Mzack9999 linked an issue Apr 10, 2023 that may be closed by this pull request
@Mzack9999 Mzack9999 linked an issue Apr 12, 2023 that may be closed by this pull request
@Mzack9999 Mzack9999 marked this pull request as ready for review April 12, 2023 12:48
@Mzack9999 Mzack9999 self-assigned this Apr 12, 2023
@tarunKoyalwar
Copy link
Member

tarunKoyalwar commented Apr 13, 2023

coverting this to draft since there seems to be another deadlock issue in macOS integration test

@tarunKoyalwar tarunKoyalwar marked this pull request as draft April 13, 2023 19:02
@tarunKoyalwar
Copy link
Member

@Mzack9999 @ehsandeep , interactsh related integrations tests seems to be uncertain especially with gh actions . sometimes locally I was also getting failed ^ tests .

  • Previous Commit seperates adds/reorders interactsh related integration_test to new group/section and by default we consider best of 3 as result for these tests
$ for i in {1..10}; do; ./integration-test -protocol interactsh; done    1 ↵
[✓] Test "http/default-matcher-condition.yaml" passed!
[✓] Test "http/interactsh-stop-at-first-match.yaml" passed!
[✓] Test "http/interactsh.yaml" passed!
[✓] Test "http/default-matcher-condition.yaml" passed!
[✓] Test "http/interactsh-stop-at-first-match.yaml" passed!
[✓] Test "http/interactsh.yaml" passed!
[✓] Test "http/default-matcher-condition.yaml" passed!
[✓] Test "http/interactsh-stop-at-first-match.yaml" passed!
[✓] Test "http/interactsh.yaml" passed!
[✓] Test "http/default-matcher-condition.yaml" passed!
[✓] Test "http/interactsh-stop-at-first-match.yaml" passed!
[✓] Test "http/interactsh.yaml" passed!
[✓] Test "http/default-matcher-condition.yaml" passed!
[✓] Test "http/interactsh-stop-at-first-match.yaml" passed!
[✓] Test "http/interactsh.yaml" passed!
[✓] Test "http/default-matcher-condition.yaml" passed!
[✓] Test "http/interactsh-stop-at-first-match.yaml" passed!
[✓] Test "http/interactsh.yaml" passed!
[✓] Test "http/default-matcher-condition.yaml" passed!
[✓] Test "http/interactsh-stop-at-first-match.yaml" passed!
[✓] Test "http/interactsh.yaml" passed!
[✓] Test "http/default-matcher-condition.yaml" passed!
[✓] Test "http/interactsh-stop-at-first-match.yaml" passed!
[✓] Test "http/interactsh.yaml" passed!
[✓] Test "http/default-matcher-condition.yaml" passed!
[✓] Test "http/interactsh-stop-at-first-match.yaml" passed!
[✓] Test "http/interactsh.yaml" passed!
[✓] Test "http/default-matcher-condition.yaml" passed!
[✓] Test "http/interactsh-stop-at-first-match.yaml" passed!
[✓] Test "http/interactsh.yaml" passed!

@tarunKoyalwar tarunKoyalwar marked this pull request as ready for review April 14, 2023 11:38
Copy link
Member

@tarunKoyalwar tarunKoyalwar left a comment

Choose a reason for hiding this comment

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

lgtm !

@tarunKoyalwar tarunKoyalwar self-requested a review April 14, 2023 11:57
@tarunKoyalwar
Copy link
Member

interactsh integration test fails after erroring out 3 times in a row . I think it is safe to assume something is wrong with macOS runner https://github.com/projectdiscovery/nuclei/actions/runs/4699355555/jobs/8332719071?pr=3523

@ehsandeep ehsandeep merged commit 6f4b1ae into dev Apr 16, 2023
@ehsandeep ehsandeep deleted the issue-3437-interact-refactor branch April 16, 2023 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement Most issues will probably ask for additions or changes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Interactsh doesn't respect stop-at-first-match
3 participants