Class: Shodan::Msf

Inherits:
Object
  • Object
show all
Defined in:
lib/shodan/api.rb

Overview

The Msf class shouldn’t be used independently, as it depends on the WebAPI class.

Author

achillean (jmath at surtri.com)

:title:Shodan::Msf

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api) ⇒ Msf

Returns a new instance of Msf.



204
205
206
# File 'lib/shodan/api.rb', line 204

def initialize(api)
  @api = api
end

Instance Attribute Details

#apiObject

Returns the value of attribute api.



202
203
204
# File 'lib/shodan/api.rb', line 202

def api
  @api
end

Instance Method Details

#download(id) ⇒ Object

Download a metasploit module given the fullname (id) of it.

Arguments: id – fullname of the module (ex. auxiliary/admin/backupexec/dump)

Returns: A dictionary with the following fields: # filename – Name of the file content-type – Mimetype data – File content



218
219
220
# File 'lib/shodan/api.rb', line 218

def download(id)
  return @api.request('msf/download', {:id => "#{id}"})
end

#search(query, params = {}) ⇒ Object

Search for a metasploit module



223
224
225
226
# File 'lib/shodan/api.rb', line 223

def search(query, params={})
  params[:q] = query
  return @api.request('msf/search', params)
end