子域名的介绍及收集

1、子域名作用编辑

收集子域名可以扩大测试范围,同一域名下的二级域名都属于目标范围。

2、 常用方式编辑

子域名中的常见资产类型一般包括办公系统,邮箱系统,论坛,商城,其他管理系统,网站管理后台也有可能出现子域名中。

首先找到目标站点,在官网中可能会找到相关资产(多为办公系统,邮箱系统等),关注一下页面底部,也许有管理后台等收获。

查找目标域名信息的方法有:

  1. FOFA title=“公司名称”
  2. 百度 intitle=公司名称
  3. Google intitle=公司名称
  4. 站长之家,直接搜索名称或者网站域名即可查看相关信息:

http://tool.chinaz.com/

  1. 钟馗之眼 site=域名即可

https://www.zoomeye.org/

找到官网后,再收集子域名,下面推荐几种子域名收集的方法,直接输入domain即可查询

3、域名的类型编辑

A记录、别名记录(CNAME)、MX记录、TXT记录、NS记录:

3.1. A (Address) 记录:

是用来指定主机名(或域名)对应的IP地址记录。用户可以将该域名下的网站服务器指向到自己的web server上。同时也可以设置您域名的二级域名。

3.2. 别名(CNAME)记录:

也被称为规范名字。这种记录允许您将多个名字映射到同一台计算机。通常用于同时提供WWW和MAIL服务的计算机。例如,有一台计算机名为“host.mydomain.com”(A记录)。它同时提供WWW和MAIL服务,为了便于用户访问服务。可以为该计算机设置两个别名(CNAME):WWW和MAIL。这两个别名的全称就是“www.mydomain.com”和“mail.mydomain.com”。实际上他们都指向“host.mydomain.com”。同样的方法可以用于当您拥有多个域名需要指向同一服务器IP,此时您就可以将一个域名做A记录指向服务器IP然后将其他的域名做别名到之前做A记录的域名上,那么当您的服务器IP地址变更时您就可以不必麻烦的一个一个域名更改指向了 只需要更改做A记录的那个域名其他做别名的那些域名的指向也将自动更改到新的IP地址上了。

3.3. 如何检测CNAME记录?

1、进入命令状态;(开始菜单 - 运行 - CMD[回车]);

2、输入命令" nslookup -q=cname 这里填写对应的域名或二级域名",查看返回的结果与设置的是否一致即可。

3.4. MX(Mail Exchanger)记录:

是邮件交换记录,它指向一个邮件服务器,用于电子邮件系统发邮件时根据 收信人的地址后缀来定位邮件服务器。例如,当Internet上的某用户要发一封信给 [email protected] 时,该用户的邮件系统通过DNS查找mydomain.com这个域名的MX记录,如果MX记录存在, 用户计算机就将邮件发送到MX记录所指定的邮件服务器上。

3.5. 什么是TXT记录?:

TXT记录一般指为某个主机名或域名设置的说明,如:

1)admin IN TXT “jack, mobile:13800138000”;

2)mail IN TXT “邮件主机, 存放在xxx ,管理人:AAA”,Jim IN TXT “contact: [email protected]

也就是您可以设置 TXT ,以便使别人联系到您。

如何检测TXT记录?

1、进入命令状态;(开始菜单 - 运行 - CMD[回车]);

2、输入命令" nslookup -q=txt 这里填写对应的域名或二级域名",查看返回的结果与设置的是否一致即可。

3.6. 什么是NS记录?

ns记录全称为Name Server 是一种域名服务器记录,用来明确当前你的域名是由哪个DNS服务器来进行解析的。

3.7. 子域名在线查询1

https://phpinfo.me/domain/子域名的介绍及收集_第1张图片

3.8. 子域名在线查询2

https://www.t1h2ua.cn/tools/

1658829087_62dfb91f636b5c62850e2.png!small?1658829088139

3.9. dns侦测
https://dnsdumpster.com/
1658829109_62dfb935076c2f0fac1c9.png!small?1658829109546

