mihari 3.5.0 → 3.7.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (158) hide show
  1. checksums.yaml +4 -4
  2. data/.gitmodules +3 -0
  3. data/README.md +2 -0
  4. data/Steepfile +32 -0
  5. data/config.ru +1 -0
  6. data/lib/mihari/analyzers/base.rb +24 -11
  7. data/lib/mihari/analyzers/binaryedge.rb +13 -0
  8. data/lib/mihari/analyzers/censys.rb +42 -9
  9. data/lib/mihari/analyzers/circl.rb +15 -0
  10. data/lib/mihari/analyzers/crtsh.rb +5 -0
  11. data/lib/mihari/analyzers/dnpedia.rb +5 -0
  12. data/lib/mihari/analyzers/dnstwister.rb +17 -0
  13. data/lib/mihari/analyzers/onyphe.rb +50 -9
  14. data/lib/mihari/analyzers/otx.rb +20 -0
  15. data/lib/mihari/analyzers/passivetotal.rb +25 -0
  16. data/lib/mihari/analyzers/pulsedive.rb +10 -0
  17. data/lib/mihari/analyzers/rule.rb +18 -0
  18. data/lib/mihari/analyzers/securitytrails.rb +25 -0
  19. data/lib/mihari/analyzers/shodan.rb +39 -5
  20. data/lib/mihari/analyzers/spyse.rb +20 -0
  21. data/lib/mihari/analyzers/urlscan.rb +10 -0
  22. data/lib/mihari/analyzers/virustotal.rb +20 -0
  23. data/lib/mihari/analyzers/zoomeye.rb +38 -0
  24. data/lib/mihari/{constraints.rb → constants.rb} +0 -0
  25. data/lib/mihari/database.rb +55 -3
  26. data/lib/mihari/emitters/base.rb +1 -1
  27. data/lib/mihari/emitters/misp.rb +38 -5
  28. data/lib/mihari/emitters/slack.rb +20 -2
  29. data/lib/mihari/emitters/the_hive.rb +16 -3
  30. data/lib/mihari/emitters/webhook.rb +18 -3
  31. data/lib/mihari/enrichers/base.rb +18 -0
  32. data/lib/mihari/enrichers/ipinfo.rb +49 -0
  33. data/lib/mihari/mixins/autonomous_system.rb +19 -0
  34. data/lib/mihari/mixins/disallowed_data_value.rb +1 -1
  35. data/lib/mihari/models/alert.rb +8 -4
  36. data/lib/mihari/models/artifact.rb +94 -0
  37. data/lib/mihari/models/autonomous_system.rb +26 -0
  38. data/lib/mihari/models/dns.rb +55 -0
  39. data/lib/mihari/models/geolocation.rb +29 -0
  40. data/lib/mihari/models/reverse_dns.rb +26 -0
  41. data/lib/mihari/models/whois.rb +119 -0
  42. data/lib/mihari/schemas/rule.rb +2 -15
  43. data/lib/mihari/serializers/alert.rb +6 -4
  44. data/lib/mihari/serializers/artifact.rb +11 -2
  45. data/lib/mihari/serializers/autonomous_system.rb +9 -0
  46. data/lib/mihari/serializers/dns.rb +11 -0
  47. data/lib/mihari/serializers/geolocation.rb +11 -0
  48. data/lib/mihari/serializers/reverse_dns.rb +11 -0
  49. data/lib/mihari/serializers/tag.rb +4 -2
  50. data/lib/mihari/serializers/whois.rb +11 -0
  51. data/lib/mihari/status.rb +7 -2
  52. data/lib/mihari/structs/censys.rb +92 -0
  53. data/lib/mihari/structs/ipinfo.rb +39 -0
  54. data/lib/mihari/structs/onyphe.rb +47 -0
  55. data/lib/mihari/structs/shodan.rb +53 -0
  56. data/lib/mihari/type_checker.rb +9 -9
  57. data/lib/mihari/types.rb +21 -0
  58. data/lib/mihari/version.rb +1 -1
  59. data/lib/mihari/web/controllers/artifacts_controller.rb +53 -8
  60. data/lib/mihari/web/controllers/ip_address_controller.rb +4 -19
  61. data/lib/mihari/web/controllers/sources_controller.rb +2 -2
  62. data/lib/mihari/web/public/index.html +1 -1
  63. data/lib/mihari/web/public/redoc-static.html +7 -6
  64. data/lib/mihari/web/public/static/js/app.06d5cf1c.js +36 -0
  65. data/lib/mihari/web/public/static/js/app.06d5cf1c.js.map +1 -0
  66. data/lib/mihari/web/public/static/js/app.8e3e5150.js +36 -0
  67. data/lib/mihari/web/public/static/js/app.8e3e5150.js.map +1 -0
  68. data/lib/mihari.rb +39 -5
  69. data/mihari.gemspec +10 -1
  70. data/sig/lib/mihari/analyzers/base.rbs +90 -0
  71. data/sig/lib/mihari/analyzers/basic.rbs +17 -0
  72. data/sig/lib/mihari/analyzers/binaryedge.rbs +25 -0
  73. data/sig/lib/mihari/analyzers/censys.rbs +38 -0
  74. data/sig/lib/mihari/analyzers/circl.rbs +29 -0
  75. data/sig/lib/mihari/analyzers/crtsh.rbs +19 -0
  76. data/sig/lib/mihari/analyzers/dnpedia.rbs +18 -0
  77. data/sig/lib/mihari/analyzers/dnstwister.rbs +27 -0
  78. data/sig/lib/mihari/analyzers/onyphe.rbs +33 -0
  79. data/sig/lib/mihari/analyzers/otx.rbs +33 -0
  80. data/sig/lib/mihari/analyzers/passivetotal.rbs +33 -0
  81. data/sig/lib/mihari/analyzers/pulsedive.rbs +27 -0
  82. data/sig/lib/mihari/analyzers/rule.rbs +68 -0
  83. data/sig/lib/mihari/analyzers/securitytrails.rbs +33 -0
  84. data/sig/lib/mihari/analyzers/shodan.rbs +33 -0
  85. data/sig/lib/mihari/analyzers/spyse.rbs +29 -0
  86. data/sig/lib/mihari/analyzers/urlscan.rbs +28 -0
  87. data/sig/lib/mihari/analyzers/virustotal.rbs +31 -0
  88. data/sig/lib/mihari/analyzers/zoomeye.rbs +33 -0
  89. data/sig/lib/mihari/cli/analyzer.rbs +39 -0
  90. data/sig/lib/mihari/cli/base.rbs +11 -0
  91. data/sig/lib/mihari/cli/init.rbs +7 -0
  92. data/sig/lib/mihari/cli/main.rbs +9 -0
  93. data/sig/lib/mihari/cli/mixins/utils.rbs +50 -0
  94. data/sig/lib/mihari/cli/validator.rbs +7 -0
  95. data/sig/lib/mihari/commands/binaryedge.rbs +7 -0
  96. data/sig/lib/mihari/commands/censys.rbs +7 -0
  97. data/sig/lib/mihari/commands/circl.rbs +7 -0
  98. data/sig/lib/mihari/commands/crtsh.rbs +7 -0
  99. data/sig/lib/mihari/commands/dnpedia.rbs +7 -0
  100. data/sig/lib/mihari/commands/dnstwister.rbs +7 -0
  101. data/sig/lib/mihari/commands/init.rbs +11 -0
  102. data/sig/lib/mihari/commands/json.rbs +7 -0
  103. data/sig/lib/mihari/commands/onyphe.rbs +7 -0
  104. data/sig/lib/mihari/commands/otx.rbs +7 -0
  105. data/sig/lib/mihari/commands/passivetotal.rbs +7 -0
  106. data/sig/lib/mihari/commands/pulsedive.rbs +7 -0
  107. data/sig/lib/mihari/commands/search.rbs +35 -0
  108. data/sig/lib/mihari/commands/securitytrails.rbs +7 -0
  109. data/sig/lib/mihari/commands/shodan.rbs +7 -0
  110. data/sig/lib/mihari/commands/spyse.rbs +7 -0
  111. data/sig/lib/mihari/commands/urlscan.rbs +7 -0
  112. data/sig/lib/mihari/commands/validator.rbs +11 -0
  113. data/sig/lib/mihari/commands/virustotal.rbs +7 -0
  114. data/sig/lib/mihari/commands/web.rbs +7 -0
  115. data/sig/lib/mihari/commands/zoomeye.rbs +7 -0
  116. data/sig/lib/mihari/constants.rbs +3 -0
  117. data/sig/lib/mihari/database.rbs +25 -0
  118. data/sig/lib/mihari/emitters/base.rbs +18 -0
  119. data/sig/lib/mihari/emitters/database.rbs +9 -0
  120. data/sig/lib/mihari/emitters/misp.rbs +28 -0
  121. data/sig/lib/mihari/emitters/slack.rbs +58 -0
  122. data/sig/lib/mihari/emitters/stdout.rbs +9 -0
  123. data/sig/lib/mihari/emitters/the_hive.rbs +24 -0
  124. data/sig/lib/mihari/emitters/webhook.rbs +20 -0
  125. data/sig/lib/mihari/enrichers/base.rbs +12 -0
  126. data/sig/lib/mihari/enrichers/ipinfo.rbs +16 -0
  127. data/sig/lib/mihari/errors.rbs +10 -0
  128. data/sig/lib/mihari/mixins/autonomous_system.rbs +14 -0
  129. data/sig/lib/mihari/mixins/configurable.rbs +26 -0
  130. data/sig/lib/mihari/mixins/configuration.rbs +45 -0
  131. data/sig/lib/mihari/mixins/disallowed_data_value.rbs +25 -0
  132. data/sig/lib/mihari/mixins/hash.rbs +14 -0
  133. data/sig/lib/mihari/mixins/refang.rbs +14 -0
  134. data/sig/lib/mihari/mixins/retriable.rbs +15 -0
  135. data/sig/lib/mihari/mixins/rule.rbs +41 -0
  136. data/sig/lib/mihari/models/alert.rbs +46 -0
  137. data/sig/lib/mihari/models/artifact.rbs +65 -0
  138. data/sig/lib/mihari/models/autonomous_system.rbs +14 -0
  139. data/sig/lib/mihari/models/dns.rbs +19 -0
  140. data/sig/lib/mihari/models/geolocation.rbs +15 -0
  141. data/sig/lib/mihari/models/reverse_dns.rbs +14 -0
  142. data/sig/lib/mihari/models/tag.rbs +5 -0
  143. data/sig/lib/mihari/models/tagging.rbs +4 -0
  144. data/sig/lib/mihari/models/whois.rbs +66 -0
  145. data/sig/lib/mihari/notifiers/base.rbs +18 -0
  146. data/sig/lib/mihari/notifiers/exception_notifier.rbs +75 -0
  147. data/sig/lib/mihari/notifiers/slack.rbs +50 -0
  148. data/sig/lib/mihari/status.rbs +25 -0
  149. data/sig/lib/mihari/structs/censys.rbs +50 -0
  150. data/sig/lib/mihari/structs/ipinfo.rbs +17 -0
  151. data/sig/lib/mihari/structs/onyphe.rbs +25 -0
  152. data/sig/lib/mihari/structs/shodan.rbs +28 -0
  153. data/sig/lib/mihari/type_checker.rbs +48 -0
  154. data/sig/lib/mihari/types.rbs +17 -0
  155. data/sig/lib/mihari/version.rbs +3 -0
  156. data/sig/lib/mihari/web/app.rbs +5 -0
  157. data/sig/lib/mihari.rbs +59 -0
  158. metadata +244 -6
