├── .gitignore ├── README.md ├── chinaz.py ├── main.py ├── screenshot └── screenshot.png └── url.txt /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | .eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | var/ 22 | wheels/ 23 | pip-wheel-metadata/ 24 | share/python-wheels/ 25 | *.egg-info/ 26 | .installed.cfg 27 | *.egg 28 | MANIFEST 29 | 30 | # PyInstaller 31 | # Usually these files are written by a python script from a template 32 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 33 | *.manifest 34 | *.spec 35 | 36 | # Installer logs 37 | pip-log.txt 38 | pip-delete-this-directory.txt 39 | 40 | # Unit test / coverage reports 41 | htmlcov/ 42 | .tox/ 43 | .nox/ 44 | .coverage 45 | .coverage.* 46 | .cache 47 | nosetests.xml 48 | coverage.xml 49 | *.cover 50 | *.py,cover 51 | .hypothesis/ 52 | .pytest_cache/ 53 | 54 | # Translations 55 | *.mo 56 | *.pot 57 | 58 | # Django stuff: 59 | *.log 60 | local_settings.py 61 | db.sqlite3 62 | db.sqlite3-journal 63 | 64 | # Flask stuff: 65 | instance/ 66 | .webassets-cache 67 | 68 | # Scrapy stuff: 69 | .scrapy 70 | 71 | # Sphinx documentation 72 | docs/_build/ 73 | 74 | # PyBuilder 75 | target/ 76 | 77 | # Jupyter Notebook 78 | .ipynb_checkpoints 79 | 80 | # IPython 81 | profile_default/ 82 | ipython_config.py 83 | 84 | # pyenv 85 | .python-version 86 | 87 | # pipenv 88 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 89 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 90 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 91 | # install all needed dependencies. 92 | #Pipfile.lock 93 | 94 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow 95 | __pypackages__/ 96 | 97 | # Celery stuff 98 | celerybeat-schedule 99 | celerybeat.pid 100 | 101 | # SageMath parsed files 102 | *.sage.py 103 | 104 | # Environments 105 | .env 106 | .venv 107 | env/ 108 | venv/ 109 | ENV/ 110 | env.bak/ 111 | venv.bak/ 112 | 113 | # Spyder project settings 114 | .spyderproject 115 | .spyproject 116 | 117 | # Rope project settings 118 | .ropeproject 119 | 120 | # mkdocs documentation 121 | /site 122 | 123 | # mypy 124 | .mypy_cache/ 125 | .dmypy.json 126 | dmypy.json 127 | 128 | # Pyre type checker 129 | .pyre/ 130 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 目前该项目为旧版本,已经无法达到预期效果,请勿使用! 2 | 3 | 4 | # WhoisSubodmain 5 | 6 | > 通过Whois信息发现更多与目标有关联的域名,扩大攻击面。 7 | 8 | ## :bulb:描述 9 | 为什么想做这个? 10 | 在以往的渗透测试流程中,前期信息搜集是一个非常耗时的事情,如:目标有哪些子公司?目标对外有哪些投资?目标的母公司是什么?以这些为出发点开始思考,如何能"自动化"?,想了想还是慢慢的先把各个小点击破,另外一个出发点是应对XX行动,Let's do it 11 | 12 | ## 功能 13 | - [x] 注册联系人反查 14 | - [x] 注册邮箱反查 15 | - [x] 注册联系人邮箱反查 16 | - [x] ICP备案号反查 17 | - [x] 邮箱黑名单 18 | - [x] 联系人黑名单 19 | 20 | 21 | 注册联系人邮箱反查: 22 | 在以往的渗透中发现反查联系人会有多个不同邮箱的情况,故该功能点产生 23 | 24 | 邮箱黑名单: 25 | 包含常见的域名服务商,例如xinnet.com,ename.com等,主要减少噪音,如想要添加请修改chinaz.py内email_blacklist 26 | 27 | 联系人黑名单: 28 | 顾名思义和邮箱黑名单作用一样,减少噪音 29 | 30 | ## 如何使用 31 | 将目标一行一个放置根目录下url.txt内,最终输出程序根目录res.txt 32 | 33 | ```text 34 | python3 main.py 35 | ``` 36 | 37 | ## 运行截图 38 |  39 | 40 | 41 | ## 思考 42 | 做出来在告诉你 :-0 43 | -------------------------------------------------------------------------------- /chinaz.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env python3 2 | # -*- coding:utf-8 -*- 3 | 4 | 5 | ''' 6 | Author:YoungRichOG 7 | Hacking Everything :-) 8 | 2020/07/17 9 | ''' 10 | 11 | import requests,re,time,json 12 | 13 | 14 | headers = { 15 | 'User-Agent':'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_0) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.56 Safari/535.11' 16 | } 17 | 18 | def get_whois(domain): 19 | time.sleep(2) 20 | email_re = '(/reverse\?ddlSearchMode=1.*)">' 21 | domain_re = '(/reverse\?host=.*&ddlSearchMode=2)"' 22 | 23 | url = "http://whois.chinaz.com/{}".format(domain) 24 | r = requests.get(url=url,headers=headers) 25 | print('[*] 当前状态码:%s' %r.status_code) 26 | try: 27 | email = re.findall(email_re,r.text) 28 | contacts = re.findall(domain_re,r.text) 29 | except Exception as e: 30 | print(e) 31 | if email == []: 32 | email = 'null' 33 | else: 34 | email = email[0] 35 | if contacts == []: 36 | contacts ='null' 37 | else: 38 | contacts = contacts[0] 39 | 40 | email,contacts = check_blacklist(email,contacts) 41 | return email,contacts 42 | 43 | def get_email_info(email): 44 | domain = [] 45 | if email != 'null': 46 | print('[*] 开始获取邮箱反查') 47 | for i in range(1,101): 48 | time.sleep(2) 49 | print('[*] 第%s页' % i) 50 | url = "http://whois.chinaz.com{}&st=&startDay=&endDay=&wTimefilter=$wTimefilter&page={}".format(email,i) 51 | domain_re = '