3.10. IP138查询子域名
https://site.ip138.com/baidu.com/domain.htm

1658829115_62dfb93b56d8ac01ab15c.png!small?1658829116271

3.11. FOFA搜索子域名
https://fofa.so/

语法:domain="baidu.com"1658829128_62dfb9482ff162a4515f9.png!small?1658829129170

提示:以上两种方法无需爆破,查询速度快,需要快速收集资产时可以优先使用,后面再用其他方法补充。

3.12. Hackertarget查询子域名
https://hackertarget.com/find-dns-host-records/

注意:通过该方法查询子域名可以得到一个目标大概的ip段,接下来可以通过ip来收集信息。

  1. 360测绘空间编辑
    https://quake.360.cn/

domain:“*.freebuf.com”

4.1. Layer子域名挖掘机1658829204_62dfb994e36eb33bd525c.png!small?1658829205479
4.2. SubDomainBrute
pip install aiodns

1658829209_62dfb999dde24670eac7c.png!small?1658829210420

运行命令subDomainsBrute.py freebuf.com

subDomainsBrute.py freebuf.com --full -o freebuf2.txt

4.3. Sublist3r
https://github.com/aboul3la/Sublist3r

pip install -r requirements.txt

提示:以上方法为爆破子域名,由于字典比较强大,所以效率较高。

帮助文档

usage: sublist3r.py [-h] -d DOMAIN [-b [BRUTEFORCE]] [-p PORTS] [-v [VERBOSE]]

[-t THREADS] [-e ENGINES] [-o OUTPUT] [-n]

OPTIONS:

-h, --help show this help message and exit

-d DOMAIN, --domain DOMAIN

Domain name to enumerate it’s subdomains

-b [BRUTEFORCE], --bruteforce [BRUTEFORCE]

Enable the subbrute bruteforce module

-p PORTS, --ports PORTS

Scan the found subdomains against specified tcp ports

-v [VERBOSE], --verbose [VERBOSE]

Enable Verbosity and display results in realtime

-t THREADS, --threads THREADS

Number of threads to use for subbrute bruteforce

-e ENGINES, --engines ENGINES

Specify a comma-separated list of search engines

-o OUTPUT, --output OUTPUT

Save the results to text file

-n, --no-color Output without color

Example: python sublist3r.py -d google.com

中文翻译

-h :帮助

-d :指定主域名枚举子域名

-b :调用subbrute暴力枚举子域名

-p :指定tpc端口扫描子域名

-v :显示实时详细信息结果

-t :指定线程

-e :指定搜索引擎

-o :将结果保存到文本

-n :输出不带颜色

默认参数扫描子域名

python sublist3r.py -d baidu.com

使用暴力枚举子域名

python sublist3r -b -d baidu.com

4.4. python2.7.14 环境
;C:\Python27;C:\Python27\Scripts

4.5. OneForALL
pip3 install --user -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple/

python3 oneforall.py --target baidu.com run /收集/

1658829232_62dfb9b0b693a49499e72.png!small?1658829233978

爆破子域名

Example:

brute.py --target domain.com --word True run

brute.py --targets ./domains.txt --word True run

brute.py --target domain.com --word True --concurrent 2000 run

brute.py --target domain.com --word True --wordlist subnames.txt run

brute.py --target domain.com --word True --recursive True --depth 2 run

brute.py --target d.com --fuzz True --place m.*.d.com --rule ‘[a-z]’ run

brute.py --target d.com --fuzz True --place m.*.d.com --fuzzlist subnames.txt run1658829373_62dfba3d07cdde687877a.png!small?1658829374065

4.6. Wydomain
dnsburte.py -d aliyun.com -f dnspod.csv -o aliyun.log

wydomain.py -d aliyun.com

4.7. FuzzDomain
1658829377_62dfba41828ca9707bdb0.png!small?1658829378949

你可能感兴趣的:(网络安全,web安全)