forked from p15670423/monkey
Agent: Remove HostExploiter's dependency on Plugin
Issue #1605 PR #1725
This commit is contained in:
parent
250530b456
commit
6150610bdc
|
@ -2,32 +2,14 @@ import logging
|
||||||
from abc import abstractmethod
|
from abc import abstractmethod
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
import infection_monkey.exploit
|
|
||||||
from common.utils.exceptions import FailedExploitationError
|
from common.utils.exceptions import FailedExploitationError
|
||||||
from common.utils.exploit_enum import ExploitType
|
from common.utils.exploit_enum import ExploitType
|
||||||
from infection_monkey.config import WormConfiguration
|
from infection_monkey.config import WormConfiguration
|
||||||
from infection_monkey.utils.plugins.plugin import Plugin
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class HostExploiter(Plugin):
|
class HostExploiter:
|
||||||
@staticmethod
|
|
||||||
def should_run(class_name):
|
|
||||||
"""
|
|
||||||
Decides if post breach action is enabled in config
|
|
||||||
:return: True if it needs to be ran, false otherwise
|
|
||||||
"""
|
|
||||||
return class_name in WormConfiguration.exploiter_classes
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def base_package_file():
|
|
||||||
return infection_monkey.exploit.__file__
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def base_package_name():
|
|
||||||
return infection_monkey.exploit.__package__
|
|
||||||
|
|
||||||
_TARGET_OS_TYPE = []
|
_TARGET_OS_TYPE = []
|
||||||
|
|
||||||
# Usual values are 'vulnerability' or 'brute_force'
|
# Usual values are 'vulnerability' or 'brute_force'
|
||||||
|
|
Loading…
Reference in New Issue