forked from p15670423/monkey
Common: Add ExploitationEvent to agent_events
This commit is contained in:
parent
5b9811f089
commit
a7872d69cf
|
@ -3,3 +3,4 @@ from .credentials_stolen_events import CredentialsStolenEvent
|
|||
from .ping_scan_event import PingScanEvent
|
||||
from .tcp_scan_event import TCPScanEvent
|
||||
from .propagation_event import PropagationEvent
|
||||
from .exploitation_event import ExploitationEvent
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
from ipaddress import IPv4Address
|
||||
|
||||
from pydantic import Field
|
||||
|
||||
from . import AbstractAgentEvent
|
||||
|
||||
|
||||
class ExploitationEvent(AbstractAgentEvent):
|
||||
"""
|
||||
An event that occurs when the Agent exploits a host
|
||||
|
||||
Attributes:
|
||||
:param target: IP address of the exploited system
|
||||
:param success: Status of the exploitation
|
||||
:param exploiter_name: Name of the exploiter that triggered the event
|
||||
:param error_message: Message if an error occurs during exploitation
|
||||
"""
|
||||
|
||||
target: IPv4Address
|
||||
success: bool
|
||||
exploiter_name: str
|
||||
error_message: str = Field(default="")
|
|
@ -7,7 +7,7 @@ from common.agent_configuration.agent_sub_configurations import (
|
|||
CustomPBAConfiguration,
|
||||
ScanTargetConfiguration,
|
||||
)
|
||||
from common.agent_events import PingScanEvent, PropagationEvent, TCPScanEvent
|
||||
from common.agent_events import ExploitationEvent, PingScanEvent, PropagationEvent, TCPScanEvent
|
||||
from common.credentials import Credentials, LMHash, NTHash
|
||||
from common.types import NetworkPort
|
||||
from infection_monkey.exploit.log4shell_utils.ldap_server import LDAPServerFactory
|
||||
|
@ -317,6 +317,7 @@ TCPScanEvent.port_status
|
|||
|
||||
# TODO: Remove once #2269 is close
|
||||
PropagationEvent
|
||||
ExploitationEvent
|
||||
|
||||
# pydantic base models
|
||||
underscore_attrs_are_private
|
||||
|
|
Loading…
Reference in New Issue