@@ -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
|
||||
|
||||
Reference in New Issue
Block a user