信息收集(Information Gathering),信息收集是指通过各种方式获取所需要的信息,在整个渗透测试环节中,信息搜集是整个渗透过程中最为重要的一环,信息搜集可占据整个渗透测试80%左右的工作量,同样的如果尽可能搜集更多的信息,对于后期的渗透工作是非常有帮助的,本章将针对Web网站进行信息的搜集工作,以作为学习笔记收录。

常规信息搜集

Whois查询: 使用该命令来查询域名的注册信息,在Kali系统中默认安装了该命令。

root@kali:~# whois baidu.com

   Domain Name: BAIDU.COM
Registry Domain ID: 11181110_DOMAIN_COM-VRSN
Registrar WHOIS Server: whois.markmonitor.com
Registrar URL: http://www.markmonitor.com
Updated Date: 2019-05-09T04:30:46Z
Creation Date: 1999-10-11T11:05:17Z
Registry Expiry Date: 2026-10-11T11:05:17Z
Registrar: MarkMonitor Inc.
Registrar IANA ID: 292
Registrar Abuse Contact Email: abusecomplaints@markmonitor.com
Registrar Abuse Contact Phone: +1.2083895740
Domain Status: clientDeleteProhibited https://icann.org/epp#clientDeleteProhibited
Domain Status: clientTransferProhibited https://icann.org/epp#clientTransferProhibited
Domain Status: clientUpdateProhibited https://icann.org/epp#clientUpdateProhibited
Domain Status: serverDeleteProhibited https://icann.org/epp#serverDeleteProhibited
Domain Status: serverTransferProhibited https://icann.org/epp#serverTransferProhibited
Domain Status: serverUpdateProhibited https://icann.org/epp#serverUpdateProhibited

nslookup的使用: 使用 set type 可指定查询记录的类型,通常类型有(A,NS,MX)。

root@kali:~# nslookup
> set type=MX
> baidu.com Server: 192.168.1.1
Address: 192.168.1.1#53 Non-authoritative answer:
baidu.com mail exchanger = 20 mx50.baidu.com.
baidu.com mail exchanger = 20 mx1.baidu.com.
baidu.com mail exchanger = 20 jpmx.baidu.com.
baidu.com mail exchanger = 10 mx.maillb.baidu.com.
baidu.com mail exchanger = 15 mx.n.shifen.com.

dig权威解答: 使用nslook查询的结果为非权威解答,如果需要权威解答可使用该命令。

root@kali:~# dig baidu.com

; <<>> DiG 9.11.5-P1-1-Debian <<>> baidu.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 6638
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 1 ;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;baidu.com. IN A ;; ANSWER SECTION:
baidu.com. 480 IN A 220.181.38.148
baidu.com. 480 IN A 39.156.69.79 ;; Query time: 5 msec
;; SERVER: 192.168.1.1#53(192.168.1.1)
;; WHEN: 六 8月 24 08:04:48 CST 2019
;; MSG SIZE rcvd: 70

通过网页收集数据: 如下几个网页均可完成查询任务,国内推荐ip138.com

https://site.ip138.com/
http://dns.bugscaner.com/
https://www.ipaddress.com
https://www.ip-adress.com/ip-address
https://tools.ipip.net/ipdomain.php
http://ip.tool.chinaz.com
http://www.yunsee.cn

子域名挖掘: 挖掘存在的子域名,这样的挖掘机百度搜索,很多。

http://z.zcjun.com/
http://sbd.ximcx.cn/
http://tool.chinaz.com/subdomain

网站证书查询: 查询网站所颁发的证书.

https://crt.sh/
https://transparencyreport.google.com/https/certificates
https://censys.io/
https://asn.cymru.com/cgi-bin/whois.cgi

ASN号码查询: 用于查找域的网络块 https://bgp.he.net/ 查询后记下编号,然后Nmap扫描。

