{"id":14638129,"url":"https://github.com/assassin-9527/cdn_identify","last_synced_at":"2025-09-07T06:32:32.455Z","repository":{"id":162442149,"uuid":"628604274","full_name":"assassin-9527/cdn_identify","owner":"assassin-9527","description":"一款识别域名是否使用cdn的工具","archived":false,"fork":false,"pushed_at":"2023-05-21T01:17:51.000Z","size":41,"stargazers_count":13,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-02T10:38:21.096Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/assassin-9527.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-04-16T13:25:37.000Z","updated_at":"2024-01-29T05:50:13.000Z","dependencies_parsed_at":null,"dependency_job_id":"6b6113f7-6134-427a-b573-f63b386f7c12","html_url":"https://github.com/assassin-9527/cdn_identify","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/assassin-9527/cdn_identify","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/assassin-9527%2Fcdn_identify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/assassin-9527%2Fcdn_identify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/assassin-9527%2Fcdn_identify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/assassin-9527%2Fcdn_identify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/assassin-9527","download_url":"https://codeload.github.com/assassin-9527/cdn_identify/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/assassin-9527%2Fcdn_identify/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274005341,"owners_count":25205934,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-07T02:00:09.463Z","response_time":67,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-09-10T02:01:43.751Z","updated_at":"2025-09-07T06:32:32.441Z","avatar_url":"https://github.com/assassin-9527.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# CDN_IDENTIFY\n\n一款识别域名是否使用cdn的工具\n\n\n\n## 背景\n\n红队打点时经常会有收集子域名然后转成ip进而扩展ip段进行脆弱点寻找的需求，如果域名使用cdn，会导致收集错误的ip段，因此我们需要排除cdn来收集更准确的ip地址。\n\n现有的一些识别cdn的工具存在如下问题：\n\n- *仅根据cname或ip范围判断cdn，cname与ip范围不全导致遗漏*\n\n- *输出字段较多，不方便直接与其他工具结合*\n\n\n\n本工具是 https://github.com/alwaystest18/cdnChecker.git 的python版，原版是go语言的写的，因为个人平时python用的更多，所以将该工具用python写了一份（版本为：python3.8.10）。\n\n\n\n## 安装使用\n\n```\ngit https://github.com/assassin-9527/cdn_identify.git\ncd cdn_identify/\npip3 install -r requirement.txt\npython3 ./cdn_identify.py --domain www.baidu.com\n```\n\n\n\n## 使用\n\n参数说明\n\n```\nUsage of cdn_identify.py:\n  --domain string         //要测试的域名\n        The target domain\n  --domains string         //要测试的域名列表文件\n        The target domain list file path\n  -o string         //输出文件，默认为out.txt\n        Toutput domains cdn check result to file\n```\n\n使用命令\n\n```\n$ cat domains.txt \nwww.baidu.com\nwww.qq.com\nwww.alibabagroup.com\naurora.tencent.com\n\npython3 ./cdn_identify.py --domain www.baidu.com\n或者\npython3 ./cdn_identify.py --domains domains.txt\n\ncat out.txt\n# 使用cdn的域名列表\nwww.baidu.com\nwww.qq.com\nwww.alibabagroup.com\n\n# 未使用cdn的域名列表\naurora.tencent.com\n\n# 未使用cdn的ip列表\n43.137.23.148\n\nruntime: 11s \n```\n\n\n**强烈推荐dns服务器列表使用自带的resolvers（均为国内dns服务器且验证可用），如果服务器数量过少，大量的dns查询会导致timeout，影响查询准确度**\n\n\n\n## 识别cdn思路\n\n1.参考 go语言自带库 https://github.com/projectdiscovery/dnsx 的checkCdn方法（通过ip范围判断，主要为国外cdn厂商，对国内cdn识别效果不理想）\n\n2.存在A记录但不存在cname的域名直接判断未使用cdn\n\n3.存在cname的与cdn name列表对比，如果包含cdn cname列表则判断使用cdn\n\n4.主要通过多个dns服务器节点获取域名解析ip，如果存在4个以上不同的ip段，则判断使用cdn，反之未使用cdn。\n\n\n\n## 常见问题\n\n结果中使用cdn域名列表与未使用cdn域名列表数量相加与实际测试域名数量不符？\n\n答：对于无法获取解析ip的域名，程序会默认为域名无效过滤掉\n\n\n\n## 感谢\n\nhttps://github.com/alwaystest18/cdnChecker.git\n\nhttps://github.com/xiaoyiios/chinacdndomianlist\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fassassin-9527%2Fcdn_identify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fassassin-9527%2Fcdn_identify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fassassin-9527%2Fcdn_identify/lists"}