From d5606c9bf467159f3f46614e403e7aaf3a0587a6 Mon Sep 17 00:00:00 2001 From: antisnatchor Date: Mon, 23 Jul 2012 18:31:54 +0100 Subject: [PATCH] NAT pinning. now uses the new bind/unbind socket methods of the AssetHandler. No need to use netcat anymore ;) --- modules/network/nat_pinning_irc/module.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/network/nat_pinning_irc/module.rb b/modules/network/nat_pinning_irc/module.rb index 05d005189..4a411204a 100644 --- a/modules/network/nat_pinning_irc/module.rb +++ b/modules/network/nat_pinning_irc/module.rb @@ -15,10 +15,9 @@ # class Irc_nat_pinning < BeEF::Core::Command - #todo antisnatchor: reverted for now - #def pre_send - # BeEF::Core::NetworkStack::Handlers::AssetHandler.instance.bind_socket("IRC", "0.0.0.0", 6667) - #end + def pre_send + BeEF::Core::NetworkStack::Handlers::AssetHandler.instance.bind_socket("IRC", "0.0.0.0", 6667) + end def self.options return [ @@ -32,8 +31,9 @@ class Irc_nat_pinning < BeEF::Core::Command return if @datastore['result'].nil? save({'result' => @datastore['result']}) - #todo antisnatchor: how long should we leave it open? Maybe default timeout of 30 seconds? - #BeEF::Core::NetworkStack::Handlers::AssetHandler.instance.unbind_socket("IRC") + # wait 30 seconds before unbinding the socket. The HTTP connection will arrive sooner than that anyway. + sleep 30 + BeEF::Core::NetworkStack::Handlers::AssetHandler.instance.unbind_socket("IRC") end