Skip to content

Commit 5450e96

Browse files
committed
Land rapid7#8306, fix rapid7#8305, escape unadorned periods within SMTP payloads
2 parents 7c9d793 + 288cb65 commit 5450e96

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/msf/core/exploit/smtp_deliver.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,8 @@ def send_message(data)
194194
full_msg << date unless data =~ /date: /i
195195
full_msg << subject unless subject.nil? || data =~ /subject: /i
196196
full_msg << data
197+
# Escape leading dots in the mail messages so there are no false EOF
198+
full_msg.gsub!(/(?m)^\./, '..')
197199
send_status = raw_send_recv("#{full_msg}\r\n.\r\n", nsock)
198200
end
199201
else

0 commit comments

Comments
 (0)