From e3b27128f6a16accfb65227838c465a9bf1dc70f Mon Sep 17 00:00:00 2001 From: zeinlol Date: Fri, 5 Aug 2022 18:06:39 +0100 Subject: [PATCH] fix api search --- lib/aquatone/collectors/gtr.rb | 11 ++++++++--- lib/aquatone/collectors/ptrarchive.rb | 2 +- lib/aquatone/collectors/riddler.rb | 2 +- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/lib/aquatone/collectors/gtr.rb b/lib/aquatone/collectors/gtr.rb index 17a8932..99943e3 100644 --- a/lib/aquatone/collectors/gtr.rb +++ b/lib/aquatone/collectors/gtr.rb @@ -31,13 +31,18 @@ def run def request_page(token = nil) if token.nil? - uri = "#{BASE_URI}?domain=#{url_escape(domain.name)}&include_expired=true&include_subdomains=true" + uri = "#{BASE_URI}" else - uri = "#{BASE_URI}/page?domain=#{url_escape(domain.name)}&include_expired=true&include_subdomains=true&p=#{url_escape(token)}" + uri = "#{BASE_URI}/page?&p=#{url_escape(token)}" end get_request(uri, - { :format => :plain, :headers => { "Referer" => "https://transparencyreport.google.com/https/certificates" } } + { + :format => :plain, + :params => {"include_expired": 'true', + 'include_subdomains': 'true', + 'domain': url_escape(domain.name)}, + :headers => { "Referer" => "https://transparencyreport.google.com/https/certificates" } } ) end diff --git a/lib/aquatone/collectors/ptrarchive.rb b/lib/aquatone/collectors/ptrarchive.rb index 3070578..bdaef4d 100644 --- a/lib/aquatone/collectors/ptrarchive.rb +++ b/lib/aquatone/collectors/ptrarchive.rb @@ -8,7 +8,7 @@ class Ptrarchive < Aquatone::Collector } def run - response = get_request("http://ptrarchive.com/tools/search.htm?label=#{url_escape(domain.name)}&date=ALL") + response = get_request("http://ptrarchive.com/tools/search.htm?label=#{url_escape(domain.name)}&date=ALL&nonce=18000") if response.code != 200 failure("PTRArchive returned unexpected response code: #{response.code}") end diff --git a/lib/aquatone/collectors/riddler.rb b/lib/aquatone/collectors/riddler.rb index 70346ff..4f21761 100644 --- a/lib/aquatone/collectors/riddler.rb +++ b/lib/aquatone/collectors/riddler.rb @@ -14,7 +14,7 @@ def run token = get_key("riddler_api") if token.nil? do auth_response = post_request("#{API_BASE_URI}/auth/login", { - :email => get_key("riddler_username"), + :email => get_key("riddler"), :password => get_key("riddler_password") }.to_json, { :headers => { "Content-Type" => "application/json" }