f10@t's blog

kali-渗透测试-信息收集3

字数统计: 1.9k阅读时长: 8 min
2019/05/11

第三部分。首先要明确这些都属于前期的被动信息收集,并没有与目标发生直接的网络接触。下面介绍常用的搜索引擎使用方法

SHODAN

简介:SHODAN是世界上第一个可以用于搜索物联网设备等的搜索引擎,它的返回信息十分丰富,包括IP地址Banner信息、实际的物理地址(有地图参考)、开放的端口、甚至标明了可能存在CVE等等。

我们只需要使用指定的过滤器进行查询即可,下面列出了常用的几个过滤器:

  • 基础:
    • net (如192.168.0.100)
    • city
    • country(CN、US)
    • port(80、21、22、23)
    • os
    • Hostname(主机或域名)
    • server
  • 实用:
    • 200 OK cisco country:JP //搜索日本的思科设备
    • user:admin pass:password //搜索登录页面
    • linux upnp avtech //搜索后台登录网页

示例,查找指定IP、可以搜索一个网段:

指定国家来搜索:

指定国家和城市,点击就可以查看到详细的信息

搜索一些后台登录网站

再比如搜索中国北京的开放端口81的,返回200信息的查询

     SHODAN可以说是一个很可怕的引擎,从上面这些就可以看到大量的全球范围内的设备信息,通过指定查询一些城市国家名、系统的版本信息、域名、开放端口等等信息,如果牵扯到没有设防的,就是很不安全的行为。

Google Hacking

如何高效使用搜索引擎来进行信息收集,这个就是一门大学问了。Google Hacking也是一个非常有效的手段,当然Bing也可以,百度也不是不行。 原理很简单,Google的机器人每天都会爬取大量的网页信息,通过搜素这些信息,就有可能能获取到一些很有用的(比如社工方面)信息。下面几个例子。  

指定标题或包含信息

通过指定intitle或者intext参数(对应HTML中的title标签),可以搜索相应的信息,前者为标题,后者为网页内的信息:

格式:intitle:xxx或intext:xxxx 

比如搜索在北京做电子商务的法人的电话信息:北京 intitle:电子商务 intext:法人 intext:电话

指定网站或URL中存在指定的信息

  • 使用site参数:

如搜索阿里巴巴的联系方式:site:alibaba.com inurl:contact

  • 也可以进行指定国家的查询:

xxxx site:cn(中国的xxxx信息)

一些实例

思科交换机

cisco的交换机中存在着一个用户的管理界面,目录为'/level/15/exec/~show',可以搜索这个信息:

进去看一眼(滑稽) 没太了解cisco的设备,不过这里是可以执行指令的,自己输入或者点击下面的指令都可以。 

施耐德NetBotz机房用监视器

这是一个用于机房监控的网络摄像头,通过这个可以看到实时的机房图像。  使用搜索intitle:"netbotz appliance" "ok"

可以看到最上面的那个就是了。进去看一下(滑稽): 可以看到很多的如温度、湿度等的信息(这是。。卧室???)  

寻找后台的登陆网站

找这个的目的就不用说了。使用语句inurl:/admin/login.php,当然自己也可以加一些其他的比如国家之类的参数。

QQ账号和密码

在一些搞黑产的遗留现场可能会有一些账号和密码的信息,使用语句inurl:qq.txt。如图:

ftp之类的登陆页面

可以查:inurl:ftp "password" site:xxxx  

frontpage漏洞

这里会暴露这个网站的后台登录密码:inurl:Service.pwd

还是很多的:

甚至能找到它的根目录。。。注意管好自己别乱看!!

漏洞资源

exploit-db即可。  

其他搜索引擎

比如世界第四大搜索引擎YANDEX

kali工具

theharvest

说明文档:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
sage: theharvester options 

