Kali Linux Web渗透测试手册(第二版) - 2.1 - 被动信息收集

第二章:侦察

介绍

2.1、被动信息收集

2.2、使用Recon-ng收集信息

2.3、使用Nmap扫描和标识服务

2.4、标识web应用程序防火墙

2.5、确定HTTPS加密参数

2.6、使用浏览器的开发工具分析和更改基本行为

2.7、获取和修改cookie

2.8、利用robots.txt

 

介绍

不管是针对网络还是web应用程序,渗透测试都有一套相同的流程。这一套流程可以增加我们发现漏洞的可能性,并且利用到尽可能多的漏洞来影响系统。例如:

  • 信息收集

  • 资产列举

  • 漏洞利用

  • 维持访问

  • 清理痕迹

 

在渗透测试中,信息收集是测试人员必须做的一件事情,信息收集需要收集存在于网络中的资产,如防火墙、IDS、IPS等。还要尽可能收集所有有关公司、网络、员工的信息。针对于web渗透测试,这一阶段主要讲如何收集web应用,数据库,用户和服务器的信息。

信息收集的质量取决于渗透测试的成功与否。我们得到的信息越多,测试的目标就越多。就有更多的选择去发现漏洞并利用。

 

2.1、被动信息收集

被动信息收集是指不影响目标系统的前提下获得信息,比如在搜索引擎,数据库缓存等这样的第三方机构收集。

在这节中,我们将从大量在线服务中获取信息,[这些公共来源的数据集合也被称为开源智能(OSINT)]。 被动信息收集可以在测试公共网站或应用中摸清我们目标的一个大概情况并发现对渗透测试人员有用的信息。

  

准备

为了在公共资源中获取信息,我们需要让kali虚拟机连接互联网,并配置成NAT网络地址转换模式。此步骤可以参考第一章中所介绍的方法,它会教你设置kali及靶机环境,并且设置NAT模式代替Host-only模式。

  

怎么做…

我们将用zonetransfer.me此域名作为我们的目标,zonetransfer.me是Robin Wood在digi.ninja网站创建的,它可以演示允许公共DNS区域传输的后果。

 

1.  我们首先使用whois获取它的注册信息:

 

2.  另外一个工具是dig,它可以获取域名信息和DNS解析信息。

# dig  ns  zonetransfer.me

 

3.  一旦我们获得了DNS服务器的信息,就可以尝试区域传输攻击来获取服务器解析的所有主机名。仍然使用dig:

# dig  axfr @nsztm1.digi.ninja zonetransfer.me

 

很幸运,dns服务器支持区域传输,我们获得了一个完整的子域列表以及解析情况。接着就可以选择一个脆弱的目标来完成渗透攻击了。

4.现在可以使用theharvester来获取目标网站的邮箱、主机名、IP地址信息。

# theharvester  -d  zonetransfer.me -b  all

 

5.如果想不直接查询服务器来获得网站使用的软件版本信息,可以使用Netcraft工具。登陆

https://toolbar.netcraft.com/site_report

输入想查询的域名即可:

6.获得一个网站以前的页面信息在测试中也很有用。可以在https://archive.org/web/web.php

这个网站回溯网站以前版本的静态副本。(打不开。。。)

如何工作…

在这节教程中,我们利用了大量不同工具来收集目标信息。在linux命令行中使用whois查询了网站的注册信息,还获得了网站dns服务器的信息和管理员的个人信息,比如管理员的邮箱、公司名、电话等等。Whois还可以查询ip地址的归属者信息。接着,我们使用了dig获取了目标dns服务器的信息,并使用区域传输获得了所有子域名(dig区域传输只适用于没有正确配置的dns服务器)

通过使用harvester,获得了有关于目标域的邮箱、主机名和ip地址,其中-b all选项指使用所有支持的查询,-d后面指定搜索的目标域

然后我们使用netcraft获得了目标网站使用的技术信息和更新以前的情况。这使我们能够在进一步测试中不再查询真实站点。

Wayback machine网站是一种存储网站静态副本并保存记录的服务器。在这里,可以看到旧版本中发布的信息,有时候对web应用的更新可能会泄露敏感数据。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
安全渗透测试 [Kali Linux Web Penetration Testing Cookbook 2nd - 2018.pdf](https://itbooks.pipipan.com/fs/18113597-314061726) Kali Linux Web Penetration Testing Cookbook 2nd Edition pdf Discover the most common web vulnerabilities and prevent them from becoming a threat to your site's security Key Features Familiarize yourself with the most common web vulnerabilities Conduct a preliminary assessment of attack surfaces and run exploits in your lab Explore new tools in the Kali Linux ecosystem for web penetration testing Book Description Web applications are a huge point of attack for malicious hackers and a critical area for security professionals and penetration testers to lock down and secure. Kali Linux is a Linux-based penetration testing platform that provides a broad array of testing tools, many of which can be used to execute web penetration testing. Kali Linux Web Penetration Testing Cookbook gives you the skills you need to cover every stage of a penetration test – from gathering information about the system and application, to identifying vulnerabilities through manual testing. You will also cover the use of vulnerability scanners and look at basic and advanced exploitation techniques that may lead to a full system compromise. You will start by setting up a testing laboratory, exploring the latest features of tools included in Kali Linux and performing a wide range of tasks with OWASP ZAP, Burp Suite and other web proxies and security testing tools. As you make your way through the book, you will learn how to use automated scanners to find security ?aws in web applications and understand how to bypass basic security controls. In the concluding chapters, you will look at what you have learned in the context of the Open Web Application Security Project (OWASP) and the top 10 web application vulnerabilities you are most likely to encounter, equipping you with the ability to combat them effectively. By the end of this book, you will have acquired the skills you need to identify, exploit, and prevent web application vulnerabilities. What you will learn Set up a secure penetration testing laboratory Use proxies, crawlers, and spiders to investigate an entire website Identify cross-site scripting and client-side vulnerabilities Exploit vulnerabilities that allow the insertion of code into web applications Exploit vulnerabilities that require complex setups Improve testing efficiency using automated vulnerability scanners Learn how to circumvent security controls put in place to prevent attacks Who this book is for Kali Linux Web Penetration Testing Cookbook is for IT professionals, web developers, security enthusiasts, and security professionals who want an accessible reference on how to find, exploit, and prevent security vulnerabilities in web applications. The basics of operating a Linux environment and prior exposure to security technologies and tools are necessary.

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值