网址访问
crt.sh
输入主域名
,点击Search
按钮,即可获取该域名下所有子域名的信息
代码访问
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| import requests
def get_subdomain(domain): url = "https://crt.sh/" ua = "User-Agent:Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36" headers = {'User-Agent': ua} params = { "q": domain, "output": "json" } response = requests.get(url=url, headers=headers, params=params) subdomain_list = response.json() for i in subdomain_list: print(i["common_name"])
get_subdomain("baidu.com")
|