lib/mihari/analyzers/shodan.rb in mihari-3.12.0 vs lib/mihari/analyzers/shodan.rb in mihari-4.0.0

- old
+ new

@@ -4,13 +4,10 @@ module Mihari module Analyzers class Shodan < Base param :query - option :title, default: proc { "Shodan search" } - option :description, default: proc { "query = #{query}" } - option :tags, default: proc { [] } option :interval, default: proc { 0 } def artifacts results = search @@ -18,11 +15,11 @@ results = results.map { |result| Structs::Shodan::Result.from_dynamic!(result) } results.map do |result| matches = result.matches || [] matches.map { |match| build_artifact match } - end.flatten.compact.uniq(&:data) + end.flatten.uniq(&:data) end private PAGE_SIZE = 100 @@ -96,9 +93,10 @@ end Artifact.new( data: match.ip_str, source: source, + metadata: match.metadata, autonomous_system: as, geolocation: geolocation ) end end