Revert "fixing issue #1852"

This reverts commit 375c0d9b8b.
This commit is contained in:
Haoxi Tan
2020-01-16 11:24:11 +10:00
parent 375c0d9b8b
commit 7d9a235bbf
3 changed files with 11 additions and 28 deletions

View File

@@ -13,7 +13,6 @@ module BeEF
config = BeEF::Core::Configuration.instance
@nh = BeEF::Core::Models::NetworkHost
@ns = BeEF::Core::Models::NetworkService
@hb = BeEF::Core::Models::HookedBrowser
# Require a valid API token from a valid IP address
halt 401 unless params[:token] == config.get('beef.api_token')
@@ -70,9 +69,7 @@ module BeEF
begin
id = params[:id]
hooked_browser = @hb.where(session: id).distinct
hosts = @nh.where(hooked_browser: hooked_browser).distinct.order(:hooked_browser)
hosts = @nh.where(hooked_browser_id: id).distinct.order(:id)
count = hosts.length
result = {}
@@ -124,7 +121,7 @@ module BeEF
host = @nh.find(id)
raise InvalidParamError, 'id' if host.nil?
halt 404 if host == nil?
halt 404 if host.empty?
host.to_h.to_json
rescue InvalidParamError => e