Adding separate restful api call for offline browsers only (phishing-frenzy integration)

This commit is contained in:
antisnatchor
2014-10-09 12:34:10 +02:00
parent 79947ab6eb
commit 18efaf7f52

View File

@@ -47,9 +47,8 @@ module BeEF
# @note this is basically the same call as /api/hooks, but returns different data structured in arrays rather than objects.
# Useful if you need to query the API via jQuery.dataTable < 1.10 which is currently used in PhishingFrenzy
#
get '/pf' do
get '/pf/online' do
online_hooks = hbs_to_array(BeEF::Core::Models::HookedBrowser.all(:lastseen.gte => (Time.new.to_i - 15)))
offline_hooks = hbs_to_array(BeEF::Core::Models::HookedBrowser.all(:lastseen.lt => (Time.new.to_i - 15)))
output = {
'aaData' => online_hooks
@@ -57,6 +56,19 @@ module BeEF
output.to_json
end
#
# @note this is basically the same call as /api/hooks, but returns different data structured in arrays rather than objects.
# Useful if you need to query the API via jQuery.dataTable < 1.10 which is currently used in PhishingFrenzy
#
get '/pf/offline' do
offline_hooks = hbs_to_array(BeEF::Core::Models::HookedBrowser.all(:lastseen.lt => (Time.new.to_i - 15)))
output = {
'aaData' => offline_hooks
}
output.to_json
end
#
# @note Get all the hooked browser details (plugins enabled, technologies enabled, cookies)
#