add Date header support to SMTP deliver
the SMTP mixin now supports the Date header. The user can supply a a value for the Date Header or else it will automatically use the current local DateTime. This will help alleviate certain issues caused by servers setting this field for the cliebnt incorrectly MSP-9390bug/bundler_fix
parent
7876401419
commit
6dad66c04c
|
@ -26,6 +26,7 @@ module Exploit::Remote::SMTPDeliver
|
|||
[
|
||||
OptAddress.new("RHOST", [ true, "The SMTP server to send through" ]),
|
||||
OptPort.new("RPORT", [ true, "The SMTP server port (e.g. 25, 465, 587, 2525)", 25 ]),
|
||||
OptString.new('DATE', [false, 'Override the DATE: field with this value', '']),
|
||||
OptString.new('MAILFROM', [ true, 'The FROM address of the e-mail', 'random@example.com' ]),
|
||||
OptString.new('MAILTO', [ true, 'The TO address of the email' ]),
|
||||
OptString.new('SUBJECT', [ true, 'Subject line of the email' ]),
|
||||
|
@ -140,6 +141,14 @@ module Exploit::Remote::SMTPDeliver
|
|||
raw_send_recv("MAIL FROM: <#{datastore['MAILFROM']}>\r\n", nsock)
|
||||
raw_send_recv("RCPT TO: <#{datastore['MAILTO']}>\r\n", nsock)
|
||||
|
||||
# If the user supplied a Date field, use that, else use the current
|
||||
# DateTime in the propper RFC2822 format.
|
||||
if datastore['DATE'].present?
|
||||
raw_send_recv("Date: #{datastore['DATE']}\r\n", nsock)
|
||||
else
|
||||
raw_send_recv("Date: #{DateTime.now.rfc2822}\r\n", nsock)
|
||||
end
|
||||
|
||||
resp = raw_send_recv("DATA\r\n", nsock)
|
||||
|
||||
# Avoid sending tons of data and killing the connection if the server
|
||||
|
|
Loading…
Reference in New Issue