-d: Domain to search or company name
-b: data source: baidu, bing, bingapi, censys, crtsh, dogpile,
google, google-certificates, googleCSE, googleplus, google-profiles,
hunter, linkedin, netcraft, pgp, threatcrowd,
twitter, vhost, virustotal, yahoo, all
-g: use Google dorking instead of normal Google search
-s: start in result number X (default: 0)
-v: verify host name via DNS resolution and search for virtual hosts
-f: save the results into an HTML and XML file (both)
-n: perform a DNS reverse query on all ranges discovered
-c: perform a DNS brute force for the domain name
-t: perform a DNS TLD expansion discovery
-e: use this DNS server
-p: port scan the detected hosts and check for Takeovers (80,443,22,21,8080)
-l: limit the number of results to work with(Bing goes from 50 to 50 results,
Google 100 to 100, and PGP doesn't use this option)
-h: use SHODAN database to query discovered hosts

Examples:
theharvester -d microsoft.com -l 500 -b google -f myresults.html
theharvester -d microsoft.com -b pgp, virustotal
theharvester -d microsoft -l 200 -b linkedin
theharvester -d microsoft.com -l 200 -g -b google
theharvester -d apple.com -b googleCSE -l 500 -s 300
theharvester -d cornell.edu -l 100 -b bing -h

这是一个可以多个搜索引擎来进行综合搜索的工具(注意使用google等引擎需要翻,可以使用tor网络+proxychains代理实现转发),如果搜索量过大可能会被搜索引擎屏蔽。

如:使用google引擎来搜索microsoft.com这个域的信息:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
root@kali:~# theharvester -d microsoft.com -b bing -l 500

Warning: Pycurl is not compiled against Openssl. Wfuzz might not work correctly when fuzzing SSL sites. Check Wfuzz's documentation for more information.


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


found supported engines
[-] Starting harvesting process for domain: microsoft.com

[-] Searching in Bing:
Searching 50 results...
Searching 100 results...
Searching 150 results...
Searching 200 results...
Searching 250 results...
Searching 300 results...
Searching 350 results...
Searching 400 results...
Searching 450 results...
Searching 500 results...

Harvesting results
No IP addresses found


[+] Emails found:
------------------
tomas@contosso.onmicrosoft.com

[+] Hosts found in search engines:
------------------------------------

Total hosts: 93

[-] Resolving hostnames IPs...

about.ads.microsoft.com:40.112.143.134
academy.microsoft.com:13.92.127.190
account.microsoft.com:23.2.37.211
admin-mva.microsoft.com:157.56.30.150
admin.manage.microsoft.com:13.75.125.10
advertise.bingads.microsoft.com:40.112.143.134
aischool.microsoft.com:40.74.240.201
answers.microsoft.com:23.2.2.76
appsource.microsoft.com:104.215.148.113
azure.microsoft.com:13.107.42.16
bingads.microsoft.com:23.100.75.192
blogs.microsoft.com:192.237.225.141
blogs.msdn.microsoft.com:23.201.180.95
blogs.technet.microsoft.com:184.26.242.47
business.microsoft.com:23.99.110.192
businessaccount.microsoft.com:23.220.189.174
businesscenter.mbs.microsoft.com:137.135.13.53
careers.microsoft.com:52.224.109.124
catalog.update.microsoft.com:65.55.138.184
channelincentives.microsoft.com:157.58.215.120
cloudblogs.microsoft.com:45.64.65.97
clt.partners.extranet.microsoft.com:65.54.13.64
cmt.research.microsoft.com:40.112.211.35
code.msdn.microsoft.com:23.2.141.39

.......

结果显示了相关的邮件、域名信息以及其对应的IP地址。可以结合多个工具进行综合搜索。   ## metagoofil

首先这个工具是没有集成在kali中的,需要apt下载。说明文档:

1
2
3
4
5
6
7
8
9
10
11
12
13
Usage: metagoofil options

-d: domain to search
-t: filetype to download (pdf,doc,xls,ppt,odp,ods,docx,xlsx,pptx) //可以下文件
-l: limit of results to search (default 200)
-h: work with documents in directory (use "yes" for local analysis)
-n: limit of files to download
-o: working directory (location to save downloaded files)
-f: output file

Examples:
metagoofil.py -d apple.com -t doc,pdf -l 200 -n 50 -o applefiles -f results.html
metagoofil.py -h yes -o applefiles -f results.html (local dir analysis)
这个比刚才的有一个优点就是他可以搜索到与你要的相关的文件,并下载下来,对于社工是个很有用的手段。

比如我搜索并下载关于adobe.com的信息,存到test的目录下:metagoofil -d adobe.com -l 800 -t pdf -o test -f 1.html

但是实测没有什么结果,然而直接google搜还是有不少的hhh  

CATALOG
  1. 1. SHODAN
  2. 2. Google Hacking
    1. 2.1. 指定标题或包含信息
    2. 2.2. 指定网站或URL中存在指定的信息
    3. 2.3. 一些实例
      1. 2.3.1. 思科交换机
      2. 2.3.2. 施耐德NetBotz机房用监视器
      3. 2.3.3. 寻找后台的登陆网站
      4. 2.3.4. QQ账号和密码
      5. 2.3.5. ftp之类的登陆页面
      6. 2.3.6. frontpage漏洞
  3. 3. 漏洞资源
  4. 4. 其他搜索引擎
  5. 5. kali工具
    1. 5.1. theharvest