forked from p15670423/monkey
Agent: Remove can_island_see_port()
This commit is contained in:
parent
32c2d744b5
commit
476b6c3b36
|
@ -13,11 +13,7 @@ import infection_monkey.monkeyfs as monkeyfs
|
||||||
import infection_monkey.tunnel as tunnel
|
import infection_monkey.tunnel as tunnel
|
||||||
from common.common_consts.api_url_consts import T1216_PBA_FILE_DOWNLOAD_PATH
|
from common.common_consts.api_url_consts import T1216_PBA_FILE_DOWNLOAD_PATH
|
||||||
from common.common_consts.time_formats import DEFAULT_TIME_FORMAT
|
from common.common_consts.time_formats import DEFAULT_TIME_FORMAT
|
||||||
from common.common_consts.timeouts import (
|
from common.common_consts.timeouts import LONG_REQUEST_TIMEOUT, MEDIUM_REQUEST_TIMEOUT
|
||||||
LONG_REQUEST_TIMEOUT,
|
|
||||||
MEDIUM_REQUEST_TIMEOUT,
|
|
||||||
SHORT_REQUEST_TIMEOUT,
|
|
||||||
)
|
|
||||||
from infection_monkey.config import GUID, WormConfiguration
|
from infection_monkey.config import GUID, WormConfiguration
|
||||||
from infection_monkey.network.info import local_ips
|
from infection_monkey.network.info import local_ips
|
||||||
from infection_monkey.transport.http import HTTPConnectProxy
|
from infection_monkey.transport.http import HTTPConnectProxy
|
||||||
|
@ -407,21 +403,6 @@ class ControlClient(object):
|
||||||
except requests.exceptions.RequestException:
|
except requests.exceptions.RequestException:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def can_island_see_port(port):
|
|
||||||
try:
|
|
||||||
url = (
|
|
||||||
f"https://{WormConfiguration.current_server}/api/monkey_control"
|
|
||||||
f"/check_remote_port/{port}"
|
|
||||||
)
|
|
||||||
response = requests.get( # noqa: DUO123
|
|
||||||
url, verify=False, timeout=SHORT_REQUEST_TIMEOUT
|
|
||||||
)
|
|
||||||
response = json.loads(response.content.decode())
|
|
||||||
return response["status"] == "port_visible"
|
|
||||||
except requests.exceptions.RequestException:
|
|
||||||
return False
|
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def report_start_on_island():
|
def report_start_on_island():
|
||||||
requests.post( # noqa: DUO123
|
requests.post( # noqa: DUO123
|
||||||
|
|
Loading…
Reference in New Issue