From f1e71237e4c0dfdfb85d227e6b892cb04b837949 Mon Sep 17 00:00:00 2001 From: James Lee Date: Fri, 21 Nov 2008 01:09:17 +0000 Subject: [PATCH] bind to LHOST instead of 0.0.0.0, fixes #262 git-svn-id: file:///home/svn/framework3/trunk@5969 4d416f70-5f16-0410-b530-b9f4589650da --- lib/msf/core/handler/reverse_tcp.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/msf/core/handler/reverse_tcp.rb b/lib/msf/core/handler/reverse_tcp.rb index 3de03a9c3e..7fc186cf53 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 = (addr.length == 4) ? "0.0.0.0" : "::0" + lsnr = Rex::Socket.addr_ntoa(addr) self.listener_sock = Rex::Socket::TcpServer.create( 'LocalHost' => lsnr, @@ -146,4 +146,4 @@ protected end end -end \ No newline at end of file +end