深圳企业公司网站建设平台,lwip在stm32上做网站,wordpress不同尺寸图片大小,wordpress主题08影视在网络安全领域中#xff0c;发现和管理攻击面绝对是一项必须的任务#xff0c;而对域名的寻找和分析是发现攻击面的重要步骤。今天我们将与您分享关于域名发现的四种方法#xff0c;并附带Python示例代码来帮助您更好的理解和掌握这些方法。
1. 主域名链式证书提取域名信息…在网络安全领域中发现和管理攻击面绝对是一项必须的任务而对域名的寻找和分析是发现攻击面的重要步骤。今天我们将与您分享关于域名发现的四种方法并附带Python示例代码来帮助您更好的理解和掌握这些方法。
1. 主域名链式证书提取域名信息Chain of Trust from Root Domain
import ssl
import OpenSSLdef get_cert_chain(domain):cert ssl.get_server_certificate((domain, 443))x509 OpenSSL.crypto.load_certificate(OpenSSL.crypto.FILETYPE_PEM, cert)return [value for value in x509.get_subject().get_components()]print(get_cert_chain(example.com))2. 证书透明度日志Certificate Transparency Logs
import requestsdef query_crt_sh(domain):url fhttps://crt.sh/?q{domain}outputjsonresponse requests.get(url)try:return [result[name_value] for result in response.json()]except:return []print(query_crt_sh(example.com))3. 站长工具Webmaster Tools
import requests
from bs4 import BeautifulSoupdef query_webmaster_tools(domain):base_url fhttps://whois.chinaz.com/{domain}page requests.get(base_url)bs_obj BeautifulSoup(page.text, html.parser)return [pre.text for pre in bs_obj.find_all(pre)]print(query_webmaster_tools(example.com))4. 子域名爆破Subdomain Enumeration
对实际环境中常见的子域名前缀进行枚举。
import socketdef enum_subdomains(domain):common_subdomains [www, ftp, mail, webmail, admin]for subdomain in common_subdomains:full_domain f{subdomain}.{domain}try:# if the subdomain resolves, it existssocket.gethostbyname(full_domain)print(fDiscovered subdomain: {full_domain})except socket.gaierror:passenum_subdomains(example.com)根据目标和环境选择适合的工具进行深入挖掘总能帮助我们更好的发现攻击面。希望以上的信息会对你有所帮助。
写在最后
云图极速版支持包含上述几种在内的 20 余种域名发现方式通过智能编排的方式动态调用以实现域名发现覆盖度的最大化。除此之外云图极速版还支持 IP 发现、端口、服务、网站、组件、漏洞、安全风险等多种企业资产信息的全自动发现与监控。实现攻击面发现与攻击面管理的自动化。