mirror of https://github.com/OWASP/Nettacker.git
Detecting open Dropbear server (#808)
* Detecting open Dropbear server * Making code more readable 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. * Replaced try/except with if/else 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. * Made the code concise 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 ).
This commit is contained in:
parent
ecfcf42fb2
commit
81b842563b
|
@ -22,10 +22,14 @@ class NettackSSHLib:
|
|||
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
||||
ssh.connect(
|
||||
hostname=host,
|
||||
username=usernames,
|
||||
password=passwords,
|
||||
port=int(ports),
|
||||
timeout=int(timeout)
|
||||
timeout=int(timeout),
|
||||
auth_strategy=paramiko.auth_strategy.Password(
|
||||
username=usernames,
|
||||
password_getter=lambda:passwords
|
||||
) if passwords else paramiko.auth_strategy.NoneAuth(
|
||||
username=usernames
|
||||
),
|
||||
)
|
||||
ssh.close()
|
||||
return {
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
|
||||
123456
|
||||
password
|
||||
12345678
|
||||
|
@ -997,4 +998,4 @@ brazil
|
|||
01011980
|
||||
wildcat
|
||||
polina
|
||||
freepass
|
||||
freepass
|
||||
|
|
Loading…
Reference in New Issue