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

adding automatic service check on query #5291

Merged
merged 2 commits into from
Jul 8, 2024
Merged

Conversation

Mzack9999
Copy link
Member

@Mzack9999 Mzack9999 commented Jun 14, 2024

Proposed changes

Partially Closes #5254 (early exit skipping memory leak path under investigation via service fingerprint)

Todo:

  • Investigate Internal buffer leak due to connection wrapper allocating continously buffer (maybe caused by recover()?)

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)

@Mzack9999 Mzack9999 marked this pull request as ready for review June 17, 2024 15:32
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 !

regarding IsMySQL and other service fingerprint check , the goal was to use this in pre-condition to tailor and only run exploits if the port is actually running that particular service

javascript:
  - pre-condition: |
      isPortOpen(Host,Port);
    code: |
      let m = require("nuclei/ssh");
      let c = m.SSHClient();
      let response = c.ConnectSSHInfoMode(Host, Port);
      Export(response);

but looks like recently we have not been following this pattern of pre-condition for mysql , postgres and other db related templates
https://github.com/projectdiscovery/nuclei-templates/blob/main/javascript/enumeration/mysql/mysql-info.yaml
maybe we should update these templates to include pre-condition check as well , because this not only prevents such issues but also reduce error log in verbose mode and etc ( cc: @princechaddha @ehsandeep )

@ehsandeep ehsandeep merged commit 1c24ced into dev Jul 8, 2024
12 checks passed
@ehsandeep ehsandeep deleted the bugfix-5254-psql-mem branch July 8, 2024 11:38
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.

Javascript postgres module cause memory leak
3 participants