Kali Linux基础篇(一) 信息收集

一、前言

1、信息收集分主动信息收集和被动信息收集

  1. 主动方式:攻击者直接访问网站,对网站做出扫描、探测等行为,目标系统可能会记录操作信息
  2. 被动方式:利用第三方的服务访问目标,被动信息收集不会留下访问痕迹,攻击者不直接与目标建立交互,目标系统无法记录攻击者信息,避免被溯源发现,但收集到的信息来源都是第三方,无法确保准确性和质量。常用的如:百度、Google、fofa、shodan、Zoomeye。

2、信息收集要收集什么呢:

  • 域名相关信息
  • IP及C段
  • 端口
  • 目录
  • 指纹
  • 使用的技术和配置
  • 联系方式如电话、邮箱等等。

信息收集就是要尽可能的全面,前期信息收集铺的路越宽,后期攻击的时候路就越好走。

二、注意

没有一种方式是最完美的,每个方式都有自己的优势。

  • 主动方式:获取到的信息较多,但是操作和地址等信息会被目标记录。
  • 被动方式:获取到的信息相对较少,但是优点是安全,不会被溯源。

三、工具介绍

1.whois

详细的介绍可以查看:https://www.ietf.org/rfc/rfc3912.txt

whois baidu.com

在这里插入图片描述
该工具可以获取目标站点的DNS服务器信息,域名注册基本信息。不要小看这些信息,任何一个都有可能在后期的测试阶段发挥作用。
不想使用该工具的,也可以使用在线网站进行信息查询:

http://whois.chinaz.com/
http://www.internic.net/whois.html

域名信息收集完成,接下来介绍一个收集DNS服务器信息的工具。

2.DNS分析工具-host

我们可以使用下面的命令行工具来借助一个DNS服务器查找目标主机的IP地址:

┌──(root㉿kali)-[~]
└─# host www.baidu.com
www.baidu.com is an alias for www.a.shifen.com.
www.a.shifen.com has address 120.232.145.185
www.a.shifen.com has address 120.232.145.144

我们可以看到有两个IP地址??

一般情况下,host查找的是A,AAAA和MX的记录。

查询详细的记录只需要添加 -a

┌──(root㉿kali)-[~]
└─# host -a www.baidu.com
Trying "www.baidu.com"
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 56690
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 5, ADDITIONAL: 9

;; QUESTION SECTION:
;www.baidu.com.                 IN      ANY

;; ANSWER SECTION:
www.baidu.com.          5       IN      CNAME   www.a.shifen.com.

;; AUTHORITY SECTION:
baidu.com.              5       IN      NS      dns.baidu.com.
baidu.com.              5       IN      NS      ns3.baidu.com.
baidu.com.              5       IN      NS      ns2.baidu.com.
baidu.com.              5       IN      NS      ns7.baidu.com.
baidu.com.              5       IN      NS      ns4.baidu.com.

;; ADDITIONAL SECTION:
ns7.baidu.com.          5       IN      AAAA    240e:940:603:4:0:ff:b01b:589a
ns7.baidu.com.          5       IN      AAAA    240e:bf:b801:1002:0:ff:b024:26de
ns4.baidu.com.          5       IN      A       111.45.3.226
ns4.baidu.com.          5       IN      A       14.215.178.80
dns.baidu.com.          5       IN      A       110.242.68.134
ns2.baidu.com.          5       IN      A       220.181.33.31
ns3.baidu.com.          5       IN      A       153.3.238.93
ns3.baidu.com.          5       IN      A       36.155.132.78
ns7.baidu.com.          5       IN      A       180.76.76.92
Received 316 bytes from 172.16.188.2#53 in 76 ms

3.dig

除了host命令,你也可以使用dig命令对DNS服务器进行挖掘。相对于host命令,dig命令更具有灵活和清晰的显示信息

┌──(root㉿kali)-[~]
└─# dig www.baidu.com

; <<>> DiG 9.18.4-2-Debian <<>> www.baidu.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 1760
;; flags: qr rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 5, ADDITIONAL: 9

;; QUESTION SECTION:
;www.baidu.com.                 IN      A

;; ANSWER SECTION:
www.baidu.com.          5       IN      CNAME   www.a.shifen.com.
www.a.shifen.com.       5       IN      A       120.232.145.185
www.a.shifen.com.       5       IN      A       120.232.145.144

