From 204a215bc70044f36e8e30843383d6d81d3a2758 Mon Sep 17 00:00:00 2001 From: Matt Miller Date: Sun, 30 Oct 2005 22:45:29 +0000 Subject: [PATCH] corrected some stuff git-svn-id: file:///home/svn/incoming/trunk@2982 4d416f70-5f16-0410-b530-b9f4589650da --- lib/msf/core/recon.rb | 1 + lib/msf/core/recon/discoverer/host.rb | 6 +++--- modules/recon/host/port_scanner/tcp_conn_sweep.rb | 7 ++++--- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/msf/core/recon.rb b/lib/msf/core/recon.rb index 765dbe7c9e..84ca01fe7b 100644 --- a/lib/msf/core/recon.rb +++ b/lib/msf/core/recon.rb @@ -257,6 +257,7 @@ class Recon < Msf::Module require 'msf/core/recon/discoverer' require 'msf/core/recon/entity' + require 'msf/core/recon/event_context' # # Returns MODULE_RECON to indicate that this is a recon module. diff --git a/lib/msf/core/recon/discoverer/host.rb b/lib/msf/core/recon/discoverer/host.rb index 8d09ac5f53..578660f38c 100644 --- a/lib/msf/core/recon/discoverer/host.rb +++ b/lib/msf/core/recon/discoverer/host.rb @@ -165,14 +165,14 @@ protected # If a hash was returned, we should create an event context to # pass to the notification. - if (state.kind_of?(Hash)) + if (istate.kind_of?(Hash)) context = Msf::Recon::EventContext.new # Serialize the context from the hash context.from_hash(state) # Grab the real state from the hash - state = istate['State'] + state = istate['state'] end # Report the host's state to the recon manager. @@ -181,7 +181,7 @@ protected # Perform cleanup as necessary (only if istate was a Hash) if (context) - probe_host_cleanup(ip, state) + probe_host_cleanup(ip, istate) end end diff --git a/modules/recon/host/port_scanner/tcp_conn_sweep.rb b/modules/recon/host/port_scanner/tcp_conn_sweep.rb index 57e6abdbc3..6e6074ebe6 100644 --- a/modules/recon/host/port_scanner/tcp_conn_sweep.rb +++ b/modules/recon/host/port_scanner/tcp_conn_sweep.rb @@ -41,10 +41,11 @@ class Recon::Host::PortScanner::TcpConnSweep < Msf::Recon::Discoverer::Host 'PeerPort' => datastore['RPORT'].to_i, 'LocalHost' => datastore['CHOST'] || '0.0.0.0', 'LocalPort' => datastore['CPORT'] ? datastore['CPORT'].to_i : 0)) - [ + + { 'state' => HostState::Alive, 'connection' => sock - ] + } end # If we get connection refused, then we are indirectly determining that # the host is alive. @@ -61,7 +62,7 @@ class Recon::Host::PortScanner::TcpConnSweep < Msf::Recon::Discoverer::Host # Cleans up # def probe_host_cleanup(ip, state) - state['Connection'].close + state['connection'].close end end