achillean/shodan-ruby

RuntimeError: FORBIDDEN/4/index closed

Closed this issue · 2 comments

jcran commented

Getting a RuntimeError when making calls via the ruby gem:

2016-04-05T18:22:59.972Z 22543 TID-bms04 WARN: RuntimeError: blocked by: [FORBIDDEN/4/index closed];
2016-04-05T18:22:59.972Z 22543 TID-bms04 WARN: /home/jcran/.rvm/gems/ruby-2.3.0@core/gems/shodan-1.0.0/lib/shodan/api.rb:48:in `request'
/home/jcran/.rvm/gems/ruby-2.3.0@core/gems/shodan-1.0.0/lib/shodan/api.rb:72:in `search'

Might be elasticsearch index issue? http://stackoverflow.com/questions/28712138/getting-the-following-exception-after-changing-the-index-name

Hmmm, are you still seeing this issue? I just ran the following test and it worked:

require 'rubygems'
require 'shodan'

api = Shodan::Shodan.new(MY_API_KEY)
result = api.search("cisco-ios")
result['matches'].each{ |host|
    puts host['ip_str']
}

Otherwise are you able to share the code/ method that you were calling?

jcran commented

Sorry for the delay, i've looked into it, and i was using the Shodan::WebAPI.new call, must have been built from some older example code. I've updated to use the Shodan::Shodan.new call, and everything's working swimmingly. Thanks!