Common: Add TCPScanEvent to agent events

This commit is contained in:
Ilija Lazoroski 2022-09-29 18:40:56 +02:00 committed by Mike Salvatore
parent f62ab10d1c
commit 28ca462ce5
3 changed files with 29 additions and 1 deletions

View File

@ -1,3 +1,4 @@
from .abstract_agent_event import AbstractAgentEvent
from .credentials_stolen_events import CredentialsStolenEvent
from .ping_scan_event import PingScanEvent
from .tcp_scan_event import TCPScanEvent

View File

@ -0,0 +1,23 @@
from ipaddress import IPv4Address
from common.types import NetworkPort, PortStatus
from . import AbstractAgentEvent
class TCPScanEvent(AbstractAgentEvent):
"""
An event that occurs when the Agent performs a TCP scan on its network
Attributes:
:param port: Port on which the scan was performed
:param port_status: Status of the port (closed/open)
:param banner: Information from the tcp response
:param service: Name of the service which runs on the port
"""
target: IPv4Address
port: NetworkPort
port_status: PortStatus
banner: str
service: str

View File

@ -7,7 +7,7 @@ from common.agent_configuration.agent_sub_configurations import (
CustomPBAConfiguration,
ScanTargetConfiguration,
)
from common.agent_events import PingScanEvent
from common.agent_events import PingScanEvent, TCPScanEvent
from common.credentials import Credentials, LMHash, NTHash
from infection_monkey.exploit.log4shell_utils.ldap_server import LDAPServerFactory
from monkey_island.cc.event_queue import IslandEventTopic, PyPubSubIslandEventQueue
@ -313,6 +313,10 @@ IAgentLogRepository.get_agent_log
# TODO: Remove once #2268 is closed
PingScanEvent
# TODO: Remove once #2267 is closed
TCPScanEvent
TCPScanEvent.port_status
# pydantic base models
underscore_attrs_are_private
extra