Skip to content

Conversation

@Captain-T2004
Copy link
Contributor

Checklist

  • I have followed the Contributor Guidelines.
  • The code has been thoroughly tested in my local development environment with flake8 and pylint.
  • The code is Python 3 compatible.
  • The code follows the PEP8 styling guidelines with 4 spaces indentation.
  • This Pull Request relates to only one issue or only one feature
  • I have referenced the corresponding issue number in my commit message
  • I have added the relevant documentation.
  • My branch is up-to-date with the Upstream master branch.

Changes proposed in this pull request

This pull request solves issue #715,
Due to internal workings of Paramiko library used to connect to SSH in core_ssh.py, Nettacker was unable to detect an open passwordless SSH server. Adding an exception fixes that problem. But to be on the safe side i have added an empty line to the default passwords list(Nettacker/lib/payloads/passwords/top_1000_common_passwords.txt).

Your development environment

  • OS: Pop-OS
  • OS Version: 22.04
  • Python Version: 3.10

Copy link
Collaborator

@arkid15r arkid15r left a comment

Choose a reason for hiding this comment

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

@Captain-T2004 thanks for digging into this!

I wonder how it worked without the explicit empty password in top 1000 common passwords file.

Please find my suggestion on possible code improvement below. This code needs to be tested for the Dropbear case.

Thank you!

Copy link
Collaborator

@arkid15r arkid15r left a comment

Choose a reason for hiding this comment

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

Hey @Captain-T2004, thanks for the fix!

Here is my another suggestion that needs to be verified:

Copy link
Collaborator

@arkid15r arkid15r left a comment

Choose a reason for hiding this comment

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

You can make it more compact (see the suggestion). Otherwise LGTM, great work!

After testing it rigorously i have found that without the try and except the code doesn't work, so to improve the readability i have added some comments, also added is finally block to close the connection.
As per the suggestions i have replaced try/except with if/else and i have ran multiple tests on my localhost to test and it is working.
I have made the suggested changes to the code to make it more concise and easy to read. I have taken time to test it and make sure it works( it does ).
Copy link
Collaborator

@arkid15r arkid15r left a comment

Choose a reason for hiding this comment

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

I've tested the PR, it works (Dropbear v2022.83). I'm merging this.

Thanks everyone!

@arkid15r arkid15r linked an issue Mar 11, 2024 that may be closed by this pull request
@arkid15r arkid15r merged commit 81b8425 into OWASP:master Mar 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ssh_brute: Detect open dropbear server

3 participants