@@ -0,0 +1,65 @@
1
+ class ArtifactValidator < ActiveModel::Validator
2
+ def validate: (Mihari::Artifact record) -> (nil | Mihari::Artifact)
3
+ end
4
+
5
+ module Mihari
6
+ class Artifact < ActiveRecord::Base
7
+ attr_accessor data (): String
8
+ attr_accessor data_type (): String
9
+
10
+ attr_accessor autonomous_system(): Mihari::AutonomousSystem
11
+ attr_accessor geolocation (): Mihari::Geolocation
12
+ attr_accessor whois_record(): Mihari::WhoisRecord
13
+ attr_accessor dns_records(): Array[Mihari::DnsRecord]
14
+ attr_accessor reverse_dns_names(): Array[Mihari::ReverseDnsName]
15
+
16
+ include ActiveModel::Validations
17
+
18
+ def initialize: (Hash[(String | Symbol), untyped] attributes) -> void
19
+
20
+ #
21
+ # Check uniqueness of artifact
22
+ #
23
+ # @param [Boolean] ignore_old_artifacts
24
+ # @param [Integer] ignore_threshold
25
+ #
26
+ # @return [Boolean] true if it is unique. Otherwise false.
27
+ #
28
+ def unique?: (?ignore_old_artifacts: bool ignore_old_artifacts, ?ignore_threshold: ::Integer ignore_threshold) -> (bool)
29
+
30
+ #
31
+ # Enrich(add) whois record
32
+ #
33
+ def enrich_whois: () -> void
34
+
35
+ #
36
+ # Enrich(add) DNS records
37
+ #
38
+ def enrich_dns: () -> void
39
+
40
+ #
41
+ # Enrich(add) reverse DNS names
42
+ #
43
+ def enrich_reverse_dns: () -> void
44
+
45
+ def enrich_geolocation: () -> void
46
+
47
+ def enrich_autonomous_system: () -> void
48
+
49
+ def enrich_all: () -> void
50
+
51
+ private
52
+
53
+ def normalize_as_domain: (String url_or_domain) -> String
54
+
55
+ def can_enrich_whois?: () -> bool
56
+
57
+ def can_enrich_dns?: () -> bool
58
+
59
+ def can_enrich_revese_dns?: () -> bool
60
+
61
+ def can_enrich_geolocation?: () -> bool
62
+
63
+ def can_enrich_autonomous_system?: () -> bool
64
+ end
65
+ end
@@ -0,0 +1,14 @@
1
+ module Mihari
2
+ class AutonomousSystem < ActiveRecord::Base
3
+ attr_accessor asn (): Integer
4
+
5
+ #
6
+ # Build AS by IP
7
+ #
8
+ # @param [String] ip
9
+ #
10
+ # @return [Mihari::AutonomousSystem]
11
+ #
12
+ def self.build_by_ip: (String ip) -> Mihari::AutonomousSystem?
13
+ end
14
+ end
@@ -0,0 +1,19 @@
1
+ module Mihari
2
+ class DnsRecord < ActiveRecord::Base
3
+ attr_accessor resource (): String
4
+ attr_accessor value (): String
5
+
6
+ #
7
+ # Build DNS records
8
+ #
9
+ # @param [String] domain
10
+ #
11
+ # @return [Array<Mihari::DnsRecord>]
12
+ #
13
+ def self.build_by_domain: (String domain) -> Array[Mihari::DnsRecord]
14
+
15
+ private
16
+
17
+ def self.get_values: (String domain, singleton(Resolv::DNS::Query) resource_type) -> Array[Mihari::DnsRecord]
18
+ end
19
+ end
@@ -0,0 +1,15 @@
1
+ module Mihari
2
+ class Geolocation < ActiveRecord::Base
3
+ attr_accessor country (): String
4
+ attr_accessor country_code (): String
5
+
6
+ #
7
+ # Build geolocation by IP
8
+ #
9
+ # @param [String] ip
10
+ #
11
+ # @return [Mihari::Geolocation]
12
+ #
13
+ def self.build_by_ip: (String ip) -> Mihari::Geolocation?
14
+ end
15
+ end
@@ -0,0 +1,14 @@
1
+ module Mihari
2
+ class ReverseDnsName < ActiveRecord::Base
3
+ attr_accessor name (): String
4
+
5
+ #
6
+ # Build reverse DNS names
7
+ #
8
+ # @param [String] ip
9
+ #
10
+ # @return [Array<Mihari::ReverseDnsName>]
11
+ #
12
+ def self.build_by_ip: (String ip) -> Array[Mihari::ReverseDnsName]
13
+ end
14
+ end
@@ -0,0 +1,5 @@
1
+ module Mihari
2
+ class Tag < ActiveRecord::Base
3
+ attr_accessor name (): String
4
+ end
5
+ end
@@ -0,0 +1,4 @@
1
+ module Mihari
2
+ class Tagging < ActiveRecord::Base
3
+ end
4
+ end
@@ -0,0 +1,66 @@
1
+ module Mihari
2
+ class WhoisRecord < ActiveRecord::Base
3
+ attr_accessor domain (): String
4
+ attr_accessor created_on (): DateTime?
5
+ attr_accessor updated_on (): DateTime?
6
+ attr_accessor expires_on (): DateTime?
7
+ attr_accessor registrar (): Hash[(String | Symbol), untyped]
8
+ attr_accessor contacts (): Array[Hash[(String | Symbol), untyped]]
9
+
10
+ #
11
+ # Build whois record
12
+ #
13
+ # @param [Stinrg] domain
14
+ #
15
+ # @return [WhoisRecord, nil]
16
+ #
17
+ def self.build_by_domain: (String domain) -> Mihari::WhoisRecord?
18
+
19
+ private
20
+
21
+ #
22
+ # Get created_on
23
+ #
24
+ # @param [::Whois::Parser:] parser
25
+ #
26
+ # @return [Date, nil]
27
+ #
28
+ def self.get_created_on: (untyped parser) -> Date?
29
+
30
+ #
31
+ # Get updated_on
32
+ #
33
+ # @param [::Whois::Parser:] parser
34
+ #
35
+ # @return [Date, nil]
36
+ #
37
+ def self.get_updated_on: (untyped parser) -> Date?
38
+
39
+ #
40
+ # Get expires_on
41
+ #
42
+ # @param [::Whois::Parser:] parser
43
+ #
44
+ # @return [Date, nil]
45
+ #
46
+ def self.get_expires_on: (untyped parser) -> Date?
47
+
48
+ #
49
+ # Get registrar
50
+ #
51
+ # @param [::Whois::Parser:] parser
52
+ #
53
+ # @return [Hash, nil]
54
+ #
55
+ def self.get_registrar: (untyped parser) -> Hash[(String | Symbol), untyped]?
56
+
57
+ #
58
+ # Get contacts
59
+ #
60
+ # @param [::Whois::Parser:] parser
61
+ #
62
+ # @return [Array[Hash[(String | Symbol), untyped]], nil]
63
+ #
64
+ def self.get_contacts: (untyped parser) -> Array[Hash[(String | Symbol), untyped]]?
65
+ end
66
+ end
@@ -0,0 +1,18 @@
1
+ module Mihari
2
+ module Notifiers
3
+ class Base
4
+ # Validate notifier availability
5
+ #
6
+ # @return [Boolean]
7
+ #
8
+ def valid?: () -> bool
9
+
10
+ #
11
+ # Send a notification
12
+ #
13
+ # @return [nil]
14
+ #
15
+ def notify: () -> void
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,75 @@
1
+ module Mihari
2
+ module Notifiers
3
+ class ExceptionNotifier
4
+ def initialize: () -> void
5
+
6
+ def valid?: () -> bool
7
+
8
+ def notify: (Exception exception) -> void
9
+
10
+ #
11
+ # Send notification to Slack
12
+ #
13
+ # @param [String] text
14
+ # @param [Array<Hash>] attachments
15
+ #
16
+ # @return [nil]
17
+ #
18
+ def notify_to_slack: (text: String text, attachments: Array[Hash[(String | Symbol), untyped]] attachments) -> void
19
+
20
+ #
21
+ # Send notification to STDOUT
22
+ #
23
+ # @param [Exception] exception
24
+ #
25
+ # @return [nil]
26
+ #
27
+ def notify_to_stdout: (Exception exception) -> void
28
+
29
+ #
30
+ # Convert exception to attachments (for Slack)
31
+ #
32
+ # @param [Exception] exception
33
+ # @param [String] clean_message
34
+ #
35
+ # @return [Array<Hash>]
36
+ #
37
+ def to_attachments: (Exception exception, String clean_message) -> ::Array[{ color: untyped, text: untyped, fields: untyped, :mrkdwn_in => ::Array["text" | "fields"] }]
38
+
39
+ #
40
+ # Convert exception class to text
41
+ #
42
+ # @param [Class<Exception>] exception_class
43
+ #
44
+ # @return [String]
45
+ #
46
+ def to_text: (singleton(Exception) exception_class) -> ::String
47
+
48
+ #
49
+ # Convert clean_message and backtrace into fields (for Slack)
50
+ #
51
+ # @param [String] clean_message
52
+ # @param [Array] backtrace
53
+ #
54
+ # @return [Array<Hash>]
55
+ #
56
+ def to_fields: (String clean_message, untyped backtrace) -> Array[Hash[(String | Symbol), untyped]]
57
+
58
+ #
59
+ # Hostname of runnning instance
60
+ #
61
+ # @return [String]
62
+ #
63
+ def hostname: () -> String
64
+
65
+ #
66
+ # Format backtrace in string
67
+ #
68
+ # @param [Array] backtrace
69
+ #
70
+ # @return [String]
71
+ #
72
+ def format_backtrace: (untyped backtrace) -> (nil | ::String)
73
+ end
74
+ end
75
+ end
@@ -0,0 +1,50 @@
1
+ module Mihari
2
+ module Notifiers
3
+ class Slack < Base
4
+ SLACK_WEBHOOK_URL_KEY: ::String
5
+
6
+ SLACK_CHANNEL_KEY: ::String
7
+
8
+ DEFAULT_USERNAME: ::String
9
+
10
+ #
11
+ # Slack channel to post
12
+ #
13
+ # @return [String]
14
+ #
15
+ def slack_channel: () -> String
16
+
17
+ #
18
+ # Slack webhook URL
19
+ #
20
+ # @return [String]
21
+ #
22
+ def slack_webhook_url: () -> String
23
+
24
+ #
25
+ # Check Slack webhook URL is set
26
+ #
27
+ # @return [Boolean]
28
+ #
29
+ def slack_webhook_url?: () -> bool
30
+
31
+ #
32
+ # Check Slack webhook URL is set. Alias of #slack_webhook_url?.
33
+ #
34
+ # @return [Boolean]
35
+ #
36
+ def valid?: () -> bool
37
+
38
+ #
39
+ # Send notification to Slack
40
+ #
41
+ # @param [String] text
42
+ # @param [Array<Hash>] attachments
43
+ # @param [Boolean] mrkdwn
44
+ #
45
+ # @return [nil]
46
+ #
47
+ def notify: (text: String text, ?attachments: Array[Hash[(String | Symbol), untyped]] attachments, ?mrkdwn: bool mrkdwn) -> untyped
48
+ end
49
+ end
50
+ end
@@ -0,0 +1,25 @@
1
+ module Mihari
2
+ class Status
3
+ def check: () -> Array[Hash[(String | Symbol), untyped]]
4
+
5
+ def self.check: () -> Array[Hash[(String | Symbol), untyped]]
6
+
7
+ private
8
+
9
+ #
10
+ # Statuses of analyzers and emitters
11
+ #
12
+ # @return [Array<Hash>]
13
+ #
14
+ def statuses: () -> Array[Hash[(String | Symbol), untyped]]
15
+
16
+ #
17
+ # Build a status of a class
18
+ #
19
+ # @param [Class<Mihari::Analyzers::Base>, Class<Mihari::Emitters::Base>] klass
20
+ #
21
+ # @return [Hash, nil]
22
+ #
23
+ def build_status: (singleton(Mihari::Analyzers::Base) | singleton(Mihari::Emitters::Base)) -> Hash[(String|Symbol), untyped]?
24
+ end
25
+ end
@@ -0,0 +1,50 @@
1
+ module Mihari
2
+ module Structs
3
+ module Censys
4
+ class AutonomousSystem
5
+ attr_reader asn: Integer
6
+
7
+ def self.from_dynamic!: (Hash[(String | Symbol), untyped] d) -> Mihari::Structs::Censys::AutonomousSystem
8
+ end
9
+
10
+ class Location
11
+ attr_reader country: String
12
+ attr_reader country_code: String
13
+
14
+ def self.from_dynamic!: (Hash[(String | Symbol), untyped] d) -> Mihari::Structs::Censys::Location
15
+ end
16
+
17
+ class Hit
18
+ attr_reader ip: String
19
+ attr_reader location: Mihari::Structs::Censys::Location
20
+ attr_reader autonomous_system: Mihari::Structs::Censys::AutonomousSystem
21
+
22
+ def self.from_dynamic!: (Hash[(String | Symbol), untyped] d) -> Mihari::Structs::Censys::Hit
23
+ end
24
+
25
+ class Links
26
+ attr_reader next: String
27
+ attr_reader prev: String
28
+
29
+ def self.from_dynamic!: (Hash[(String | Symbol), untyped] d) -> Mihari::Structs::Censys::Links
30
+ end
31
+
32
+ class Result
33
+ attr_reader query: String
34
+ attr_reader total: Integer
35
+ attr_reader hits: Array[Mihari::Structs::Censys::Hit]
36
+ attr_reader links: Mihari::Structs::Censys::Links
37
+
38
+ def self.from_dynamic!: (Hash[(String | Symbol), untyped] d) -> Mihari::Structs::Censys::Result
39
+ end
40
+
41
+ class Response
42
+ attr_reader code: Integer
43
+ attr_reader status: String
44
+ attr_reader result: Mihari::Structs::Censys::Result
45
+
46
+ def self.from_dynamic!: (Hash[(String | Symbol), untyped] d) -> Mihari::Structs::Censys::Response
47
+ end
48
+ end
49
+ end
50
+ end
@@ -0,0 +1,17 @@
1
+ module Mihari
2
+ module Structs
3
+ module IPInfo
4
+ class Response
5
+ attr_reader ip: String
6
+ attr_reader hostname: String?
7
+ attr_reader loc: String
8
+ attr_reader country_code: String
9
+ attr_reader asn: Integer?
10
+
11
+ def self.from_dynamic!: (Hash[(String | Symbol), untyped] d) -> Mihari::Structs::IPInfo::Response
12
+
13
+ def to_hash: () -> Hash[(String | Symbol), untyped]
14
+ end
15
+ end
16
+ end
17
+ end