class Shodan::Clients::Scan

Public Instance Methods

crawl(*ips) click to toggle source

Use this method to request Shodan to crawl a network.

This method uses API scan credits: 1 IP consumes 1 scan credit. You must have a paid API plan (either one-time payment or subscription) in order to use this method.

IP, IPs or netblocks (in CIDR notation) that should get crawled.

# File lib/shodan/clients/scan.rb, line 15
def crawl(*ips)
  post("/shodan/scan", ips: ips.join(","))
end
crawl_for(**params) click to toggle source

Use this method to request Shodan to crawl the Internet for a specific port.

This method is restricted to security researchers and companies with a Shodan Data license. To apply for access to this method as a researcher, please email jmath@shodan.io with information about your project. Access is restricted to prevent abuse.

# File lib/shodan/clients/scan.rb, line 25
def crawl_for(**params)
  params[:query] = ""
  params = turn_into_query(params)
  post("/shodan/scan/internet", params)
end
get_by_id(id) click to toggle source

Check the progress of a previously submitted scan request.

# File lib/shodan/clients/scan.rb, line 32
def get_by_id(id)
  get("/shodan/scan/#{id}")
end