@@ -99,32 +99,6 @@ class HookedBrowsers < BeEF::Core::Router::Router
9999 output . to_json
100100 end
101101
102- #
103- # @note this is basically the same call as /api/hooks, but returns different data structured in arrays rather than objects.
104- # Useful if you need to query the API via jQuery.dataTable < 1.10 which is currently used in PhishingFrenzy
105- #
106- get '/pf/online' do
107- online_hooks = hbs_to_array ( BeEF ::Core ::Models ::HookedBrowser . where ( 'lastseen >= ?' , ( Time . new . to_i - 15 ) ) )
108-
109- output = {
110- 'aaData' => online_hooks
111- }
112- output . to_json
113- end
114-
115- #
116- # @note this is basically the same call as /api/hooks, but returns different data structured in arrays rather than objects.
117- # Useful if you need to query the API via jQuery.dataTable < 1.10 which is currently used in PhishingFrenzy
118- #
119- get '/pf/offline' do
120- offline_hooks = hbs_to_array ( BeEF ::Core ::Models ::HookedBrowser . where ( 'lastseen <= ?' , ( Time . new . to_i - 15 ) ) )
121-
122- output = {
123- 'aaData' => offline_hooks
124- }
125- output . to_json
126- end
127-
128102 #
129103 # @note Get all the hooked browser details (plugins enabled, technologies enabled, cookies)
130104 #
@@ -198,38 +172,6 @@ def get_hb_details(hb)
198172 'country_code' => details . get ( hb . session , 'location.country.isocode' )
199173 }
200174 end
201-
202- # this is used in the 'get '/pf'' restful api call
203- def hbs_to_array ( hbs )
204- hooked_browsers = [ ]
205- hbs . each do |hb |
206- details = BeEF ::Core ::Models ::BrowserDetails
207- # @todo what does the below TODO comment mean? why do we care about the client side view inside a controller?
208- # TODO: jQuery.dataTables needs fixed array indexes, add emptry string if a value is blank
209-
210- pfuid = details . get ( hb . session , 'PhishingFrenzyUID' ) . nil? ? 'n/a' : details . get ( hb . session , 'PhishingFrenzyUID' )
211- bname = details . get ( hb . session , 'browser.name' ) . nil? ? 'n/a' : details . get ( hb . session , 'browser.name' )
212- bversion = details . get ( hb . session , 'browser.version' ) . nil? ? 'n/a' : details . get ( hb . session , 'browser.version' )
213- bplugins = details . get ( hb . session , 'browser.plugins' ) . nil? ? 'n/a' : details . get ( hb . session , 'browser.plugins' )
214-
215- hooked_browsers << [
216- hb . id ,
217- hb . ip ,
218- pfuid ,
219- bname ,
220- bversion ,
221- details . get ( hb . session , 'host.os.name' ) ,
222- details . get ( hb . session , 'browser.platform' ) ,
223- details . get ( hb . session , 'browser.language' ) ,
224- bplugins ,
225- details . get ( hb . session , 'location.city' ) ,
226- details . get ( hb . session , 'location.country' ) ,
227- details . get ( hb . session , 'location.latitude' ) ,
228- details . get ( hb . session , 'location.longitude' )
229- ]
230- end
231- hooked_browsers
232- end
233175 end
234176 end
235177 end
0 commit comments