mozilla / ssh_scan_api

An API for ssh_scan (https://github.com/mozilla/ssh_scan) and the backend API service for the Mozilla SSH Observatory (https://observatory.mozilla.org/)
31 stars 8 forks source link

getaddrinfo: Name or service not known (SocketError) #51

Closed claudijd closed 7 years ago

claudijd commented 7 years ago

I, [2017-06-05T20:05:25.287073 #13870] INFO -- : Started job: 2b9baa46-335c-48da-880c-b83e1bc765ab /usr/local/rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/socket.rb:231:in getaddrinfo': getaddrinfo: Name or service not known (SocketError) from /usr/local/rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/socket.rb:231:inforeach' from /usr/local/rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/socket.rb:626:in tcp' from /root/code/ssh_scan/lib/ssh_scan/client.rb:21:inconnect' from /root/code/ssh_scan/lib/ssh_scan/scan_engine.rb:53:in scan_target' from /root/code/ssh_scan/lib/ssh_scan/scan_engine.rb:145:inblock (2 levels) in scan'

claudijd commented 7 years ago

people.mozilla.com to the API seems to trigger this bug.

claudijd commented 7 years ago

Actually, it's a request for https://mozilla.github.io/http-observatory-website/analyze.html?host=test

claudijd commented 7 years ago

Able to replicate if I remove the valid target checking on the binary....

with small exception path... $ ruby bin/ssh_scan -t test [ { "ssh_scan_version": "0.0.21", "ip": "test", "port": 22, "error": "ConnectionRefused: getaddrinfo: nodename nor servname provided, or not known", "hostname": "" } ]

without small exceptions patch (and binary checks bypassed) $ ruby bin/ssh_scan -t test /Users/jclaudius/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/socket.rb:232:in getaddrinfo': getaddrinfo: nodename nor servname provided, or not known (SocketError) from /Users/jclaudius/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/socket.rb:232:inforeach' from /Users/jclaudius/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/socket.rb:328:in tcp' from /Users/jclaudius/code/ssh_scan/lib/ssh_scan/client.rb:21:inconnect' from /Users/jclaudius/code/ssh_scan/lib/ssh_scan/scan_engine.rb:53:in scan_target' from /Users/jclaudius/code/ssh_scan/lib/ssh_scan/scan_engine.rb:145:inblock (2 levels) in scan'