-
-
Save anonymous/2921f81958d08c431ea14135a9a5607c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
require 'pp' | |
require 'censys' | |
#api = CenSys::API.new('1f02fd16-393d-47e1-93d2-5a7df893ec9f','Igf4RCRdUNloYX5Sii47jCv3fyf7o') | |
api = CenSys::API.new | |
#Search for IPv4 addresses: | |
ipresponse = api.ipv4.search(query: 'dropbox.com') | |
ipresponse.each_page do |page| | |
puts ">>> Page ##{page.metadata.page} / #{page.metadata.pages} ..." | |
page.each do |result| | |
puts result[ip] | |
end | |
end | |
Data Structure: | |
#<CenSys::Search::IPv4:0x0000000260f520 @attributes={"ip"=>"45.58.72.171", "protocols"=>["443/https", "80/http"]}, @api=#<CenSys::API:0x0000000261d120 @secret="xxxx", @id="xxxx", @ipv4=#<CenSys::API::Resource:0x0000000261d008 @type=:ipv4, @api=#<CenSys::API:0x0000000261d120 ...>>, @websites=#<CenSys::API::Resource:0x0000000261cfe0 @type=:websites, @api=#<CenSys::API:0x0000000261d120 ...>>, @certificates=#<CenSys::API::Resource:0x0000000261cfb8 @type=:certificates, @api=#<CenSys::API:0x0000000261d120 ...>>>> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment