信息收集(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"

最新文章

  1. ajax无刷新删除、复制 THINKPHP
  2. Tuxedo 超时时间控制(转贴)
  3. LoadRunner脚本
  4. DSP using MATLAB 示例Example3.22
  5. tomcat access log 参数
  6. C#基础知识系列一(goto、i++、三元运算符、ref和out、String和string、重载运算符)
  7. C# 委托的”四步走“
  8. CSS之关于clearfix--清除浮动
  9. Android studio无法更新 提示网络连接失败
  10. AppSettings
  11. ACdream: Sum
  12. Linux上安装二进制文件MySQL详解
  13. Python全栈考试(一)
  14. vue 插值,v-once,v-text, v-html
  15. Jmeter笔记(Ⅱ)使用Jmeter实现轻量级的接口自动化测试
  16. Js 常用调试的方法
  17. 探讨npm依赖管理之peerDependencies
  18. vue 弹性布局 实现长图垂直居上,短图垂直居中
  19. CentOS7安装OpenStack(Rocky版)-07.安装horizon服务组件(控制节点dashboard)
  20. kettle的输入输出组件和脚本组件

热门文章

  1. vue pdf下载
  2. php-fpm脚本
  3. Qt内的各种路径(让人迷惑)
  4. ELK日志解决方案
  5. 在Ubuntu上安装Qt5.2.0
  6. oracle OPEN FOR [USING] 语句
  7. ARP Poisoning Attack and Mitigation Techniques ARP欺骗 中间人攻击 Man-In-The-Middle (MITM) attack 嗅探 防范 Can one MAC address have two different IP addresses within the network?
  8. Java同步数据结构之CopyOnWriteArrayList/CopyOnWriteArraySet
  9. ubuntu默认root密码问题,第一次使用ubuntu需要设置root密码
  10. python-数据库-优化