;; AUTHORITY SECTION:
a.shifen.com.           5       IN      NS      ns5.a.shifen.com.
a.shifen.com.           5       IN      NS      ns3.a.shifen.com.
a.shifen.com.           5       IN      NS      ns2.a.shifen.com.
a.shifen.com.           5       IN      NS      ns4.a.shifen.com.
a.shifen.com.           5       IN      NS      ns1.a.shifen.com.

;; ADDITIONAL SECTION:
ns5.a.shifen.com.       5       IN      A       180.76.76.95
ns1.a.shifen.com.       5       IN      A       110.242.68.42
ns2.a.shifen.com.       5       IN      A       220.181.33.32
ns3.a.shifen.com.       5       IN      A       153.3.238.162
ns3.a.shifen.com.       5       IN      A       36.155.132.12
ns4.a.shifen.com.       5       IN      A       111.20.4.28
ns4.a.shifen.com.       5       IN      A       14.215.177.229
ns5.a.shifen.com.       5       IN      AAAA    240e:bf:b801:1006:0:ff:b04f:346b
ns5.a.shifen.com.       5       IN      AAAA    240e:940:603:a:0:ff:b08d:239d

;; Query time: 32 msec
;; SERVER: 172.16.188.2#53(172.16.188.2) (UDP)
;; WHEN: Tue Sep 12 22:24:33 EDT 2023
;; MSG SIZE  rcvd: 348

4.dnsenum

  1. 我们可以利用dnsenum从DNS服务器上获取以下信息:

     主机IP地址
     该域名的DNS服务器
     该域名的MX记录
    
  2. 除了被用来获取DNS信息,dnsenum还具有以下特点:

    使用谷歌浏览器获取子域名
    暴力破解
    C级网络扫描
    反向查找网络
    
  3. 命令:dnsenum baidu.com

    └─# dnsenum baidu.com
    dnsenum VERSION:1.2.6
    
    -----   baidu.com   -----
    
    
    Host's addresses:
    __________________
    
    baidu.com.                               5        IN    A        39.156.66.10
    baidu.com.                               5        IN    A        110.242.68.66
    
    
    Name Servers:
    ______________
    
    ns2.baidu.com.                           5        IN    A        220.181.33.31
    ns4.baidu.com.                           5        IN    A        14.215.178.80
    ns4.baidu.com.                           5        IN    A        111.45.3.226
    ns7.baidu.com.                           5        IN    A        180.76.76.92
    dns.baidu.com.                           5        IN    A        110.242.68.134
    ns3.baidu.com.                           5        IN    A        153.3.238.93
    ns3.baidu.com.                           5        IN    A        36.155.132.78
    
    
    Mail (MX) Servers:
    ___________________
    
    mx1.baidu.com.                           5        IN    A        111.202.115.85
    mx1.baidu.com.                           5        IN    A        220.181.3.85
    mx50.baidu.com.                          5        IN    A        12.0.243.41
    usmx01.baidu.com.                        5        IN    A        12.0.243.41
    jpmx.baidu.com.                          5        IN    A        119.63.196.201
    mx.maillb.baidu.com.                     5        IN    A        111.202.115.85
    mx.n.shifen.com.                         5        IN    A        111.202.115.85
    mx.n.shifen.com.                         5        IN    A        111.206.215.185
    Trying Zone Transfers and getting Bind Versions:
    

4.fierce

fierce 是使用多种技术来扫描目标主机IP地址和主机名的一个DNS服务器枚举工具。运用递归的方式来工作。它的工作原理是先通过查询本地DNS服务器来查找目标DNS服务器,然后使用目标DNS服务器来查找子域名。fierce的主要特点就是可以用来定位独立IP空间对应域名和主机名。

启动fierce使用的命令:fierce -h 查看帮助

