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

add callback support to StandardWriter #4839

Merged
merged 4 commits into from
Mar 11, 2024
Merged

Conversation

dogancanbakir
Copy link
Member

Proposed changes

Closes #4329

$ go run .
BEEP FOUND RESULT
{"template":"ssl/tls-version.yaml","template-url":"https://cloud.projectdiscovery.io/public/tls-version","template-id":"tls-version","template-path":"/Users/dogancanbakir/nuclei-templates/ssl/tls-version.yaml","info":{"name":"TLS Version - Detect","author":["pdteam","pussycat0x"],"tags":["ssl","tls"],"description":"TLS version detection is a security process used to determine the version of the Transport Layer Security (TLS) protocol used by a computer or server.\nIt is important to detect the TLS version in order to ensure secure communication between two computers or servers.\n","severity":"info","metadata":{"max-request":4}},"type":"ssl","host":"scanme.sh","port":"443","matched-at":"scanme.sh:443","extracted-results":["tls10"],"ip":"128.199.158.128","timestamp":"2024-03-06T15:23:31.957787+03:00","matcher-status":true}
[0:00:01] | Templates: 1 | Hosts: 3 | RPS: 0 | Matched: 1 | Errors: 0 | Requests: 0/12 (0%)
BEEP FOUND RESULT
{"template":"ssl/tls-version.yaml","template-url":"https://cloud.projectdiscovery.io/public/tls-version","template-id":"tls-version","template-path":"/Users/dogancanbakir/nuclei-templates/ssl/tls-version.yaml","info":{"name":"TLS Version - Detect","author":["pdteam","pussycat0x"],"tags":["ssl","tls"],"description":"TLS version detection is a security process used to determine the version of the Transport Layer Security (TLS) protocol used by a computer or server.\nIt is important to detect the TLS version in order to ensure secure communication between two computers or servers.\n","severity":"info","metadata":{"max-request":4}},"type":"ssl","host":"scanme.sh","port":"443","matched-at":"scanme.sh:443","extracted-results":["tls11"],"ip":"128.199.158.128","timestamp":"2024-03-06T15:23:32.677028+03:00","matcher-status":true}
...
^Csignal: interrupt

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)

@dogancanbakir dogancanbakir self-assigned this Mar 6, 2024
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.

when sdk users , use / implement customWriter , we should consider that it mostly likely will not be a standardWriter and could be any implementation ( ex: it could be testutils.MockOutputWriter : which we usually use ) or something else )

i think currently the best way is to use

type MultiWriter struct {
( MultiWriter )

i.e if user already implements a Writer then create a new testutils.MockOutputWriter and assign these callbacks , and combine these two using MulitWriter

what you think ?

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 !

@ehsandeep ehsandeep merged commit e9625d6 into dev Mar 11, 2024
12 checks passed
@ehsandeep ehsandeep deleted the add_sw_callback_support branch March 11, 2024 11:37
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.

ExecuteWithCallback: Callback does not fire if UseOutputWriter is configured
3 participants