Skip to content
This repository has been archived by the owner on Oct 18, 2023. It is now read-only.

Commit

Permalink
Merge 75c8380 into 4b3c86a
Browse files Browse the repository at this point in the history
  • Loading branch information
ninoseki committed Jul 2, 2019
2 parents 4b3c86a + 75c8380 commit a60fbd9
Show file tree
Hide file tree
Showing 4 changed files with 441 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ See `/spec` for more.
| PUT | /org/member/{user} | N/A |
| DELETE | /org/member/{user} | N/A |
| GET | /account/profile | `api.account.profile` |
| GET | /dns/domain/{domain} | `api.dns.domain(domain)` |
| GET | /dns/resolve | `api.dns.resolve(**hostnames)` |
| GET | /dns/reverse | `api.dns.reverse(**ips)` |
| GET | /tools/httpheaders | `api.tools.http_headers` |
Expand Down
5 changes: 5 additions & 0 deletions lib/shodan/clients/dns.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ def resolve(*hostnames)
def reverse(*ips)
get("/dns/reverse", ips: ips.join(","))
end

# Get all the subdomains and other DNS entries for the given domain. Uses 1 query credit per lookup.
def domain(domain)
get("/dns/domain/#{domain}")
end
end
end
end
7 changes: 7 additions & 0 deletions spec/clients/dns_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,11 @@
expect(res).to be_a(Hash)
end
end

describe "#domain" do
it do
res = api.dns.domain("shodan.io")
expect(res).to be_a(Hash)
end
end
end

0 comments on commit a60fbd9

Please sign in to comment.