Skip to content

Commit 39c0065

Browse files
committed
Land rapid7#4758, SMTPDeliver DATA header fix
2 parents f0bf881 + 72878e0 commit 39c0065

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/msf/core/exploit/smtp_deliver.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,8 @@ def send_message(data)
141141
raw_send_recv("MAIL FROM: <#{datastore['MAILFROM']}>\r\n", nsock)
142142
raw_send_recv("RCPT TO: <#{datastore['MAILTO']}>\r\n", nsock)
143143

144+
resp = raw_send_recv("DATA\r\n", nsock)
145+
144146
# If the user supplied a Date field, use that, else use the current
145147
# DateTime in the proper RFC2822 format.
146148
if datastore['DATE'].present?
@@ -154,8 +156,6 @@ def send_message(data)
154156
raw_send_recv("Subject: #{datastore['SUBJECT']}\r\n", nsock)
155157
end
156158

157-
resp = raw_send_recv("DATA\r\n", nsock)
158-
159159
# Avoid sending tons of data and killing the connection if the server
160160
# didn't like us.
161161
if not resp or not resp[0,3] == '354'

0 commit comments

Comments
 (0)