Skip to content

Commit 288cb65

Browse files
author
Brent Cook
committed
fix rapid7#8305, escape unadorned periods in the front of SMTP payloads
1 parent 0ae6142 commit 288cb65

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)