├── .gitignore ├── README.md ├── example.jpg ├── icp_domains.py └── requirements.txt /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # test module 个人习惯,测试目录去掉 10 | /test/ 11 | 12 | # Distribution / packaging 13 | .Python 14 | build/ 15 | develop-eggs/ 16 | dist/ 17 | downloads/ 18 | eggs/ 19 | .eggs/ 20 | lib64/ 21 | parts/ 22 | sdist/ 23 | var/ 24 | wheels/ 25 | pip-wheel-metadata/ 26 | share/python-wheels/ 27 | *.egg-info/ 28 | .installed.cfg 29 | *.egg 30 | MANIFEST 31 | 32 | # PyInstaller 33 | # Usually these files are written by a python script from a template 34 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 35 | *.manifest 36 | *.spec 37 | .idea/ 38 | 39 | # Installer logs 40 | pip-log.txt 41 | pip-delete-this-directory.txt 42 | 43 | # Unit test / coverage reports 44 | htmlcov/ 45 | .tox/ 46 | .nox/ 47 | .coverage 48 | .coverage.* 49 | .cache 50 | nosetests.xml 51 | coverage.xml 52 | *.cover 53 | .hypothesis/ 54 | .pytest_cache/ 55 | 56 | # Translations 57 | *.mo 58 | *.pot 59 | 60 | # Django stuff: 61 | *.log 62 | local_settings.py 63 | db.sqlite3 64 | 65 | # Flask stuff: 66 | instance/ 67 | .webassets-cache 68 | 69 | # Scrapy stuff: 70 | .scrapy 71 | 72 | # Sphinx documentation 73 | docs/_build/ 74 | 75 | # PyBuilder 76 | target/ 77 | 78 | # Jupyter Notebook 79 | .ipynb_checkpoints 80 | 81 | # IPython 82 | profile_default/ 83 | ipython_config.py 84 | 85 | # pyenv 86 | .python-version 87 | 88 | # celery beat schedule file 89 | celerybeat-schedule 90 | 91 | # SageMath parsed files 92 | *.sage.py 93 | 94 | # Environments 95 | .env 96 | .venv 97 | env/ 98 | venv/ 99 | ENV/ 100 | env.bak/ 101 | venv.bak/ 102 | 103 | # Spyder project settings 104 | .spyderproject 105 | .spyproject 106 | 107 | # Rope project settings 108 | .ropeproject 109 | 110 | # mkdocs documentation 111 | /site 112 | 113 | # mypy 114 | .mypy_cache/ 115 | .dmypy.json 116 | dmypy.json 117 | 118 | # Pyre type checker 119 | .pyre/ 120 | mysql/data 121 | mysql/log 122 | rabbitmq 123 | redis 124 | .DS_Store 125 | supervisord.log 126 | supervisord.pid 127 | *.log 128 | 129 | # my tmp dir 130 | /tmp/ 131 | /bawa.bak/ 132 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # icp-domains 2 | [![python](https://img.shields.io/badge/python-3.6|3.7|3.8-blue)](https://github.com/1in9e/icp-domains/tree/main/) 3 | 4 | 输入一个域名,输出ICP备案所有关联域名 5 | 6 | ### 所用接口 7 | <1> https://api.vvhan.com/api/icp?url= 8 | <2> https://hlwicpfwc.miit.gov.cn/icpproject_query/api/icpAbbreviateInfo/queryByCondition 9 | 10 | ### Usage 11 | python icp_domains.py example.com 12 | 13 | ![example](./example.jpg) 14 | 15 | 例如OPPO.COM 16 | ``` 17 | (py3env) ➜ python icp_domains.py oppo.com 18 | [*] oppo.com 对应的备案号为粤ICP备08130115号 19 | 20 | [*] 查询对象 粤ICP备08130115号 共有 11 个备案域名 21 | [+] 域名具体信息如下: 22 | 23 | 域名主办方: OPPO广东移动通信有限公司 24 | 域名: allawnfs.com 25 | 网站名称: OPPO广东移动通信有限公司官方网站 26 | 备案许可证号: 粤ICP备08130115号 27 | 网站备案号: 粤ICP备08130115号-14 28 | 域名类型: 企业 29 | 网站前置审批项: 无 30 | 是否限制接入: 否 31 | 审核通过日期: 2021-08-02 10:46:39 32 | 33 | 域名主办方: OPPO广东移动通信有限公司 34 | 域名: allawntech.com 35 | 网站名称: OPPO广东移动通信有限公司官方网站 36 | 备案许可证号: 粤ICP备08130115号 37 | 网站备案号: 粤ICP备08130115号-12 38 | 域名类型: 企业 39 | 网站前置审批项: 无 40 | 是否限制接入: 否 41 | 审核通过日期: 2021-08-06 15:28:13 42 | 43 | 域名主办方: OPPO广东移动通信有限公司 44 | 域名: opdwz.cn 45 | 网站名称: OPPO官方网站 46 | 备案许可证号: 粤ICP备08130115号 47 | 网站备案号: 粤ICP备08130115号-6 48 | 域名类型: 企业 49 | 网站前置审批项: 无 50 | 是否限制接入: 否 51 | 审核通过日期: 2021-06-04 17:29:23 52 | 53 | 域名主办方: OPPO广东移动通信有限公司 54 | 域名: coloros.com 55 | 网站名称: 软件商店 56 | 备案许可证号: 粤ICP备08130115号 57 | 网站备案号: 粤ICP备08130115号-9 58 | 域名类型: 企业 59 | 网站前置审批项: 无 60 | 是否限制接入: 否 61 | 审核通过日期: 2021-08-02 10:46:06 62 | 63 | 域名主办方: OPPO广东移动通信有限公司 64 | 域名: oppo.cn 65 | 网站名称: OPPO广东移动通信有限公司 66 | 备案许可证号: 粤ICP备08130115号 67 | 网站备案号: 粤ICP备08130115号-3 68 | 域名类型: 企业 69 | 网站前置审批项: 无 70 | 是否限制接入: 否 71 | 审核通过日期: 2021-06-04 17:29:23 72 | 73 | 域名主办方: OPPO广东移动通信有限公司 74 | 域名: allawno.com 75 | 网站名称: OPPO广东移动通信有限公司官方网站 76 | 备案许可证号: 粤ICP备08130115号 77 | 网站备案号: 粤ICP备08130115号-13 78 | 域名类型: 企业 79 | 网站前置审批项: 无 80 | 是否限制接入: 否 81 | 审核通过日期: 2021-08-02 10:46:32 82 | 83 | 域名主办方: OPPO广东移动通信有限公司 84 | 域名: coloros.net 85 | 网站名称: 门户网 86 | 备案许可证号: 粤ICP备08130115号 87 | 网站备案号: 粤ICP备08130115号-10 88 | 域名类型: 企业 89 | 网站前置审批项: 无 90 | 是否限制接入: 否 91 | 审核通过日期: 2021-06-04 17:29:14 92 | 93 | 域名主办方: OPPO广东移动通信有限公司 94 | 域名: oppo.com 95 | 网站名称: OPPO官方网站 96 | 备案许可证号: 粤ICP备08130115号 97 | 网站备案号: 粤ICP备08130115号-1 98 | 域名类型: 企业 99 | 网站前置审批项: 无 100 | 是否限制接入: 否 101 | 审核通过日期: 2021-08-02 10:45:58 102 | 103 | 域名主办方: OPPO广东移动通信有限公司 104 | 域名: oppodigital.com.cn 105 | 网站名称: oppo蓝光官网 106 | 备案许可证号: 粤ICP备08130115号 107 | 网站备案号: 粤ICP备08130115号-5 108 | 域名类型: 企业 109 | 网站前置审批项: 无 110 | 是否限制接入: 否 111 | 审核通过日期: 2021-09-24 10:37:36 112 | 113 | 域名主办方: OPPO广东移动通信有限公司 114 | 域名: oppodataintel.cn 115 | 网站名称: OPPO广东移动通信有限公司 116 | 备案许可证号: 粤ICP备08130115号 117 | 网站备案号: 粤ICP备08130115号-15 118 | 域名类型: 企业 119 | 网站前置审批项: 无 120 | 是否限制接入: 否 121 | 审核通过日期: 2021-06-04 17:29:23 122 | 123 | 域名主办方: OPPO广东移动通信有限公司 124 | 域名: zeku.com 125 | 网站名称: OPPO广东移动通信有限公司 126 | 备案许可证号: 粤ICP备08130115号 127 | 网站备案号: 粤ICP备08130115号-11 128 | 域名类型: 企业 129 | 网站前置审批项: 无 130 | 是否限制接入: 否 131 | 审核通过日期: 2021-09-06 17:02:17 132 | 133 | [+] +++ oppo.com 域名的icp备案 粤ICP备08130115号 关联域名列表如下: 134 | allawnfs.com 135 | allawntech.com 136 | opdwz.cn 137 | coloros.com 138 | oppo.cn 139 | allawno.com 140 | coloros.net 141 | oppo.com 142 | oppodigital.com.cn 143 | oppodataintel.cn 144 | zeku.com 145 | ``` 146 | 例如toutiao.com 147 | ``` 148 | (py3env) ➜ python icp_domains.py toutiao.com 149 | ...(省略) 150 | [+] +++ toutiao.com 域名的icp备案 京ICP备12025439号 关联域名列表如下: 151 | bytegeckoext.com 152 | searchpstatp.com 153 | xiguashipin.cn 154 | bytefcdn.com 155 | ibdxiguaimg.com 156 | byteactivity15.com 157 | bytecimg.com 158 | bytetraffic.net 159 | ttbyte.net 160 | zijieurl.com 161 | zijieurl.cn 162 | toutiaowap.com 163 | toutiaowap.cn 164 | byteactivity.com 165 | xiguashipin.net 166 | originalstatic.com 167 | toutiaostatic.com 168 | toutiaopage.com 169 | bytedcdn.com 170 | bytegoofy.com 171 | bytegecko.com 172 | bytescm.com 173 | toutiaocdn.com 174 | bytedanceapi.com 175 | bdgslb.com 176 | toutiaoapi.com 177 | zijieapi.com 178 | bytednsdoc.com 179 | zijiecdn.net 180 | zijieimg.com 181 | zijieimg.cn 182 | toutiaocdn.cn 183 | originalvod.com 184 | byteorge.com 185 | byteapi.com 186 | wukongwenda.cn 187 | jstti.com 188 | xiguaapp.com 189 | itoutiaostatic.com 190 | bytetcc.com 191 | jokecommunity.cn 192 | byteactivity13.com 193 | zijieapi.cn 194 | bytemedi.com 195 | toutiaocloud.com 196 | xsgtvacct.com 197 | toutiaolite.com 198 | toutiao.com 199 | toutiao13.com 200 | zjgslb.com 201 | toutiaolite2.com 202 | zjcdn.com 203 | bdxiguavod.com 204 | itoutiaoimg.com 205 | byte-edge.com 206 | bytemastatic.com 207 | toutiaocloud.cn 208 | bytefast.net 209 | toutiao11.com 210 | toutiao12.com 211 | toutiao14.com 212 | toutiao15.com 213 | bdxiguastatic.com 214 | zijietiaodong.com 215 | byteimgc.com 216 | bytevalk.com 217 | baikevod.com 218 | tekkenthree.com 219 | toutiaovod.com 220 | bytetos.com 221 | zijieurl.cn 222 | toutiaowap.com 223 | toutiaowap.cn 224 | byteactivity.com 225 | xiguashipin.net 226 | originalstatic.com 227 | toutiaostatic.com 228 | toutiaopage.com 229 | bytedcdn.com 230 | bytegoofy.com 231 | bytedance.org 232 | ttbyte.cn 233 | zjbyte.com 234 | zjbyte.cn 235 | zijieurl.net 236 | toutiaowap.net 237 | zijiewap.com 238 | bdactivity.com 239 | activitybyte.com 240 | bytecdn.com 241 | bytemaimg.com 242 | pstatp.com 243 | ttwebview.com 244 | byted-edu.com 245 | byteacct.com 246 | bytedns.net 247 | searchtoutiaoimg.com 248 | wukong.com 249 | zijiecdn.com 250 | pacmantwo.com 251 | samasty.com 252 | zilrms.com 253 | ttjisu.com 254 | bytedns2.com 255 | byted-ug.com 256 | bytenewst.com 257 | byteorg.com 258 | searchstatic.com 259 | jokecommunity.net 260 | neihancommunity.com 261 | byteactivity16.com 262 | byteq8u.net 263 | bvfcdn.com 264 | bfcdnrd.com 265 | bytegeckoext.com 266 | searchpstatp.com 267 | xiguashipin.cn 268 | bytefcdn.com 269 | ibdxiguaimg.com 270 | byteactivity15.com 271 | bytecimg.com 272 | bytetraffic.net 273 | ttbyte.net 274 | zijieurl.com 275 | zijieurl.cn 276 | toutiaowap.com 277 | toutiaowap.cn 278 | byteactivity.com 279 | xiguashipin.net 280 | originalstatic.com 281 | bfcdnsc.com 282 | vfcdnrd.com 283 | wtturl.cn 284 | bytedance.com 285 | bytedance.net 286 | bytedance.cn 287 | ttbyte.com 288 | zjbyte.net 289 | zijiewap.cn 290 | zijiewap.net 291 | xiguavideo.cn 292 | cdndns2.com 293 | byte00.com 294 | bytecdn.net 295 | bytemaimg.com 296 | pstatp.com 297 | ttwebview.com 298 | byted-edu.com 299 | byteacct.com 300 | bytedns.net 301 | bytefae.com 302 | livecdnstatic.com 303 | zijiecdn.cn 304 | zijieimg.net 305 | toutiaocdn.net 306 | toutiaolite1.com 307 | tetrisone.com 308 | ixigua.com 309 | originalimg.com 310 | byteactivity12.com 311 | byteorg.com 312 | searchstatic.com 313 | jokecommunity.net 314 | neihancommunity.com 315 | toutiaolite2.com 316 | zjcdn.com 317 | bdxiguavod.com 318 | itoutiaoimg.com 319 | byte-edge.com 320 | bytemastatic.com 321 | bdxigualive.com 322 | byte008.com 323 | byteactivity14.com 324 | toutiaocloud.net 325 | snssdk.com 326 | ibdxiguastatic.com 327 | toutiaoliving.com 328 | byte-gslb.com 329 | byteq5k.com 330 | bytecdntp.com 331 | oortgslb.com 332 | bytegslb.com 333 | byteactivity16.com 334 | byteq8u.net 335 | bvfcdn.com 336 | bfcdnrd.com 337 | ``` 338 | 339 | ### Version 340 | #### v0.3 341 | - [fix bug: issues/2 修复源站字段名更改引发的报错](https://github.com/1in9e/icp-domains/issues/2) 342 | 343 | #### v0.2 344 | - 修复另一类icp格式(如"浙B2-20080224-1")的相关域名查询 345 | 346 | #### v0.1 347 | - 创建项目 348 | 349 | 350 | ### Thanks 351 | > 特别说明,备案号查多个备案详情来自于如下项目: 352 | - https://github.com/wongzeon/ICP-Checker 353 | 354 | -------------------------------------------------------------------------------- /example.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1in9e/icp-domains/6c0e9eac814ecea07fe5555ecdbe890272ca3625/example.jpg -------------------------------------------------------------------------------- /icp_domains.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # 根据域名icp备案号查询同备案号关联域名脚本 by _lin9e link: https://github.com/1in9e 3 | 4 | """ 5 | 【域名 -> ICP -> 关联域名s】 6 | icp查询from https://github.com/wongzeon/ICP-Checker 7 | 接口: 8 | <1> https://api.vvhan.com/api/icp?url= 9 | <2> https://hlwicpfwc.miit.gov.cn/icpproject_query/api/icpAbbreviateInfo/queryByCondition 10 | 接口<2>存在滑动验证码,利用cv2进行破解 11 | """ 12 | 13 | import requests, hashlib, time, base64, cv2, os, sys, json 14 | 15 | def main(domain): 16 | try: 17 | r = requests.get(url='https://api.vvhan.com/api/icp?url='+str(domain.strip())) 18 | js = json.loads(r.text) 19 | icp = js['info']['icp'] 20 | # icp存在两种格式: 21 | # A: 浙B2-20080224-1 22 | # B: 京ICP证030173号-1 23 | info = icp if '-' not in icp else icp.split('-')[0] if len(icp.split('-'))==2 else icp.split('-')[0]+'-'+icp.split('-')[1] 24 | except Exception as e: 25 | print(e) 26 | info = '' 27 | print("[*] {} 对应的备案号为{}".format(domain, icp)) 28 | if info: 29 | info_data = { 30 | 'pageNum':'', 31 | 'pageSize':'', 32 | 'unitName':info 33 | } 34 | #构造AuthKey 35 | timeStamp = int(round(time.time()*1000)) 36 | authSecret = 'testtest' + str(timeStamp) 37 | authKey = hashlib.md5(authSecret.encode(encoding='UTF-8')).hexdigest() 38 | #获取Cookie 39 | cookie_headers = { 40 | 'accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9', 41 | 'accept-encoding': 'gzip, deflate, br', 42 | 'accept-language': 'zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6', 43 | 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.72 Safari/537.36 Edg/90.0.818.42' 44 | } 45 | cookie = requests.utils.dict_from_cookiejar(requests.get('https://beian.miit.gov.cn/',headers=cookie_headers).cookies)['__jsluid_s'] 46 | #请求获取Token 47 | t_url = 'https://hlwicpfwc.miit.gov.cn/icpproject_query/api/auth' 48 | t_headers = { 49 | 'Host': 'hlwicpfwc.miit.gov.cn', 50 | 'Connection': 'keep-alive', 51 | 'sec-ch-ua': '" Not A;Brand";v="99", "Chromium";v="90", "Microsoft Edge";v="90"', 52 | 'Accept': '*/*', 53 | 'DNT': '1', 54 | 'sec-ch-ua-mobile': '?0', 55 | 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.85 Safari/537.36 Edg/90.0.818.46', 56 | 'Origin': 'https://beian.miit.gov.cn', 57 | 'Sec-Fetch-Site': 'same-site', 58 | 'Sec-Fetch-Mode': 'cors', 59 | 'Sec-Fetch-Dest': 'empty', 60 | 'Referer': 'https://beian.miit.gov.cn/', 61 | 'Accept-Encoding': 'gzip, deflate, br', 62 | 'Accept-Language': 'zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6', 63 | 'Cookie': '__jsluid_s=' + cookie 64 | } 65 | data = { 66 | 'authKey': authKey, 67 | 'timeStamp': timeStamp 68 | } 69 | t_response = requests.post(t_url,data=data,headers=t_headers) 70 | try: 71 | get_token = t_response.json()['params']['bussiness'] 72 | except: 73 | print('\n'"请求被禁止,请稍后或更换头部与IP后再试,状态码:",t_response.status_code) 74 | #获取验证图像、UUID 75 | p_url = 'https://hlwicpfwc.miit.gov.cn/icpproject_query/api/image/getCheckImage' 76 | p_headers = { 77 | 'Host': 'hlwicpfwc.miit.gov.cn', 78 | 'Connection': 'keep-alive', 79 | 'Content-Length': '0', 80 | 'sec-ch-ua': '" Not A;Brand";v="99", "Chromium";v="90", "Microsoft Edge";v="90"', 81 | 'Accept': 'application/json, text/plain, */*', 82 | 'DNT': '1', 83 | 'sec-ch-ua-mobile': '?0', 84 | 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.85 Safari/537.36 Edg/90.0.818.46', 85 | 'token': get_token, 86 | 'Origin': 'https://beian.miit.gov.cn', 87 | 'Sec-Fetch-Site': 'same-site', 88 | 'Sec-Fetch-Mode': 'cors', 89 | 'Sec-Fetch-Dest': 'empty', 90 | 'Referer': 'https://beian.miit.gov.cn/', 91 | 'Accept-Encoding': 'gzip, deflate, br', 92 | 'Accept-Language': 'zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6', 93 | 'Cookie': '__jsluid_s=' + cookie 94 | } 95 | p_request = requests.post(p_url,data='',headers=p_headers) 96 | try: 97 | p_uuid = p_request.json()['params']['uuid'] 98 | big_image = p_request.json()['params']['bigImage'] 99 | small_image = p_request.json()['params']['smallImage'] 100 | except KeyError: 101 | print("请重试,请求状态码:",p_request.status_code) 102 | #解码图片,写入并计算图片缺口位置 103 | with open('bigImage.jpg','wb') as f: 104 | f.write(base64.b64decode(big_image)) 105 | f.close() 106 | with open('smallImage.jpg','wb') as f: 107 | f.write(base64.b64decode(small_image)) 108 | f.close() 109 | background_image = cv2.imread('bigImage.jpg',cv2.COLOR_GRAY2RGB) 110 | fill_image = cv2.imread('smallImage.jpg',cv2.COLOR_GRAY2RGB) 111 | background_image_canny = cv2.Canny(background_image, 100, 200) 112 | fill_image_canny = cv2.Canny(fill_image, 100, 300) 113 | position_match = cv2.matchTemplate(background_image, fill_image, cv2.TM_CCOEFF_NORMED) 114 | min_val,max_val,min_loc,max_loc = cv2.minMaxLoc(position_match) 115 | position = max_loc 116 | mouse_length = position[0]+1 117 | os.remove('bigImage.jpg') 118 | os.remove('smallImage.jpg') 119 | #通过拼图验证,获取sign 120 | check_url = 'https://hlwicpfwc.miit.gov.cn/icpproject_query/api/image/checkImage' 121 | check_headers = { 122 | 'Host': 'hlwicpfwc.miit.gov.cn', 123 | 'Accept': 'application/json, text/plain, */*', 124 | 'Connection': 'keep-alive', 125 | 'Content-Length': '60', 126 | 'sec-ch-ua': '" Not A;Brand";v="99", "Chromium";v="90", "Microsoft Edge";v="90"', 127 | 'DNT': '1', 128 | 'sec-ch-ua-mobile': '?0', 129 | 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.72 Safari/537.36 Edg/90.0.818.42', 130 | 'token': get_token, 131 | 'Content-Type': 'application/json', 132 | 'Origin': 'https://beian.miit.gov.cn', 133 | 'Sec-Fetch-Site': 'same-site', 134 | 'Sec-Fetch-Mode': 'cors', 135 | 'Sec-Fetch-Dest': 'empty', 136 | 'Referer': 'https://beian.miit.gov.cn/', 137 | 'Accept-Encoding': 'gzip, deflate, br', 138 | 'Accept-Language': 'zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6', 139 | 'Cookie': '__jsluid_s=' + cookie 140 | } 141 | check_data = { 142 | 'key':p_uuid, 143 | 'value':mouse_length 144 | } 145 | check_request = requests.post(check_url,json=check_data,headers=check_headers) 146 | try: 147 | sign = check_request.json()['params'] 148 | except Exception: 149 | print('\n'"请求被禁止,请稍后或更换头部与IP后再试,状态码:",check_request.status_code) 150 | #获取备案信息 151 | info_url = 'https://hlwicpfwc.miit.gov.cn/icpproject_query/api/icpAbbreviateInfo/queryByCondition' 152 | info_headers = { 153 | 'Host': 'hlwicpfwc.miit.gov.cn', 154 | 'Connection': 'keep-alive', 155 | 'Content-Length': '78', 156 | 'sec-ch-ua': '" Not A;Brand";v="99", "Chromium";v="90", "Microsoft Edge";v="90"', 157 | 'DNT': '1', 158 | 'sec-ch-ua-mobile': '?0', 159 | 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.72 Safari/537.36 Edg/90.0.818.42', 160 | 'Content-Type': 'application/json', 161 | 'Accept': 'application/json, text/plain, */*', 162 | 'uuid': p_uuid, 163 | 'token': get_token, 164 | 'sign': sign, 165 | 'Origin': 'https://beian.miit.gov.cn', 166 | 'Sec-Fetch-Site': 'same-site', 167 | 'Sec-Fetch-Mode': 'cors', 168 | 'Sec-Fetch-Dest': 'empty', 169 | 'Referer': 'https://beian.miit.gov.cn/', 170 | 'Accept-Encoding': 'gzip, deflate, br', 171 | 'Accept-Language': 'zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6', 172 | 'Cookie': '__jsluid_s=' + cookie 173 | } 174 | info_request = requests.post(info_url,json=info_data,headers=info_headers) 175 | domain_total = info_request.json()['params']['total'] 176 | page_total = info_request.json()['params']['lastPage'] 177 | page_size = info_request.json()['params']['pageSize'] 178 | start_row = info_request.json()['params']['startRow'] 179 | end_row = info_request.json()['params']['endRow'] 180 | 181 | print("\n[*] 查询对象", info, "共有", domain_total, "个备案域名") 182 | print("[+] 域名具体信息如下:") 183 | domain_list = [] 184 | for i in range(1,page_total+1): 185 | for k in range(start_row, end_row+1): 186 | info_base = info_request.json()['params']['list'][k] 187 | domain_name = info_base['domain'] 188 | domain_list.append(domain_name) 189 | domain_type = info_base['natureName'] 190 | domain_licence = info_base['mainLicence'] 191 | domain_web_licence = info_base['serviceLicence'] 192 | domain_site_name = info_base['unitName'] 193 | domain_status = info_base['limitAccess'] 194 | domain_approve_date = info_base['updateRecordTime'] 195 | domain_owner = info_base['unitName'] 196 | try: 197 | domain_content_approved = info_base['contentTypeName'] 198 | if not bool(domain_content_approved): 199 | domain_content_approved = "无" 200 | except KeyError: 201 | domain_content_approved = "无" 202 | print("\n域名主办方:",domain_owner) 203 | print("域名:",domain_name) 204 | print("网站名称:",domain_site_name) 205 | print("备案许可证号:",domain_licence) 206 | print("网站备案号:",domain_web_licence) 207 | print("域名类型:",domain_type) 208 | print("网站前置审批项:",domain_content_approved) 209 | print("是否限制接入:",domain_status) 210 | print("审核通过日期:",domain_approve_date) 211 | info_data_page = { 212 | 'pageNum':i+1, 213 | 'pageSize':'10', 214 | 'unitName':info 215 | } 216 | if info_data_page['pageNum'] > page_total: 217 | # print("查询完毕") 218 | break 219 | else: 220 | info_request = requests.post(info_url,json=info_data_page,headers=info_headers) 221 | start_row = info_request.json()['params']['startRow'] 222 | end_row = info_request.json()['params']['endRow'] 223 | time.sleep(3) 224 | print("\n[+] RESULT: {} 域名的icp备案 {} 关联域名列表如下: ".format(domain, icp)) 225 | for i in domain_list: 226 | print(i) 227 | 228 | if __name__ == '__main__': 229 | if len(sys.argv) != 2: 230 | print("---ICP查关联域名--- V0.3 by _lin9e") 231 | print("Usage: {} 'domain'".format(sys.argv[0])) 232 | print("例如: python icp_domains.py oppo.com") 233 | else: 234 | main(sys.argv[1]) 235 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | opencv_python 2 | requests==2.25.0 3 | --------------------------------------------------------------------------------