Fix comm selection
While testing https://github.com/rapid7/metasploit-framework/pull/17782 we discovered that the way we are passing comms values into the http server is inconsistent, and that results in new servers being created rather than having the existing server passed back. We should go though and have all the cases where we start http servers use the same logic. I can think of three places that use it off the top of my head: https://github.com/rapid7/metasploit-framework/blob/26daa65c580770a02fdee99e420bcf4bcf792e23/lib/msf/core/handler/reverse_http.rb#L218 lib/msf/core/payload/adapter/fetch/server/https.rb line 139 (not yet merged) https://github.com/rapid7/metasploit-framework/blob/master/lib/msf/core/exploit/remote/socket_server.rb
We should go through and standardize how we figure out the proper comms.
This was originally part of the fetch payloads PR, but removed because we wanted to do more testing and unified approach: https://github.com/rapid7/metasploit-framework/pull/17782/files#r1197151811
@adfoster-r7 @smcintyre-r7
Source: rapid7/metasploit-framework