└─# fierce --domain baidu.com
NS: dns.baidu.com. ns3.baidu.com. ns4.baidu.com. ns7.baidu.com. ns2.baidu.com.
SOA: dns.baidu.com. (110.242.68.134)
Zone: failure
Wildcard: failure
Found: 0.baidu.com. (111.13.100.240)
Found: 01.baidu.com. (110.242.68.125)
Found: 11.baidu.com. (182.61.62.50)
Found: a.baidu.com. (112.34.113.160)
Found: abc.baidu.com. (120.232.145.185)
Found: ac.baidu.com. (180.97.104.203)
Found: ad.baidu.com. (182.61.62.50)
Found: ae.baidu.com. (110.242.68.66)
Found: af.baidu.com. (110.242.68.110)
Found: ag.baidu.com. (202.108.23.198)
Found: ai.baidu.com. (39.156.66.240)
Found: antivirus.baidu.com. (103.235.46.69)
Found: ap.baidu.com. (117.185.16.78)
Nearby:
{'117.185.16.73': '.',
 '117.185.16.74': '.',
 '117.185.16.75': '.',
 '117.185.16.76': '.',
 '117.185.16.77': '.',
 '117.185.16.78': '.',
 '117.185.16.79': '.',
 '117.185.16.80': '.',
 '117.185.16.81': '.',
 '117.185.16.82': '.',
 '117.185.16.83': '.'}
Found: apollo.baidu.com. (106.13.248.59)
Found: app.baidu.com. (112.34.111.126)
Found: aq.baidu.com. (111.45.3.140)
Found: ar.baidu.com. (112.34.111.78)
Found: as.baidu.com. (112.34.111.126)
Found: auction.baidu.com. (111.206.209.70)
Found: auth.baidu.com. (112.34.111.209)
Found: auto.baidu.com. (183.232.232.206)

5.DMitry

DMitry是一个综合的信息收集工具。包括:

 1. 端口扫描
 2. whois主机IP和域名信息
 1. 从Netcraft.com获取主机信息
 2. 子域名
 3. 域名中包含的邮件地址

使用DMitry可以把这些信息都保存在同一个文件中,比一个个去收集这些信息要方便。
举例:dmitry -winse baidu.com

在这里插入图片描述
再一个例子,通过dmitry 来扫描网站端口
dmitry -p baidu.com -f -b
在这里插入图片描述

6.Maltego

Maltego是一个开源的取证工具,它可以挖掘和收集信息并且有图形界面。
工具包括:

 1. 域名
 2. DNS
 3. Whois
 4. IP地址
 5. 网络块

也可以收集以下信息:

 1. 公司、组织
 2. 电子邮件
 3. 社交网络关系
 4. 电话号码

7.theHarvester

theharvester是一个电子邮件,用户名和主机名/子域名信息收集工具。它收集来自各种公开的信息来源。最新版本支持的信息来源包括:

 1. Google
 2. Google profiles
 3. Bing
 4. PGP
 5. LinkedIn
 6. Yandex
 7. People123
 8. Jigsaw

举例通过bing来收集
theHarvester -d baidu.com -l 100 -b bing

 theHarvester -d baidu.com -l 100 -b bing

*******************************************************************
*  _   _                                            _             *
* | |_| |__   ___    /\  /\__ _ _ ____   _____  ___| |_ ___ _ __  *
* | __|  _ \ / _ \  / /_/ / _` | '__\ \ / / _ \/ __| __/ _ \ '__| *
* | |_| | | |  __/ / __  / (_| | |   \ V /  __/\__ \ ||  __/ |    *
*  \__|_| |_|\___| \/ /_/ \__,_|_|    \_/ \___||___/\__\___|_|    *
*                                                                 *
* theHarvester 4.0.3                                              *
* Coded by Christian Martorella                                   *
* Edge-Security Research                                          *
* cmartorella@edge-security.com                                   *
*                                                                 *
*******************************************************************


[*] Target: baidu.com

        Searching 0 results.
[*] Searching Bing.

[*] No IPs found.

[*] No emails found.

[*] No hosts found.

8.Metagoofil

Metagoofil是一款利用Google收集信息的工具,目前支持的类型如下:

 1. word
 2. ppt
 3. Excel
 4. PDF

命令:
metagoofil -d baidu.com -t doc,xls -l 20 -n 5 -f test.html

└─# metagoofil  -d baidu.com
usage: metagoofil.py [-h] -d DOMAIN [-e DELAY] [-f [SAVE_FILE]] [-i URL_TIMEOUT] [-l SEARCH_MAX] [-n DOWNLOAD_FILE_LIMIT]
                     [-o SAVE_DIRECTORY] [-r NUMBER_OF_THREADS] -t FILE_TYPES [-u [USER_AGENT]] [-w]
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

丢了少年失了心1

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值