diff --git a/extensions/proxy/proxy.rb b/extensions/proxy/proxy.rb index 0a632b57e..7fd95d357 100644 --- a/extensions/proxy/proxy.rb +++ b/extensions/proxy/proxy.rb @@ -137,10 +137,10 @@ module BeEF # Wait for the HTTP response to be stored in the db. # TODO: re-implement this with EventMachine or with the Observer pattern. - while H.first(:id => http.id).has_ran != "complete" + while H.find(http.id).has_ran != "complete" sleep 0.5 end - @response = H.first(:id => http.id) + @response = H.find(http.id) print_debug "[PROXY] <-- Response for request ##{@response.id} to [#{@response.path}] on domain [#{@response.domain}:#{@response.port}] correctly processed" response_body = @response['response_data'] @@ -191,7 +191,7 @@ module BeEF end def get_tunneling_proxy - proxy_browser = HB.first(:is_proxy => true) + proxy_browser = HB.where(:is_proxy => true).first unless proxy_browser.nil? return proxy_browser.session.to_s end diff --git a/extensions/proxy/rest/proxy.rb b/extensions/proxy/rest/proxy.rb index a8ce836df..82cf9be1a 100644 --- a/extensions/proxy/rest/proxy.rb +++ b/extensions/proxy/rest/proxy.rb @@ -35,8 +35,8 @@ module BeEF result['success'] = false return result.to_json if hb_id.nil? - hooked_browser = @hb.first(:session => hb_id) - previous_proxy_hb = @hb.first(:is_proxy => true) + hooked_browser = @hb.where(:session => hb_id).first + previous_proxy_hb = @hb.where(:is_proxy => true).first # if another HB is currently set as tunneling proxy, unset it unless previous_proxy_hb.nil?