Last active
June 9, 2017 03:28
-
-
Save Oritz/faebb2590cdbbff621cf81a800037dea to your computer and use it in GitHub Desktop.
用 PassiveTotal 的 API 获取子域名
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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