From 2cb2b281d643517cd4f41d7a22fbf567f9fda4ca Mon Sep 17 00:00:00 2001 From: sinn3r Date: Thu, 6 Sep 2012 01:09:40 -0500 Subject: [PATCH] Fix NoMethodError for nil:NilClass bug The 'unless' statement expects there's always a value for USERNAME and PASSWORD. We might as well just set '' as the default value to avoid the NoMethodError mistake. Related to bug #7140. --- lib/msf/core/exploit/smtp_deliver.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/msf/core/exploit/smtp_deliver.rb b/lib/msf/core/exploit/smtp_deliver.rb index fb6dfb8c43..da2f2abe86 100644 --- a/lib/msf/core/exploit/smtp_deliver.rb +++ b/lib/msf/core/exploit/smtp_deliver.rb @@ -29,8 +29,8 @@ module Exploit::Remote::SMTPDeliver 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' ]), - OptString.new('USERNAME', [ false, 'SMTP Username for sending email' ]), - OptString.new('PASSWORD', [ false, 'SMTP Password for sending email' ]), + OptString.new('USERNAME', [ false, 'SMTP Username for sending email', '' ]), + OptString.new('PASSWORD', [ false, 'SMTP Password for sending email', '' ]), OptString.new('VERBOSE', [ false, 'Display verbose information' ]), ], Msf::Exploit::Remote::SMTPDeliver) register_autofilter_ports([ 25, 465, 587, 2525, 25025, 25000])