Agent: Use Sequence instead of List for type hints
This commit is contained in:
parent
4f7d8be6ba
commit
503a0a833f
|
@ -5,7 +5,7 @@ from copy import deepcopy
|
||||||
from itertools import chain
|
from itertools import chain
|
||||||
from queue import Queue
|
from queue import Queue
|
||||||
from threading import Event
|
from threading import Event
|
||||||
from typing import Callable, Dict, List
|
from typing import Callable, Dict, Sequence
|
||||||
|
|
||||||
from common import OperatingSystems
|
from common import OperatingSystems
|
||||||
from common.configuration.agent_sub_configurations import (
|
from common.configuration.agent_sub_configurations import (
|
||||||
|
@ -81,7 +81,7 @@ class Exploiter:
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _process_exploiter_config(
|
def _process_exploiter_config(
|
||||||
exploiter_config: ExploitationConfiguration,
|
exploiter_config: ExploitationConfiguration,
|
||||||
) -> List[ExploiterConfiguration]:
|
) -> Sequence[ExploiterConfiguration]:
|
||||||
# Run vulnerability exploiters before brute force exploiters to minimize the effect of
|
# Run vulnerability exploiters before brute force exploiters to minimize the effect of
|
||||||
# account lockout due to invalid credentials
|
# account lockout due to invalid credentials
|
||||||
ordered_exploiters = chain(exploiter_config.vulnerability, exploiter_config.brute_force)
|
ordered_exploiters = chain(exploiter_config.vulnerability, exploiter_config.brute_force)
|
||||||
|
@ -98,7 +98,7 @@ class Exploiter:
|
||||||
|
|
||||||
def _exploit_hosts_on_queue(
|
def _exploit_hosts_on_queue(
|
||||||
self,
|
self,
|
||||||
exploiters_to_run: List[ExploiterConfiguration],
|
exploiters_to_run: Sequence[ExploiterConfiguration],
|
||||||
hosts_to_exploit: Queue,
|
hosts_to_exploit: Queue,
|
||||||
current_depth: int,
|
current_depth: int,
|
||||||
results_callback: Callback,
|
results_callback: Callback,
|
||||||
|
@ -125,7 +125,7 @@ class Exploiter:
|
||||||
|
|
||||||
def _run_all_exploiters(
|
def _run_all_exploiters(
|
||||||
self,
|
self,
|
||||||
exploiters_to_run: List[ExploiterConfiguration],
|
exploiters_to_run: Sequence[ExploiterConfiguration],
|
||||||
victim_host: VictimHost,
|
victim_host: VictimHost,
|
||||||
current_depth: int,
|
current_depth: int,
|
||||||
results_callback: Callback,
|
results_callback: Callback,
|
||||||
|
|
|
@ -3,7 +3,7 @@ import queue
|
||||||
import threading
|
import threading
|
||||||
from queue import Queue
|
from queue import Queue
|
||||||
from threading import Event
|
from threading import Event
|
||||||
from typing import Callable, Dict, List
|
from typing import Callable, Dict, Sequence
|
||||||
|
|
||||||
from common.configuration.agent_sub_configurations import (
|
from common.configuration.agent_sub_configurations import (
|
||||||
NetworkScanConfiguration,
|
NetworkScanConfiguration,
|
||||||
|
@ -34,7 +34,7 @@ class IPScanner:
|
||||||
|
|
||||||
def scan(
|
def scan(
|
||||||
self,
|
self,
|
||||||
addresses_to_scan: List[NetworkAddress],
|
addresses_to_scan: Sequence[NetworkAddress],
|
||||||
options: ScanTargetConfiguration,
|
options: ScanTargetConfiguration,
|
||||||
results_callback: Callback,
|
results_callback: Callback,
|
||||||
stop: Event,
|
stop: Event,
|
||||||
|
@ -99,7 +99,7 @@ class IPScanner:
|
||||||
def _run_fingerprinters(
|
def _run_fingerprinters(
|
||||||
self,
|
self,
|
||||||
ip: str,
|
ip: str,
|
||||||
fingerprinters: List[PluginConfiguration],
|
fingerprinters: Sequence[PluginConfiguration],
|
||||||
ping_scan_data: PingScanData,
|
ping_scan_data: PingScanData,
|
||||||
port_scan_data: Dict[int, PortScanData],
|
port_scan_data: Dict[int, PortScanData],
|
||||||
stop: Event,
|
stop: Event,
|
||||||
|
|
Loading…
Reference in New Issue