使用recon/domains-hosts/baidu_site模块,枚举baidu网站的子域
使用recon/domains-hosts/baidu_site模块,枚举baidu网站的子域
【实例3-1】使用recon/domains-hosts/baidu_site模块,枚举baidu网站的子域。具体操作步骤如下所示:本文选自Kail Linux渗透测试实训手册
(1)使用recon/domains-hosts/baidu_site模块。执行命令如下所示:
- [recon-ng][default] > use recon/domains-hosts/baidu_site
(2)查看该模块下可配置选项参数。执行命令如下所示:
- [recon-ng][default][baidu_site] > show options
- Name Current Value Req Description
- -------------- ---------------------- --------- -------------------------------------------------------
- SOURCE default yes source of input (see 'show info' for details)
- [recon-ng][default][baidu_site] >
从输出的信息中,可以看到有一个选项需要配置。
(3)配置SOURCE选项参数。执行命令如下所示:
- [recon-ng][default][baidu_site] > set SOURCE baidu.com
- SOURCE => baidu.com
从输出的信息中,可以看到SOURCE选项参数已经设置为baidu.com,本文选自Kail Linux渗透测试实训手册。
(4)启动信息收集。执行命令如下所示:
- [recon-ng][default][baidu_site] > run
- ---------
- BAIDU.COM
- ---------
- [*] URL: http://www.baidu.com/s?pn=0&wd=site%3Abaidu.com
- [*] map.baidu.com
- [*] 123.baidu.com
- [*] jingyan.baidu.com
- [*] top.baidu.com
- [*] www.baidu.com
- [*] hi.baidu.com
- [*] video.baidu.com
- [*] pan.baidu.com
- [*] zhidao.baidu.com
- [*] Sleeping to avoid lockout...
- -------
- SUMMARY
- -------
- [*] 9 total (2 new) items found.
从输出的信息中,可以看到找到9个子域。枚举到的所有数据将被连接到Recon-NG放置的数据库中。这时候,用户可以创建一个报告查看被连接的数据。
【实例3-2】查看获取的数据。具体操作步骤如下所示:
(1)选择reporting/csv模块,执行命令如下所示:
- [recon-ng][default] > use reporting/csv
(2)创建报告。执行命令如下所示:
- [recon-ng][default][csv] > run
- [*] 9 records added to '/root/.recon-ng/workspaces/default/results.csv'.
从输出的信息可以看到,枚举到的9个记录已被添加到/root/.recon-ng/workspaces/default/results.csv文件中。打开该文件,本文选自Kail Linux渗透测试实训手册如图3.1所示。
图3.1 results.csv文件
(3)从该界面可以看到,枚举到的所有子域。
用户也可以使用Dmitry命令,查询关于网站的信息。下面将介绍Dmitry命令的使用。
查看Dmitry命令的帮助信息。执行命令如下所示:
- root@kali:~# dmitry -h
- Deepmagic Information Gathering Tool
- "There be some deep magic going on"
- dmitry: invalid option -- 'h'
- Usage: dmitry [-winsepfb] [-t 0-9] [-o %host.txt] host
- -o Save output to %host.txt or to file specified by -o file
- -i Perform a whois lookup on the IP address of a host
- -w Perform a whois lookup on the domain name of a host
- -n Retrieve Netcraft.com information on a host
- -s Perform a search for possible subdomains
- -e Perform a search for possible email addresses
- -p Perform a TCP port scan on a host
- * -f Perform a TCP port scan on a host showing output reporting filtered ports
- * -b Read in the banner received from the scanned port
- * -t 0-9 Set the TTL in seconds when scanning a TCP port ( Default 2 )
- *Requires the -p flagged to be passed
以上信息显示了dmitry命令的语法格式和所有可用参数。下面使用dmitry命令的-s选项,查询合理的子域。执行命令如下所示:
- root@kali:~# dmitry -s google.com
- Deepmagic Information Gathering Tool
- "There be some deep magic going on"
- HostIP:173.194.127.71
- HostName:google.com
- Gathered Subdomain information for google.com
- ---------------------------------
- Searching Google.com:80...
- HostName:www.google.com
- HostIP:173.194.127.51
- Searching Altavista.com:80...
- Found 1 possible subdomain(s) for host google.com, Searched 0 pages containing 0 results
- All scans completed, exiting
从输出的信息中,可以看到搜索到一个子域。该子域名为www.google.com,IP地址为173.194.127.51。该命令默认是从google.com网站搜索,如果不能连接google.com网站的话,执行以上命令将会出现Unable to connect: Socket Connect Error错误信息本文选自Kail Linux渗透测试实训手册。