forked from p15670423/monkey
Common: Add SocketAddress type
This commit is contained in:
parent
1716a2dddd
commit
49e434d754
|
@ -1,8 +1,19 @@
|
|||
from ipaddress import IPv4Address
|
||||
from uuid import UUID
|
||||
|
||||
from pydantic import PositiveInt
|
||||
from pydantic import PositiveInt, conint
|
||||
from typing_extensions import TypeAlias
|
||||
|
||||
from common.base_models import InfectionMonkeyBaseModel
|
||||
|
||||
AgentID: TypeAlias = UUID
|
||||
HardwareID: TypeAlias = PositiveInt
|
||||
MachineID: TypeAlias = PositiveInt
|
||||
|
||||
|
||||
class SocketAddress(InfectionMonkeyBaseModel):
|
||||
ip: IPv4Address
|
||||
port: conint(ge=1, le=65535) # type: ignore[valid-type]
|
||||
|
||||
def __str__(self):
|
||||
return f"{self.ip}:{self.port}"
|
||||
|
|
|
@ -8,6 +8,7 @@ from common.agent_configuration.agent_sub_configurations import (
|
|||
ScanTargetConfiguration,
|
||||
)
|
||||
from common.credentials import Credentials, LMHash, NTHash
|
||||
from common.types import SocketAddress
|
||||
from infection_monkey.exploit.log4shell_utils.ldap_server import LDAPServerFactory
|
||||
from monkey_island.cc.event_queue import IslandEventTopic, PyPubSubIslandEventQueue
|
||||
from monkey_island.cc.models import Report
|
||||
|
@ -324,3 +325,6 @@ SCANNED
|
|||
EXPLOITED
|
||||
CC
|
||||
CC_TUNNEL
|
||||
|
||||
# TODO: Remove after #2323
|
||||
SocketAddress
|
||||
|
|
Loading…
Reference in New Issue