diff --git a/lib/msf/core/handler/reverse_tcp.rb b/lib/msf/core/handler/reverse_tcp.rb index 7fc186cf53..f5500e32e7 100644 --- a/lib/msf/core/handler/reverse_tcp.rb +++ b/lib/msf/core/handler/reverse_tcp.rb @@ -59,7 +59,7 @@ module ReverseTcp # Switch to IPv6 ANY address if the LHOST is also IPv6 addr = Rex::Socket.resolv_nbo(datastore['LHOST']) - lsnr = Rex::Socket.addr_ntoa(addr) + lsnr = (addr.length == 4) ? "0.0.0.0" : "::0" self.listener_sock = Rex::Socket::TcpServer.create( 'LocalHost' => lsnr,