Skip to content

Commit

Permalink
Merge pull request #74 from ninoseki/censys-refactoring
Browse files Browse the repository at this point in the history
refactor: refactor Censys analyzer
  • Loading branch information
ninoseki committed Oct 2, 2019
2 parents 34d8bd4 + 13198b5 commit e92f9b5
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/mihari/analyzers/censys.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@ def initialize(query, title: nil, description: nil, tags: [])

def artifacts
ipv4s = []

res = api.ipv4.search(query: query)
res.each_page do |page|
page.each { |result| ipv4s << result.ip }
ipv4s << page.map(&:ip)
end

ipv4s
ipv4s.flatten
end

private
Expand All @@ -36,8 +37,6 @@ def config_keys
end

def api
raise ArgumentError, configuration_status unless configured?

@api ||= ::Censys::API.new
end
end
Expand Down

0 comments on commit e92f9b5

Please sign in to comment.