Skip to content

Instantly share code, notes, and snippets.

@Oritz
Last active June 9, 2017 03:28
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Oritz/faebb2590cdbbff621cf81a800037dea to your computer and use it in GitHub Desktop.
Save Oritz/faebb2590cdbbff621cf81a800037dea to your computer and use it in GitHub Desktop.
用 PassiveTotal 的 API 获取子域名
import json
import sys
import requests
requests.packages.urllib3.disable_warnings()
domain = sys.argv[1]
url = 'https://api.passivetotal.org/v2/dns/search/keyword'
auth = ("your_email", "your_api_key")
params = {'query': domain}
response = requests.get(url, auth=auth, params=params, verify=False)
loaded_content = json.loads(response.content)
for x in loaded_content['results']:
y = x['focusPoint']
if y.endswith(domain) and y != domain and '*' not in y:
print y
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment