Browse Source

Don't duplicate headers when sending emails

If Date: and Subject: are present, we should not try to add them again.
This made Amazon SES puke, and that made us sad :(.

MS-1476
Adam Cammack 3 years ago
parent
commit
f75009a9c6
No account linked to committer's email address
1 changed files with 2 additions and 2 deletions
  1. 2
    2
      lib/msf/core/exploit/smtp_deliver.rb

+ 2
- 2
lib/msf/core/exploit/smtp_deliver.rb View File

@@ -163,8 +163,8 @@ module Exploit::Remote::SMTPDeliver
163 163
       print_error("Server refused our mail")
164 164
     else
165 165
       full_msg = ''
166
-      full_msg << date
167
-      full_msg << subject unless subject.nil?
166
+      full_msg << date unless data =~ /date: /i
167
+      full_msg << subject unless subject.nil? || data =~ /subject: /i
168 168
       full_msg << data
169 169
       send_status = raw_send_recv("#{full_msg}\r\n.\r\n", nsock)
170 170
     end

Loading…
Cancel
Save