Added /api/hooks/:session RESTful api call in order to retrieve the full BrowserDetails for the hooked browser.

This commit is contained in:
antisnatchor
2012-04-20 14:46:46 +01:00
parent 5a345abfab
commit f63240d3cb

View File

@@ -44,6 +44,19 @@ module BeEF
output.to_json
end
# @note Get all the hooked browser details (plugins enabled, technologies enabled, cookies)
get '/:session' do
hb = BeEF::Core::Models::HookedBrowser.first(:session => params[:session])
error 401 unless hb != nil
details = BeEF::Core::Models::BrowserDetails.all(:session_id => hb.session)
result = {}
details.each do |property|
result[property.detail_key] = property.detail_value
end
result.to_json
end
def hb_to_json(hbs)
hbs_hash = {}
i = 0