corrected some stuff

git-svn-id: file:///home/svn/incoming/trunk@2982 4d416f70-5f16-0410-b530-b9f4589650da
unstable
Matt Miller 2005-10-30 22:45:29 +00:00
parent 2e7a7dbe8d
commit 204a215bc7
3 changed files with 8 additions and 6 deletions

View File

@ -257,6 +257,7 @@ class Recon < Msf::Module
require 'msf/core/recon/discoverer' require 'msf/core/recon/discoverer'
require 'msf/core/recon/entity' require 'msf/core/recon/entity'
require 'msf/core/recon/event_context'
# #
# Returns MODULE_RECON to indicate that this is a recon module. # Returns MODULE_RECON to indicate that this is a recon module.

View File

@ -165,14 +165,14 @@ protected
# If a hash was returned, we should create an event context to # If a hash was returned, we should create an event context to
# pass to the notification. # pass to the notification.
if (state.kind_of?(Hash)) if (istate.kind_of?(Hash))
context = Msf::Recon::EventContext.new context = Msf::Recon::EventContext.new
# Serialize the context from the hash # Serialize the context from the hash
context.from_hash(state) context.from_hash(state)
# Grab the real state from the hash # Grab the real state from the hash
state = istate['State'] state = istate['state']
end end
# Report the host's state to the recon manager. # Report the host's state to the recon manager.
@ -181,7 +181,7 @@ protected
# Perform cleanup as necessary (only if istate was a Hash) # Perform cleanup as necessary (only if istate was a Hash)
if (context) if (context)
probe_host_cleanup(ip, state) probe_host_cleanup(ip, istate)
end end
end end

View File

@ -41,10 +41,11 @@ class Recon::Host::PortScanner::TcpConnSweep < Msf::Recon::Discoverer::Host
'PeerPort' => datastore['RPORT'].to_i, 'PeerPort' => datastore['RPORT'].to_i,
'LocalHost' => datastore['CHOST'] || '0.0.0.0', 'LocalHost' => datastore['CHOST'] || '0.0.0.0',
'LocalPort' => datastore['CPORT'] ? datastore['CPORT'].to_i : 0)) 'LocalPort' => datastore['CPORT'] ? datastore['CPORT'].to_i : 0))
[
{
'state' => HostState::Alive, 'state' => HostState::Alive,
'connection' => sock 'connection' => sock
] }
end end
# If we get connection refused, then we are indirectly determining that # If we get connection refused, then we are indirectly determining that
# the host is alive. # the host is alive.
@ -61,7 +62,7 @@ class Recon::Host::PortScanner::TcpConnSweep < Msf::Recon::Discoverer::Host
# Cleans up # Cleans up
# #
def probe_host_cleanup(ip, state) def probe_host_cleanup(ip, state)
state['Connection'].close state['connection'].close
end end
end end