forked from p15670423/monkey
Island: Add units TCP and ICMP timeout option
The timeout option for TCP and ICMP scans is in milliseconds. Change "timeout" -> "timeout_ms" to avoid confusion.
This commit is contained in:
parent
25410716d3
commit
da8e814b95
|
@ -234,7 +234,7 @@ class AutomatedMaster(IMaster):
|
|||
break
|
||||
|
||||
# TODO: check units of timeout
|
||||
port_scan_data = self._puppet.scan_tcp_port(ip, p, options["timeout"])
|
||||
port_scan_data = self._puppet.scan_tcp_port(ip, p, options["timeout_ms"])
|
||||
if port_scan_data.status == PortStatus.OPEN:
|
||||
victim_host.services[port_scan_data.service] = {}
|
||||
victim_host.services[port_scan_data.service]["display_name"] = "unknown(TCP)"
|
||||
|
|
|
@ -488,7 +488,7 @@ class ConfigService:
|
|||
|
||||
formatted_tcp_scan_config = {}
|
||||
|
||||
formatted_tcp_scan_config["timeout"] = config[flat_tcp_timeout_field]
|
||||
formatted_tcp_scan_config["timeout_ms"] = config[flat_tcp_timeout_field]
|
||||
|
||||
ports = ConfigService._union_tcp_and_http_ports(
|
||||
config[flat_tcp_ports_field], config[flat_http_ports_field]
|
||||
|
@ -512,7 +512,7 @@ class ConfigService:
|
|||
flat_ping_timeout_field = "ping_scan_timeout"
|
||||
|
||||
formatted_icmp_scan_config = {}
|
||||
formatted_icmp_scan_config["timeout"] = config[flat_ping_timeout_field]
|
||||
formatted_icmp_scan_config["timeout_ms"] = config[flat_ping_timeout_field]
|
||||
|
||||
config.pop(flat_ping_timeout_field, None)
|
||||
|
||||
|
@ -527,9 +527,7 @@ class ConfigService:
|
|||
|
||||
formatted_scan_targets_config = {}
|
||||
|
||||
formatted_scan_targets_config[flat_blocked_ips_field] = config[
|
||||
flat_blocked_ips_field
|
||||
]
|
||||
formatted_scan_targets_config[flat_blocked_ips_field] = config[flat_blocked_ips_field]
|
||||
formatted_scan_targets_config[flat_inaccessible_subnets_field] = config[
|
||||
flat_inaccessible_subnets_field
|
||||
]
|
||||
|
|
|
@ -98,7 +98,7 @@ def test_get_config_propagation_credentials_from_flat_config(flat_monkey_config)
|
|||
def test_format_config_for_agent__network_scan(flat_monkey_config):
|
||||
expected_network_scan_config = {
|
||||
"tcp": {
|
||||
"timeout": 3000,
|
||||
"timeout_ms": 3000,
|
||||
"ports": [
|
||||
22,
|
||||
80,
|
||||
|
@ -116,7 +116,7 @@ def test_format_config_for_agent__network_scan(flat_monkey_config):
|
|||
],
|
||||
},
|
||||
"icmp": {
|
||||
"timeout": 1000,
|
||||
"timeout_ms": 1000,
|
||||
},
|
||||
"targets": {
|
||||
"blocked_ips": ["192.168.1.1", "192.168.1.100"],
|
||||
|
|
Loading…
Reference in New Issue