shodan 0.3.1 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/lib/shodan/api.rb +39 -0
  2. data/lib/shodan/version.rb +1 -1
  3. metadata +5 -5
@@ -16,12 +16,14 @@ module Shodan
16
16
  class WebAPI
17
17
  attr_accessor :api_key
18
18
  attr_accessor :base_url
19
+ attr_accessor :dataloss
19
20
  attr_accessor :exploitdb
20
21
  attr_accessor :msf
21
22
 
22
23
  def initialize(api_key)
23
24
  @api_key = api_key
24
25
  @base_url = "http://www.shodanhq.com/api/"
26
+ @dataloss = DatalossDB.new(self)
25
27
  @exploitdb = ExploitDB.new(self)
26
28
  @msf = Msf.new(self)
27
29
  end
@@ -70,6 +72,43 @@ module Shodan
70
72
  end
71
73
  end
72
74
 
75
+ # The DatalossDB class shouldn't be used independently,
76
+ # as it depends on the WebAPI class.
77
+ #
78
+ # Author:: achillean (mailto:jmath at surtri.com)
79
+ #
80
+ # :title:Shodan::DatalossDB
81
+ class DatalossDB
82
+ attr_accessor :api
83
+
84
+ def initialize(api)
85
+ @api = api
86
+ end
87
+
88
+ # Search the Dataloss DB archive.
89
+ #
90
+ # Arguments:
91
+ # name -- Name of the affected company/ organisation
92
+ #
93
+ # arrest -- whether the incident resulted in an arrest
94
+ # breaches -- the type of breach that occurred (Hack, MissingLaptop etc.)
95
+ # country -- country where the incident took place
96
+ # ext -- whether an external, third party was affected
97
+ # ext_names -- the name of the third party company that was affected
98
+ # lawsuit -- whether the incident resulted in a lawsuit
99
+ # records -- the number of records that were lost/ stolen
100
+ # recovered -- whether the affected items were recovered
101
+ # sub_types -- the sub-categorization of the affected company/ organization
102
+ # source -- whether the incident occurred from inside or outside the organization
103
+ # stocks -- stock symbol of the affected company
104
+ # types -- the basic type of organization (government, business, educational)
105
+ # uid -- unique ID for the incident
106
+ def search(params={})
107
+ return @api.request('datalossdb/search', params)
108
+ end
109
+
110
+ end
111
+
73
112
  # The ExploitDB class shouldn't be used independently,
74
113
  # as it depends on the WebAPI class.
75
114
  #
@@ -1,3 +1,3 @@
1
1
  module Shodan
2
- Version = VERSION = '0.3.1'
2
+ Version = VERSION = '0.5.0'
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shodan
3
3
  version: !ruby/object:Gem::Version
4
- hash: 17
4
+ hash: 11
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
- - 3
9
- - 1
10
- version: 0.3.1
8
+ - 5
9
+ - 0
10
+ version: 0.5.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - John Matherly
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-12-09 00:00:00 -08:00
18
+ date: 2011-05-12 00:00:00 -07:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency