Agent: Add options parameter to IPuppet.fingerprint()

This commit is contained in:
Mike Salvatore 2022-02-07 08:33:08 -05:00
parent 0dae58baaf
commit 5695808adb
4 changed files with 9 additions and 2 deletions

View File

@ -83,6 +83,7 @@ class IPuppet(metaclass=abc.ABCMeta):
host: str,
ping_scan_data: PingScanData,
port_scan_data: Dict[int, PortScanData],
options: Dict,
) -> FingerprintData:
"""
Runs a fingerprinter against a remote host
@ -91,6 +92,8 @@ class IPuppet(metaclass=abc.ABCMeta):
:param PingScanData ping_scan_data: Data retrieved from the target host via ICMP
:param Dict[int, PortScanData] port_scan_data: Data retrieved from the target host via a TCP
port scan
:param Dict options: A dictionary containing options that modify the behavior of the
fingerprinter
:return: The data collected by running the fingerprinter on the specified host
:rtype: FingerprintData
"""

View File

@ -95,6 +95,8 @@ class IPScanner:
fingerprint_data = {}
for f in interruptable_iter(fingerprinters, stop):
fingerprint_data[f] = self._puppet.fingerprint(f, ip, ping_scan_data, port_scan_data)
fingerprint_data[f] = self._puppet.fingerprint(
f, ip, ping_scan_data, port_scan_data, {}
)
return fingerprint_data

View File

@ -206,6 +206,7 @@ class MockPuppet(IPuppet):
host: str,
ping_scan_data: PingScanData,
port_scan_data: Dict[int, PortScanData],
options: Dict,
) -> FingerprintData:
logger.debug(f"fingerprint({name}, {host})")
empty_fingerprint_data = FingerprintData(None, None, {})

View File

@ -47,8 +47,9 @@ class Puppet(IPuppet):
host: str,
ping_scan_data: PingScanData,
port_scan_data: Dict[int, PortScanData],
options: Dict,
) -> FingerprintData:
return self._mock_puppet.fingerprint(name, host, ping_scan_data, port_scan_data)
return self._mock_puppet.fingerprint(name, host, ping_scan_data, port_scan_data, options)
def exploit_host(
self, name: str, host: str, options: Dict, interrupt: threading.Event