Class: Shodan::Msf
- Inherits:
-
Object
- Object
- Shodan::Msf
- 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
-
#api ⇒ Object
Returns the value of attribute api.
Instance Method Summary collapse
-
#download(id) ⇒ Object
Download a metasploit module given the fullname (id) of it.
-
#initialize(api) ⇒ Msf
constructor
A new instance of Msf.
-
#search(query, params = {}) ⇒ Object
Search for a metasploit module.
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
#api ⇒ Object
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 |