From a954df3ed89ad359201d0fb6e1e967f8054a775d Mon Sep 17 00:00:00 2001 From: Kekoa Kaaikala Date: Wed, 31 Aug 2022 15:34:48 +0000 Subject: [PATCH] Agent: Replace get_local_network_interfaces Replaced get_local_network_interfaces() with get_network_interfaces() --- monkey/infection_monkey/monkey.py | 4 ++-- monkey/infection_monkey/network/info.py | 4 ---- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/monkey/infection_monkey/monkey.py b/monkey/infection_monkey/monkey.py index 220eba1f8..115b67e24 100644 --- a/monkey/infection_monkey/monkey.py +++ b/monkey/infection_monkey/monkey.py @@ -41,7 +41,7 @@ from infection_monkey.master import AutomatedMaster from infection_monkey.master.control_channel import ControlChannel from infection_monkey.model import VictimHostFactory from infection_monkey.network.firewall import app as firewall -from infection_monkey.network.info import get_local_network_interfaces +from infection_monkey.network.info import get_network_interfaces from infection_monkey.network_scanning.elasticsearch_fingerprinter import ElasticSearchFingerprinter from infection_monkey.network_scanning.http_fingerprinter import HTTPFingerprinter from infection_monkey.network_scanning.mssql_fingerprinter import MSSQLFingerprinter @@ -240,7 +240,7 @@ class InfectionMonkey: @staticmethod def _get_local_network_interfaces() -> List[IPv4Interface]: - local_network_interfaces = get_local_network_interfaces() + local_network_interfaces = get_network_interfaces() for interface in local_network_interfaces: logger.debug(f"Found local interface {str(interface)}") diff --git a/monkey/infection_monkey/network/info.py b/monkey/infection_monkey/network/info.py index 304d37ff6..12748b8a0 100644 --- a/monkey/infection_monkey/network/info.py +++ b/monkey/infection_monkey/network/info.py @@ -26,10 +26,6 @@ class NetworkAddress: def get_network_interfaces() -> List[IPv4Interface]: - return get_local_network_interfaces() - - -def get_local_network_interfaces() -> List[IPv4Interface]: return [IPv4Interface(f"{i['addr']}/{i['netmask']}") for i in get_host_subnets()]