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

Speed improvements and bug fixes #498

Merged
merged 6 commits into from
Nov 29, 2024
Merged

Speed improvements and bug fixes #498

merged 6 commits into from
Nov 29, 2024

Conversation

NeffIsBack
Copy link
Contributor

Description

There are several bug fixes and improvements that have been done:

  • Improved Scanning speed
  • Bug fixes in the logging, so we don't log messages 2x when running debug mode
  • Small fix so we don't display an index error when scanning with null session, e.g. -u ''
  • Removed outdated code

Improvement to scanning speed

We always tried smbv1 and smbv3 when scanning a subnet. In #317 i removed an unnecessary step where we would always try smbv1 against a host where we already know it's gonna be smbv3. With this change we now also don't try smbv3 when the connection for smbv1 times out, as the host is not responding -> it is likely down. This reduces time to scan per subnet from ~5s down to ~3s -> nearly 40% speed improvement for subnet scanning 🎉
image

Fixing duplicate logging message

Before&After:
image

@NeffIsBack NeffIsBack added enhancement New feature or request bug-fix This Pull Request fixes a bug labels Nov 29, 2024
@mpgn
Copy link
Collaborator

mpgn commented Nov 29, 2024

I like the idea ! very clever for the timeout stuff 💪

@NeffIsBack
Copy link
Contributor Author

I like the idea ! very clever for the timeout stuff 💪

Thanks mate!

@Marshall-Hallenbeck
Copy link
Collaborator

With this change we now also don't try smbv3 when the connection for smbv1 times out

If a host is up and smbv1 is disabled, I assume it returns an error there and doesnt just timeout?

@mpgn
Copy link
Collaborator

mpgn commented Nov 29, 2024

With this change we now also don't try smbv3 when the connection for smbv1 times out

If a host is up and smbv1 is disabled, I assume it returns an error there and doesnt just timeout?

Connection reset by peer

@NeffIsBack
Copy link
Contributor Author

With this change we now also don't try smbv3 when the connection for smbv1 times out

If a host is up and smbv1 is disabled, I assume it returns an error there and doesnt just timeout?

Connection reset by peer

Yep exactly, or Error occurs while reading from remote(104). The timeout should only happen if the socket connection does not retrieve an anwsers at all

@NeffIsBack NeffIsBack merged commit 45db7e6 into main Nov 29, 2024
4 checks passed
@NeffIsBack NeffIsBack deleted the neff-bug-fixes branch November 29, 2024 23:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-fix This Pull Request fixes a bug enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants