From 5cff86cc1e7cc36d6e13dcbd616b7592dbbb84ca Mon Sep 17 00:00:00 2001 From: HD Moore Date: Tue, 6 Jul 2010 15:43:22 +0000 Subject: [PATCH] Use the module-defined workspace if specified git-svn-id: file:///home/svn/framework3/trunk@9676 4d416f70-5f16-0410-b530-b9f4589650da --- lib/msf/core/exploit/http.rb | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/lib/msf/core/exploit/http.rb b/lib/msf/core/exploit/http.rb index 208b8dc3d5..266b091875 100644 --- a/lib/msf/core/exploit/http.rb +++ b/lib/msf/core/exploit/http.rb @@ -234,8 +234,8 @@ module Exploit::Remote::HttpClient # NTLM auth is bound to this particular TCP session. # # TODO: Fix up error messaging a lot more -- right now it's pretty hard - # to tell what all went wrong. - # + # to tell what all went wrong. + # def send_http_auth_ntlm(opts={}, timeout = 20) ntlm_message_1 = "NTLM TlRMTVNTUAABAAAAB4IIAAAAAAAAAAAAAAAAAAAAAAA=" to = opts[:timeout] || timeout @@ -246,7 +246,7 @@ module Exploit::Remote::HttpClient r = c.request_cgi(opts.merge({ 'uri' => opts['uri'], 'method' => 'GET', - 'headers' => { 'Authorization' => ntlm_message_1 }})) + 'headers' => { 'Authorization' => ntlm_message_1 }})) resp = c.send_recv(r, to) unless resp.kind_of? Rex::Proto::Http::Response return [nil,nil] @@ -354,7 +354,13 @@ module Exploit::Remote::HttpClient # Check to see if we already have a fingerprint before going out to # the network. if (framework.db.active) - s = framework.db.get_service(framework.db.workspace, rhost, 'tcp', rport) + + wspace = framework.db.workspace + if datastore['WORKSPACE'] + wspace = framework.db.find_workspace(datastore['WORKSPACE']) + end + + s = framework.db.get_service(wspace, rhost, 'tcp', rport) if (s) return s.info end