diff --git a/monkey/infection_monkey/network/elasticsearch_fingerprinter.py b/monkey/infection_monkey/network/elasticsearch_fingerprinter.py index 6670c3621..cbdce5812 100644 --- a/monkey/infection_monkey/network/elasticsearch_fingerprinter.py +++ b/monkey/infection_monkey/network/elasticsearch_fingerprinter.py @@ -13,6 +13,7 @@ from infection_monkey.i_puppet import ( PortStatus, ) +DISPLAY_NAME = "ElasticSearch" ES_PORT = 9200 ES_HTTP_TIMEOUT = 5 logger = logging.getLogger(__name__) @@ -54,7 +55,7 @@ def _query_elasticsearch(host: str) -> Dict[str, Any]: def _get_service_from_query_info(elasticsearch_info: Dict[str, Any]) -> Dict[str, Any]: try: return { - "display_name": "ElasticSearch", + "display_name": DISPLAY_NAME, "port": ES_PORT, "cluster_name": elasticsearch_info["cluster_name"], "name": elasticsearch_info["name"], diff --git a/monkey/infection_monkey/network/http_fingerprinter.py b/monkey/infection_monkey/network/http_fingerprinter.py index 6333dad6a..8ececc72a 100644 --- a/monkey/infection_monkey/network/http_fingerprinter.py +++ b/monkey/infection_monkey/network/http_fingerprinter.py @@ -15,6 +15,8 @@ from infection_monkey.i_puppet import ( logger = logging.getLogger(__name__) +DISPLAY_NAME = "HTTP" + class HTTPFingerprinter(IFingerprinter): """ @@ -38,7 +40,7 @@ class HTTPFingerprinter(IFingerprinter): if server_header_contents is not None: services[f"tcp-{port}"] = { - "display_name": "HTTP", + "display_name": DISPLAY_NAME, "port": port, "name": "http", "data": (server_header_contents, ssl), diff --git a/monkey/infection_monkey/network/mssql_fingerprinter.py b/monkey/infection_monkey/network/mssql_fingerprinter.py index dc1247c03..18630aaa7 100644 --- a/monkey/infection_monkey/network/mssql_fingerprinter.py +++ b/monkey/infection_monkey/network/mssql_fingerprinter.py @@ -6,6 +6,7 @@ from typing import Any, Dict, Optional from infection_monkey.i_puppet import FingerprintData, IFingerprinter, PingScanData, PortScanData MSSQL_SERVICE = "MSSQL" +DISPLAY_NAME = MSSQL_SERVICE SQL_BROWSER_DEFAULT_PORT = 1434 _BUFFER_SIZE = 4096 _MSSQL_SOCKET_TIMEOUT = 5 @@ -78,7 +79,7 @@ def _query_mssql_for_instance_data(host: str) -> Optional[bytes]: def _get_services_from_server_data(data: bytes) -> Dict[str, Any]: services = {MSSQL_SERVICE: {}} - services[MSSQL_SERVICE]["display_name"] = MSSQL_SERVICE + services[MSSQL_SERVICE]["display_name"] = DISPLAY_NAME services[MSSQL_SERVICE]["port"] = SQL_BROWSER_DEFAULT_PORT # Loop through the server data diff --git a/monkey/infection_monkey/network/smb_fingerprinter.py b/monkey/infection_monkey/network/smb_fingerprinter.py index 0d13a2d36..d47ce224e 100644 --- a/monkey/infection_monkey/network/smb_fingerprinter.py +++ b/monkey/infection_monkey/network/smb_fingerprinter.py @@ -13,7 +13,7 @@ from infection_monkey.i_puppet import ( PortStatus, ) -SMB_DISPLAY_NAME = "SMB" +DISPLAY_NAME = "SMB" SMB_PORT = 445 SMB_SERVICE = "tcp-445" @@ -145,7 +145,7 @@ class SMBFingerprinter(IFingerprinter): ) -> FingerprintData: services = {} smb_service = { - "display_name": SMB_DISPLAY_NAME, + "display_name": DISPLAY_NAME, "port": SMB_PORT, } os_type = None