diff --git a/modules/auxiliary/scanner/smtp/smtp_relay.rb b/modules/auxiliary/scanner/smtp/smtp_relay.rb index 287316508f13..141eca030c72 100644 --- a/modules/auxiliary/scanner/smtp/smtp_relay.rb +++ b/modules/auxiliary/scanner/smtp/smtp_relay.rb @@ -84,6 +84,11 @@ def do_test_relay(testnumber, mailfrom, mailto) res = raw_send_recv("EHLO X\r\n") vprint_status("#{res.inspect}") + # check if the EHLO is actually supported. In case it's not, try the HELO command instead + if res.to_s =~ /^5\d\d/ + res = raw_send_recv("HELO X\r\n") + vprint_status("#{res.inspect}") + end res = raw_send_recv("#{mailfrom}\r\n") vprint_status("#{res.inspect}")