class Ryo::Plugin::Subdomain::DNSDumpster

Public Instance Methods

endpoint() click to toggle source
# File lib/ryo/plugin/subdomain/dnsdumpster.rb, line 7
def endpoint
  "https://dnsdumpster.com"
end
fetch_body() click to toggle source
# File lib/ryo/plugin/subdomain/dnsdumpster.rb, line 11
def fetch_body
  res = Client.http.get(endpoint)
  csrftoken = res.cookies.find { |c| c.name == "csrftoken" }.value
  params = { csrfmiddlewaretoken: csrftoken, targetip: fld }

  res = Client.http.cookies(csrftoken: csrftoken).headers(referer: endpoint).post(endpoint, form: params)
  res.body.to_s
end
parse() click to toggle source
# File lib/ryo/plugin/subdomain/dnsdumpster.rb, line 20
def parse
  tables = doc.css("table.table")
  return [] if tables.empty?

  table = tables.last
  table.css("tr").map do |row|
    cols = row.css("td")
    domain = cols.first.text.lines.first.chomp
    ip = cols[1].inner_text.chomp
    { domain: domain, ip: ip }
  end
end