Add proxy_address and proxy_port parameters to the agents.

This commit is contained in:
Ramon Novoa 2020-09-23 12:04:55 +02:00
parent d8daf9f063
commit f39be8f5b9
10 changed files with 65 additions and 3 deletions

View File

@ -99,6 +99,12 @@ transfer_mode tentacle
# Proxy timeout (by default 1s)
# proxy_timeout 1
# Address the proxy will listen on.
#proxy_address 0.0.0.0
# Port the proxy will listen on.
#proxy_port 41121
# User the agent will run as
#pandora_user root

View File

@ -129,6 +129,12 @@ transfer_mode tentacle
# Proxy timeout (by default 1s)
# proxy_timeout 1
# Address the proxy will listen on.
#proxy_address 0.0.0.0
# Port the proxy will listen on.
#proxy_port 41121
# Number of threads to execute modules in parallel
#agent_threads 1

View File

@ -142,6 +142,12 @@ remote_config 0
# Proxy timeout (by default 1s)
#proxy_timeout 1
# Address the proxy will listen on.
#proxy_address 0.0.0.0
# Port the proxy will listen on.
#proxy_port 41121
# Number of threads to execute modules in parallel
#agent_threads 1

View File

@ -101,6 +101,12 @@ transfer_mode tentacle
# Proxy timeout (by default 1s)
# proxy_timeout 1
# Address the proxy will listen on.
#proxy_address 0.0.0.0
# Port the proxy will listen on.
#proxy_port 41121
# User the agent will run as
#pandora_user root

View File

@ -148,6 +148,12 @@ remote_config 0
# Proxy timeout (by default 1s)
# proxy_timeout 1
# Address the proxy will listen on.
#proxy_address 0.0.0.0
# Port the proxy will listen on.
#proxy_port 41121
# Number of threads to execute modules in parallel
#agent_threads 1

View File

@ -110,6 +110,12 @@ transfer_mode tentacle
# Proxy timeout (by default 1s)
#proxy_timeout 1
# Address the proxy will listen on.
#proxy_address 0.0.0.0
# Port the proxy will listen on.
#proxy_port 41121
# Number of threads to execute modules in parallel
#agent_threads 1

View File

@ -104,6 +104,12 @@ transfer_mode tentacle
# Proxy timeout (by default 1s)
#proxy_timeout 1
# Address the proxy will listen on.
#proxy_address 0.0.0.0
# Port the proxy will listen on.
#proxy_port 41121
# User the agent will run as
#pandora_user root

View File

@ -192,6 +192,8 @@ my %DefaultConf = (
'udp_server_port' => 41122,
'udp_server_auth_address' => '0.0.0.0',
'udp_server' => 0,
'proxy_address' => '0.0.0.0',
'proxy_port' => 41121,
'proxy_mode' => 0,
'proxy_max_connection' => 10,
'proxy_timeout' => 1,
@ -1383,7 +1385,7 @@ sub launch_tentacle_proxy () {
if ($tentacle_pid == 0) {
#Execute tentacle server as a daemon
my $new_process = "tentacle_server -b ".$Conf{'server_ip'}." -g ".$Conf{'server_port'}." -c ".$Conf{'proxy_max_connection'}." -t ".$Conf{'proxy_timeout'};
my $new_process = "tentacle_server -a ".$Conf{'proxy_address'}." -p ".$Conf{'proxy_port'}." -b ".$Conf{'server_ip'}." -g ".$Conf{'server_port'}." -c ".$Conf{'proxy_max_connection'}." -t ".$Conf{'proxy_timeout'};
$new_process .= ' -C' if ($Conf{'server_ssl'} eq '1');

View File

@ -99,6 +99,12 @@ server_port 41121
# Proxy timeout (by default 1s)
# proxy_timeout 1
# Address the proxy will listen on.
#proxy_address 0.0.0.0
# Port the proxy will listen on.
#proxy_port 41121
# Enable or disable XML buffer.
xml_buffer 1

View File

@ -424,7 +424,7 @@ Pandora_Windows_Service::killTentacleProxy() {
int
Pandora_Windows_Service::launchTentacleProxy() {
string server_ip, server_port, proxy_max_connections, proxy_timeout, server_ssl;
string proxy_cmd;
string proxy_cmd, proxy_address, proxy_port;
PROCESS_INFORMATION pi;
STARTUPINFO si;
@ -460,7 +460,19 @@ Pandora_Windows_Service::launchTentacleProxy() {
proxy_cmd = "tentacle_server.exe";
}
proxy_cmd += " -b " + server_ip + " -g " + server_port + " -c " + proxy_max_connections + " -t " + proxy_timeout;
// Proxy address.
proxy_address = conf->getValue("proxy_address");
if (proxy_address == "") {
proxy_address = "0.0.0.0";
}
// Proxy port.
proxy_port = conf->getValue("proxy_port");
if (proxy_port == "") {
proxy_port = "41121";
}
proxy_cmd += " -b " + server_ip + " -g " + server_port + " -c " + proxy_max_connections + " -t " + proxy_timeout + " -a " + proxy_address + " -p " + proxy_port;
ZeroMemory (&si, sizeof (si));
ZeroMemory (&pi, sizeof (pi));