root@kali:~# nmap --script targets-asn --script-args targets-asn.asn=23724
Starting Nmap 7.70 ( https://nmap.org ) at 2019-08-24 09:06 CST
Pre-scan script results:
| targets-asn:
| 23724
| 1.119.0.0/17
| 1.203.112.0/23
| 1.203.115.0/24

在线指纹识别: 除了网页在线识别外,也可以使用工具,比如御剑指纹。

https://www.whatweb.net/
http://whatweb.bugscaner.com/look/
http://www.yunsee.cn/

WAF识别: GitHub下载地址:https://github.com/EnableSecurity/wafw00f

root@kali:~# wafw00f www.baidu.com

                                 ^     ^
_ __ _ ____ _ __ _ _ ____
///7/ /.' \ / __////7/ /,' \ ,' \ / __/
| V V // o // _/ | V V // 0 // 0 // _/
|_n_,'/_n_//_/ |_n_,' \_,' \_,'/_/
<
...' WAFW00F - Web Application Firewall Detection Tool By Sandro Gauci && Wendel G. Henrique Checking http://www.baidu.com
The site http://www.baidu.com is behind a ModSecurity (OWASP CRS)
Number of requests: 12

dnsrecon 查询: --domain 指定查询域名,--dictionary 指定爆破的字典文件。

root@kali:~# dnsrecon --domain baidu.com --dictionary /root/list.log
[*] Performing General Enumeration of Domain: baidu.com
[!] Wildcard resolution is enabled on this domain
[!] It is resolving to 123.129.254.12
[!] All queries will resolve to this address!!
[-] DNSSEC is not configured for baidu.com
[*] SOA dns.baidu.com 202.108.22.220
[*] NS ns7.baidu.com 180.76.76.92
[*] Bind Version for 180.76.76.92 baidu dns
[*] NS ns4.baidu.com 14.215.178.80
[*] Bind Version for 14.215.178.80 baidu dns
[*] NS dns.baidu.com 202.108.22.220
[*] Bind Version for 202.108.22.220 baidu dns
[*] NS ns2.baidu.com 220.181.33.31

lbd检测负载均衡: 检测指定网站后台,是否开启了负载均衡。

root@kali:~# lbd baidu.com 443 https

Checking for DNS-Loadbalancing: FOUND
baidu.com has address 220.181.38.148
baidu.com has address 39.156.69.79 Checking for HTTP-Loadbalancing [Server]:
bfe/1.0.8.18 Checking for HTTP-Loadbalancing [Diff]: NOT FOUND
baidu.com does Load-balancing. Found via Methods: DNS

host主机查询:

root@kali:~# host baidu.com 8.8.8.8
Using domain server:
Name: 8.8.8.8
Address: 8.8.8.8#53
Aliases: baidu.com has address 220.181.38.148
baidu.com has address 39.156.69.79
baidu.com mail is handled by 10 mx.maillb.baidu.com.
baidu.com mail is handled by 15 mx.n.shifen.com.
baidu.com mail is handled by 20 mx1.baidu.com.
baidu.com mail is handled by 20 jpmx.baidu.com.
baidu.com mail is handled by 20 mx50.baidu.com.

搜索引擎查找: 如下命令查找公司是lyshark的数据查询前500条,并使用bing.com引擎查询。

root@kali:~# theharvester -d lyshark -l 500 -b bing

*******************************************************************
* *
* | |_| |__ ___ /\ /\__ _ _ ____ _____ ___| |_ ___ _ __ *
* | __| '_ \ / _ \ / /_/ / _` | '__\ \ / / _ \/ __| __/ _ \ '__| *
* | |_| | | | __/ / __ / (_| | | \ 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: lyshark [-] Searching in Bing:
Searching 50 results...
Searching 100 results...

TraceRoute: 测试网络命令 linux上是traceroute win10上是tracert

root@kali:~# traceroute -4 www.baidu.com
traceroute to www.baidu.com (61.135.169.125), 30 hops max, 60 byte packets
1 _gateway (192.168.1.1) 0.300 ms 0.193 ms 0.199 ms
2 27.200.48.1 (27.200.48.1) 32.113 ms 32.490 ms 32.401 ms
3 * * * ---------------------------------------------------------------------------------------------
C:\Users\LyShark>tracert www.baidu.com
通过最多 30 个跃点跟踪
到 www.a.shifen.com [61.135.169.121] 的路由: 1 <1 毫秒 <1 毫秒 <1 毫秒 192.168.1.1
2 22 ms 61 ms 46 ms

DirMap页面爬取:

root@kali:~# git clone https://github.com/H4ckForJob/dirmap.git
root@kali:~# cd dirmap
root@kali:~# python3 -m pip install -r requirement.txt root@kali:~/dirmap# python3 dirmap.py -i http://baidu.com -lcf ##### # ##### # # ## #####
# # # # # ## ## # # # #
# # # # # # ## # # # # #
# # # ##### # # ###### #####
# # # # # # # # # #
##### # # # # # # # # v1.0 [*] Initialize targets...
[+] Load targets from: http://baidu.com
[+] Set the number of thread: 30

Nikto漏洞扫描: 使用Ping命令获取IP地址,然后运行nikto扫描网站存在的漏洞。

root@kali:~# ping baidu.com
PING baidu.com (220.181.38.148) 56(84) bytes of data.
64 bytes from 220.181.38.148 (220.181.38.148): icmp_seq=1 ttl=49 time=37.5 ms root@kali:~# nikto -h 220.181.38.148 -p 443
- Nikto v2.1.6
---------------------------------------------------------------------------
+ Target IP: 220.181.38.148
+ Target Hostname: 220.181.38.148
+ Target Port: 443
+ Server: bfe/1.0.8.18
+ IP address found in the 'server' header. The IP is "1.0.8.18".
---------------------------------------------------------------------------

常用网站:

http://www.gpsspg.com/phone/   手机号信息查询
http://www.gpsspg.com/ip/ IP地址定位经纬度
https://www.receivesmsonline.net/ 国外免费短信接收平台
https://www.pdflibr.com/ 免费国外手机短信接收

Google Hacking

Google是世界上最强大的搜索引擎,Google的爬虫会爬取各种网页的链接并记录到数据库中,而Google Hacking技术就是利用谷歌搜索引擎,在互联网中有针对性的搜索一些敏感内容,比如网站被入侵后遗留下来的后门,又或者是隐藏的后台登陆入口,高级点的就是源代码泄露,未授权访问等,接下来将简单介绍Google Hacking引擎的语法规则。

常用的搜索关键字:

intitle: 搜索网页标题中包含有特定字符的网页

inurl: 搜索包含有特定字符的URL链接

intext: 搜索网页正文内容中的指定字符的页面

filetype: 搜索指定类型的文件

site: 找到与指定网站有联系的URL

allintitle: 在标题中一次搜索所有的关键字

link: 允许在页面上进行外部链接搜索

numrange: 限制了范围内的搜索

daterange: 限制了日期的搜索

author: 找到群组的作者

group: 搜索群组的名称

related: 搜索相关的关键字

搜寻语法:

intext: login                              返回带有login的页面
inurl:Login admin 将返回url中含有 Login 和 admin 的网页
site:baidu.com inurl:Login 只在baidu.com 中查找url中含有 Login的网页
site:baidu.com filetype:doc 只返回baidu.com站点上文件类型为doc的网页
link:www.baidu.com 返回所有包含指向 www.baidu.com 的网页
related:www.baidu.com 返回与 www.baidu.com 布局相似的页面
cache:www.baidu.com lyshark 返回指定网站缓存,且正文中含有lyshark的页面
info:www.baidu.com 将返回百度的一些信息
define:Hacker 将返回关于Hacker的定义 配置文件泄露:site:lyshark.com ext:xml | ext:conf | ext:inf | ext:cfg | ext:txt | extra | ext:ini
目录遍历语法: site:lyshark.com intitle:index.of
数据库文件泄露:site:lyshark.com ext:sql | ext:dbf | ext:mdb

Shodan Hacking

Shodan 是一个搜索引擎,被誉为最可怕的互联网搜索引擎,与 Google 搜索引擎不同,Shodan 是用来搜索网络空间中在线设备的,它可以搜索到任意的活跃设备。

shodan 命令:

asn 区域自治编号

port 端口

org ip所属组织机构

os 操作系统类型

http.html 网页内容

html.title 网页标题

city 市

country 国家

product 所使用的软件或产品

vuln CVE漏洞编号,vuln:CVE-2014-0723

net 搜索一个网段,123.23.1.0/24

一些组合用法:

搜索日本区开放8080端口的设备
country:jp port:"8080"
country:jp port:"8080" product:"Apache httpd" city:"Tokyo" os:"Windows" 搜索美国区域内使用Linux 2.6.x系统的设备
country:us os:"Linux 2.6.x"
country:us os:"Linux 2.6.x" port:"443" 搜索中国区域内使用Windows Server系统的设备
country:cn os:"Windows Server 2008 R2"
country:cn os:"Windows Server 2008 R2" port:"445"

针对Web的信息搜集的更多相关文章

  1. web安全入门课程笔记——网站基础与信息搜集

    2-1 网站的基本概念 URL统一资源定位符 这是一个动态页面 ?ID 查询条件 后台数据库最有可能:ACCESS Web容器(web容器是一种服务程序,在服务器一个端口就有一个提供相应服务的程序,而 ...

  2. 2017-2018 Exp6 信息搜集与漏洞扫描 20155214

    目录 Exp6 信息搜集与漏洞扫描 实验内容 信息收集 漏洞扫描 知识点 Exp6 信息搜集与漏洞扫描 收集渗透目标的情报是最重要的阶段.如果收集到有用的情报资料的话,可以大大提高对渗透测试的成功性. ...

  3. 2017-2018-2 《网络对抗技术》20155322 Exp6 信息搜集与漏洞扫描

    [-= 博客目录 =-] 1-实践目标 1.1-实践介绍 1.2-实践内容 1.3-实践要求 2-实践过程 2.1-Google hacking & ZoomEye 2.2-DNS.IP信息收 ...

  4. 关于web软件信息安全问题防护资料的整理 (一)

    之前意识到了安全问题的重要性,于是就在网上找了一下安全问题的解决办法(主要是web应用以及政府网站方面的),问了一下同学的公司是怎么保证安全的,跟我说用的是shiro安全机制这个貌似好多公司都在用,网 ...

  5. 开源 java CMS - FreeCMS2.3 Web页面信息採集

    原文地址:http://javaz.cn/site/javaz/site_study/info/2015/23312.html 项目地址:http://www.freeteam.cn/ Web页面信息 ...

  6. 2018-2019-2 20165325 《网络对抗技术》 Exp6 信息搜集与漏洞扫描

    2018-2019-2 20165325 <网络对抗技术> Exp6 信息搜集与漏洞扫描 实验内容(概要) 1 各种搜索技巧的应用: 2 DNS IP注册信息的查询: 3 基本的扫描技术 ...

  7. 2018-2019-2 网络对抗技术 20162329 Exp6 信息搜集与漏洞扫描

    目录 Exp6 信息搜集与漏洞扫描 一.实践原理 1. 间接收集 2. 直接收集 3. 社会工程学 二.间接收集 1. Zoomeye 2. FOFA 3. GHDB 4. whois 5. dig ...

  8. Exp6 信息搜集与漏洞扫描 20165110

    Exp6 信息搜集与漏洞扫描 20165110 一.实践目标 掌握信息搜集的最基础技能与常用工具的使用方法. 二.实践内容 (1)各种搜索技巧的应用 (2)DNS IP注册信息的查询 (3)基本的扫描 ...

  9. 2018-2019-2 网络对抗技术 20165311 Exp6 信息搜集与漏洞扫描

    20165311 Exp6 信息搜集与漏洞扫描 1.实验内容 2.实验过程 任务一:各种搜索技巧的应用 通过搜索引擎进行信息搜集 使用FOFA.SO 搜索特定类型的文件 任务二:DNS IP注册信息的 ...

随机推荐

  1. redis详解之cluster模式部署

    一.环境说明 1.Operation OS:CentOS7.22.ruby version >= 2.2.23.openssl zlib gcc>=4.8.5 二.开始部署 1.安装rub ...

  2. idea 2018注册码(激活码)

    最近做一个项目,用idea 社区版的   但是缺少了好多功能 无奈只能用专业版的,但是需要注册激活  下面是我的注册方法 1.打开了idea  会提示让激活  选择Licensse server 2. ...

  3. Sketch教程

    去年夏天开始用Sketch,觉得它放Dock里闪亮亮的很好看,当时笑称是男盆友送我的第一颗小钻石噗哈哈.所以那段时间几乎刷遍了所有关于 Sketch 的网站.文章.教程,之后又在自学设计,因为想和更多 ...

  4. Python 函数lambda(), filter(), map(), reduce()

    1 filter filter(function, sequence):对sequence中的item依次执行function(item),将执行结果为True的item组成一个List/String ...

  5. 分享图片压缩上传demo,可以选择一张或多张图片也可以拍摄照片

    2016-08-05更新: 下方的代码是比较OLD的了,是通过js进行图片的剪切 旋转 再生成,效率较低. 后来又整合了一个利用native.js本地接口的压缩代码 ,链接在这 .页面中有详细的说明, ...

  6. 响应式css样式

    <div class="a"> 123 </div> @media(orientation:portrait) and (max-width:600px){ ...

  7. 使 nodejs 代码 在后端运行(nohup)

    1.代码 nohup node server.js & 说明: nohup 命令对 server.js 进程做了三件事 (1)阻止SIGHUP信号发到这个进程. (2)关闭标准输入.该进程不再 ...

  8. SQL-W3School-高级:SQL BETWEEN 操作符

    ylbtech-SQL-W3School-高级:SQL BETWEEN 操作符 1.返回顶部 1. BETWEEN 操作符在 WHERE 子句中使用,作用是选取介于两个值之间的数据范围. BETWEE ...

  9. js for (i=0;i<a.length;a[i++]=0) 中等于0怎么理解?

    js的问题for (i=0;i<a.length;a[i++]=0) 中等于0怎么理解? 很奇怪的一个for循环 竟然是将原来数组的数据全改为0

  10. sklearn常见分类器(二分类模板)

    # -*- coding: utf-8 -*- import pandas as pd import matplotlib matplotlib.rcParams['font.sans-serif'] ...