metasploit-framework
metasploit-framework copied to clipboard
Infinite loop when waiting on a socket with no remote part
Added a quick fix for this issue over here https://github.com/rapid7/metasploit-framework/pull/19058/files#diff-ae5e58d5779ed8073ce678c33809b32c40547f3657ddaaa7ed25ddabe124f20cR48 as part of the ldap session work
Essentially the issue is that it's possible to create a socket without providing it the information for the remote part and later on when we do a select
to see if it's ready to write to here in rex-core https://github.com/rapid7/rex-core/blob/c823cd42554ef624e0ef6e86104215ca393a3391/lib/rex/io/stream.rb#L59 it is never ready
Not sure if a fix belongs in framework where we add in additional checks so we don't create the socket like this in the first place or in rex-core where it checks if it's even a valid socket to write too, maybe we should be doing both