clear any additional response on smtp connect

When connecting to an SMTP server after `HELO` and auth
complete there can be additional data sent from the client
that sits in the socket queue. Adding a `get_once` after connection
has settled ensure any pending for extension responses are cleared.
This commit is contained in:
Jeffrey Martin 2022-02-07 14:07:46 -06:00
parent a554a98965
commit 5bc60f5bf7
No known key found for this signature in database
GPG Key ID: 0CD9BBC2AF15F171
1 changed files with 4 additions and 0 deletions

View File

@ -244,6 +244,10 @@ module Exploit::Remote::SMTPDeliver
begin
nsock.put(cmd)
res = nsock.get_once
# read until `nil` is returned
while chunk = nsock.get_once
res += chunk
end
rescue
return nil
end