mozilla / ssh_scan

DEPRECATED - A prototype SSH configuration and policy scanner (Blog: https://mozilla.github.io/ssh_scan/)
Mozilla Public License 2.0
793 stars 105 forks source link

Can't fix this problem #429

Closed mariobranco closed 6 years ago

mariobranco commented 6 years ago

Command: ssh_scan -t [TARGET] Output: /var/lib/gems/2.3.0/gems/ssh_scan-0.0.32/lib/ssh_scan/scan_engine.rb:138:in scan_target': undefined methodsplit' for nil:NilClass (NoMethodError) from /var/lib/gems/2.3.0/gems/ssh_scan-0.0.32/lib/ssh_scan/scan_engine.rb:191:in `block (2 levels) in scan'

Can't find the solution for my problem. Any tip please ?

claudijd commented 6 years ago

@mariobranco you have to supply a target, like this...

$ ssh_scan -t sshscan.rubidus.com

If you have a specific example case, please let me know

ondrejkelemen commented 6 years ago

Hello @claudijd,

I encounter the same issue as was mentioned above when I specify some non-standard port, e.g.:

$ ssh_scan -t 192.168.2.219 -p 5022

Output after executing this command:

/var/lib/gems/2.3.0/gems/ssh_scan-0.0.32/lib/ssh_scan/scan_engine.rb:138:in scan_target': undefined methodsplit' for nil:NilClass (NoMethodError) from /var/lib/gems/2.3.0/gems/ssh_scan-0.0.32/lib/ssh_scan/scan_engine.rb:191:in `block (2 levels) in scan'

If I am not mistaken, the problem could be with ssh-keyscan in scan_engine.rb, line 127:

stdin, stdout, stderr, wait_thr = Open3.popen3('ssh-keyscan', '-t', 'rsa,dsa', target)

If other port is specified, ssh-keyscan ignores it and there is no output to parse. I tried to resolve this, as can be seen bellow, and it seems to be working.

stdin, stdout, stderr, wait_thr = Open3.popen3('ssh-keyscan', '-t', 'rsa,dsa', '-p', port.to_s, target)

Thank you for looking into it.

claudijd commented 6 years ago

props to @jinankjain to beating me to the punch on this!

Also, thanks @ondrejkelemen and @mariobranco for reporting, I'll try to get a fixed release out today.

claudijd commented 6 years ago

33 has been released to fix this => https://twitter.com/claudijd/status/963443576238723072