Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ### My ruby code:
- require 'pp'
- require 'censys'
- require 'pry'
- api = CenSys::API.new
- 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
- end
- end
- ### My Goal
- I want this code to print the following
- "IP Address: <IP> Ports: <port/proto>"
- ### The Data
- ipresponse = #<CenSys::Search::Response:0x00000004b17340
- @api=
- #<CenSys::API:0x00000004afbbe0
- @certificates=
- #<CenSys::API::Resource:0x00000004afba50
- #<CenSys::API::Resource:0x00000004afba50
- @api=#<CenSys::API:0x00000004afbbe0 ...>,
- @type=:certificates>,
- @id="1f02fd16-393d-47e1-93d2-5a7df893ec9f",
- @ipv4=
- #<CenSys::API::Resource:0x00000004afbaa0
- @api=#<CenSys::API:0x00000004afbbe0 ...>,
- @type=:ipv4>,
- @secret="Igf4RCRdUNloYX5Sii47jCv3fyf7owhw",
- @websites=
- #<CenSys::API::Resource:0x00000004afba78
- @api=#<CenSys::API:0x00000004afbbe0 ...>,
- @type=:websites>>,
- @metadata=
- #<CenSys::Search::Metadata:0x00000004b17318
- @backend_time=19,
- @count=914,
- @page=1,
- @pages=10,
- @query="dropbox.com">,
- @params={:query=>"dropbox.com"},
- @result_type=:ipv4,
- @results=
- [#<CenSys::Search::IPv4:0x00000004b172c8
- @api=
- #<CenSys::API:0x00000004afbbe0
- @certificates=
- #<CenSys::API::Resource:0x00000004afba50
- @api=#<CenSys::API:0x00000004afbbe0 ...>,
- @type=:certificates>,
- @id="1f02fd16-393d-47e1-93d2-5a7df893ec9f",
- @ipv4=
- #<CenSys::API::Resource:0x00000004afbaa0
- @api=#<CenSys::API:0x00000004afbbe0 ...>,
- @type=:ipv4>,
- @secret="Igf4RCRdUNloYX5Sii47jCv3fyf7owhw",
- @websites=
- #<CenSys::API::Resource:0x00000004afba78
- @api=#<CenSys::API:0x00000004afbbe0 ...>,
- @type=:websites>>,
- @attributes={"ip"=>"108.160.172.205", "protocols"=>["443/https"]}>,
- .
- .
- .
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement