scapy.contrib.automotive.gm.gmlan_scanner

class scapy.contrib.automotive.gm.gmlan_scanner.GMLAN_DCEnumerator[source]

Bases: scapy.contrib.automotive.gm.gmlan_scanner.GMLAN_Enumerator

class scapy.contrib.automotive.gm.gmlan_scanner.GMLAN_IDOEnumerator[source]

Bases: scapy.contrib.automotive.gm.gmlan_scanner.GMLAN_Enumerator, scapy.contrib.automotive.scanner.enumerator.StateGeneratingServiceEnumerator

static enter_diagnostic_session(socket: Union[scapy.supersocket.SuperSocket, scapy.utils.SingleConversationSocket]) bool[source]
static enter_state_with_tp(sock: Union[scapy.supersocket.SuperSocket, scapy.utils.SingleConversationSocket], conf: scapy.contrib.automotive.scanner.configuration.AutomotiveTestCaseExecutorConfiguration, kwargs: Dict[str, Any]) bool[source]
get_new_edge(socket: Union[scapy.supersocket.SuperSocket, scapy.utils.SingleConversationSocket], config: scapy.contrib.automotive.scanner.configuration.AutomotiveTestCaseExecutorConfiguration) Optional[Tuple[scapy.contrib.automotive.ecu.EcuState, scapy.contrib.automotive.ecu.EcuState]][source]
get_transition_function(socket: Union[scapy.supersocket.SuperSocket, scapy.utils.SingleConversationSocket], edge: Tuple[scapy.contrib.automotive.ecu.EcuState, scapy.contrib.automotive.ecu.EcuState]) Optional[Tuple[Callable[[Union[scapy.supersocket.SuperSocket, scapy.utils.SingleConversationSocket], scapy.contrib.automotive.scanner.configuration.AutomotiveTestCaseExecutorConfiguration, Dict[str, Any]], bool], Dict[str, Any], Optional[Callable[[Union[scapy.supersocket.SuperSocket, scapy.utils.SingleConversationSocket], scapy.contrib.automotive.scanner.configuration.AutomotiveTestCaseExecutorConfiguration], bool]]]][source]
class scapy.contrib.automotive.gm.gmlan_scanner.GMLAN_PMEnumerator[source]

Bases: scapy.contrib.automotive.gm.gmlan_scanner.GMLAN_Enumerator, scapy.contrib.automotive.scanner.enumerator.StateGeneratingServiceEnumerator

static enter_state_with_tp(sock: Union[scapy.supersocket.SuperSocket, scapy.utils.SingleConversationSocket], conf: scapy.contrib.automotive.scanner.configuration.AutomotiveTestCaseExecutorConfiguration, kwargs: Dict[str, Any]) bool[source]
execute(socket: Union[scapy.supersocket.SuperSocket, scapy.utils.SingleConversationSocket], state: scapy.contrib.automotive.ecu.EcuState, timeout: int = 1, execution_time: int = 1200, **kwargs: Any) None[source]
get_new_edge(socket: Union[scapy.supersocket.SuperSocket, scapy.utils.SingleConversationSocket], config: scapy.contrib.automotive.scanner.configuration.AutomotiveTestCaseExecutorConfiguration) Optional[Tuple[scapy.contrib.automotive.ecu.EcuState, scapy.contrib.automotive.ecu.EcuState]][source]
get_transition_function(socket: Union[scapy.supersocket.SuperSocket, scapy.utils.SingleConversationSocket], edge: Tuple[scapy.contrib.automotive.ecu.EcuState, scapy.contrib.automotive.ecu.EcuState]) Optional[Tuple[Callable[[Union[scapy.supersocket.SuperSocket, scapy.utils.SingleConversationSocket], scapy.contrib.automotive.scanner.configuration.AutomotiveTestCaseExecutorConfiguration, Dict[str, Any]], bool], Dict[str, Any], Optional[Callable[[Union[scapy.supersocket.SuperSocket, scapy.utils.SingleConversationSocket], scapy.contrib.automotive.scanner.configuration.AutomotiveTestCaseExecutorConfiguration], bool]]]][source]
class scapy.contrib.automotive.gm.gmlan_scanner.GMLAN_RDBIEnumerator[source]

Bases: scapy.contrib.automotive.gm.gmlan_scanner.GMLAN_Enumerator

static print_information(resp: scapy.packet.Packet) str[source]
class scapy.contrib.automotive.gm.gmlan_scanner.GMLAN_RDBPIEnumerator[source]

Bases: scapy.contrib.automotive.gm.gmlan_scanner.GMLAN_Enumerator

class scapy.contrib.automotive.gm.gmlan_scanner.GMLAN_RDEnumerator[source]

Bases: scapy.contrib.automotive.gm.gmlan_scanner.GMLAN_Enumerator, scapy.contrib.automotive.scanner.enumerator.StateGeneratingServiceEnumerator

class scapy.contrib.automotive.gm.gmlan_scanner.GMLAN_RMBAEnumerator[source]

Bases: scapy.contrib.automotive.gm.gmlan_scanner.GMLAN_Enumerator

execute(socket: Union[scapy.supersocket.SuperSocket, scapy.utils.SingleConversationSocket], state: scapy.contrib.automotive.ecu.EcuState, **kwargs: Any) None[source]
Parameters
  • timeout (integer or float) – Timeout until a response will arrive after a request

  • execution_time (int) – Time in seconds until the execution of this enumerator is stopped.

  • state_allow_list (EcuState or list) – List of EcuState objects or EcuState object in which the the execution of this enumerator is allowed. If provided, other states will not be executed.

  • state_block_list (EcuState or list) – List of EcuState objects or EcuState object in which the the execution of this enumerator is blocked.

  • retry_if_none_received (bool) – Specifies if a request will be send again, if None was received (usually because of a timeout).

  • exit_if_no_answer_received (bool) – Specifies to finish the execution of this enumerator once None is received.

  • exit_if_service_not_supported (bool) – Specifies to finish the execution of this enumerator, once the negative return code ‘serviceNotSupported’ is received.

  • exit_scan_on_first_negative_response (bool) – Specifies to finish the execution once a negative response is received.

  • retry_if_busy_returncode (bool) – Specifies to retry a request, if the ‘busyRepeatRequest’ negative response code is received.

  • debug (bool) – Enables debug functions during execute.

  • scan_range (list or tuple or range or iterable) – Specifies the identifiers to be scanned.

  • probe_width (int) – Memory size of a probe.

  • random_probes_len (int) – Number of probes.

  • sequential_probes_len (int) – Size of a memory block during sequential probing.

post_execute(socket: Union[scapy.supersocket.SuperSocket, scapy.utils.SingleConversationSocket], state: scapy.contrib.automotive.ecu.EcuState, global_configuration: scapy.contrib.automotive.scanner.configuration.AutomotiveTestCaseExecutorConfiguration) None[source]
show(dump: bool = False, filtered: bool = True, verbose: bool = False) Optional[str][source]
class scapy.contrib.automotive.gm.gmlan_scanner.GMLAN_SAEnumerator[source]

Bases: scapy.contrib.automotive.gm.gmlan_scanner.GMLAN_Enumerator, scapy.contrib.automotive.scanner.test_case.StateGenerator

static evaluate_security_access_response(res: Optional[scapy.packet.Packet], seed: scapy.packet.Packet, key: Optional[scapy.packet.Packet]) bool[source]
execute(socket: Union[scapy.supersocket.SuperSocket, scapy.utils.SingleConversationSocket], state: scapy.contrib.automotive.ecu.EcuState, **kwargs: Any) None[source]
Parameters
  • timeout (integer or float) – Timeout until a response will arrive after a request

  • execution_time (int) – Time in seconds until the execution of this enumerator is stopped.

  • state_allow_list (EcuState or list) – List of EcuState objects or EcuState object in which the the execution of this enumerator is allowed. If provided, other states will not be executed.

  • state_block_list (EcuState or list) – List of EcuState objects or EcuState object in which the the execution of this enumerator is blocked.

  • retry_if_none_received (bool) – Specifies if a request will be send again, if None was received (usually because of a timeout).

  • exit_if_no_answer_received (bool) – Specifies to finish the execution of this enumerator once None is received.

  • exit_if_service_not_supported (bool) – Specifies to finish the execution of this enumerator, once the negative return code ‘serviceNotSupported’ is received.

  • exit_scan_on_first_negative_response (bool) – Specifies to finish the execution once a negative response is received.

  • retry_if_busy_returncode (bool) – Specifies to retry a request, if the ‘busyRepeatRequest’ negative response code is received.

  • debug (bool) – Enables debug functions during execute.

  • scan_range (list or tuple or range or iterable) – Specifies the identifiers to be scanned.

  • keyfunction (Callable[[int], int]) – Specifies a function to generate the key from a given seed.

static get_key_pkt(seed: scapy.packet.Packet, keyfunction: Callable[[int], int], level: int = 1) Optional[scapy.packet.Packet][source]
get_new_edge(socket: Union[scapy.supersocket.SuperSocket, scapy.utils.SingleConversationSocket], config: scapy.contrib.automotive.scanner.configuration.AutomotiveTestCaseExecutorConfiguration) Optional[Tuple[scapy.contrib.automotive.ecu.EcuState, scapy.contrib.automotive.ecu.EcuState]][source]
static get_security_access(sock: Union[scapy.supersocket.SuperSocket, scapy.utils.SingleConversationSocket], level: int = 1, seed_pkt: Optional[scapy.packet.Packet] = None, keyfunction: Optional[Callable[[int], int]] = None) bool[source]
static get_seed_pkt(sock: Union[scapy.supersocket.SuperSocket, scapy.utils.SingleConversationSocket], level: int = 1) Optional[scapy.packet.Packet][source]
get_transition_function(socket: Union[scapy.supersocket.SuperSocket, scapy.utils.SingleConversationSocket], edge: Tuple[scapy.contrib.automotive.ecu.EcuState, scapy.contrib.automotive.ecu.EcuState]) Optional[Tuple[Callable[[Union[scapy.supersocket.SuperSocket, scapy.utils.SingleConversationSocket], scapy.contrib.automotive.scanner.configuration.AutomotiveTestCaseExecutorConfiguration, Dict[str, Any]], bool], Dict[str, Any], Optional[Callable[[Union[scapy.supersocket.SuperSocket, scapy.utils.SingleConversationSocket], scapy.contrib.automotive.scanner.configuration.AutomotiveTestCaseExecutorConfiguration], bool]]]][source]
pre_execute(socket: Union[scapy.supersocket.SuperSocket, scapy.utils.SingleConversationSocket], state: scapy.contrib.automotive.ecu.EcuState, global_configuration: scapy.contrib.automotive.scanner.configuration.AutomotiveTestCaseExecutorConfiguration) None[source]
static transition_function(sock: Union[scapy.supersocket.SuperSocket, scapy.utils.SingleConversationSocket], _: scapy.contrib.automotive.scanner.configuration.AutomotiveTestCaseExecutorConfiguration, kwargs: Dict[str, Any]) bool[source]
class scapy.contrib.automotive.gm.gmlan_scanner.GMLAN_Scanner(socket: Union[scapy.supersocket.SuperSocket, scapy.utils.SingleConversationSocket], reset_handler: Optional[Callable[[], None]] = None, reconnect_handler: Optional[Callable[[], Union[scapy.supersocket.SuperSocket, scapy.utils.SingleConversationSocket]]] = None, test_cases: Optional[List[Union[scapy.contrib.automotive.scanner.test_case.AutomotiveTestCaseABC, Type[scapy.contrib.automotive.scanner.test_case.AutomotiveTestCaseABC]]]] = None, **kwargs: Optional[Dict[str, Any]])[source]

Bases: scapy.contrib.automotive.scanner.executor.AutomotiveTestCaseExecutor

property default_test_case_clss
class scapy.contrib.automotive.gm.gmlan_scanner.GMLAN_ServiceEnumerator[source]

Bases: scapy.contrib.automotive.gm.gmlan_scanner.GMLAN_Enumerator, scapy.contrib.automotive.scanner.enumerator.StateGeneratingServiceEnumerator

This enumerator scans for all services identifiers of GMLAN. During this scan, corrupted packets might be sent to an ECU and mainly negative responses will be received.

class scapy.contrib.automotive.gm.gmlan_scanner.GMLAN_TDEnumerator[source]

Bases: scapy.contrib.automotive.gm.gmlan_scanner.GMLAN_Enumerator

class scapy.contrib.automotive.gm.gmlan_scanner.GMLAN_TPEnumerator[source]

Bases: scapy.contrib.automotive.gm.gmlan_scanner.GMLAN_Enumerator, scapy.contrib.automotive.scanner.enumerator.StateGeneratingServiceEnumerator

Performs a check if TesterPresent is available. If a positive response is received, a new system state is generated and returned.

static cleanup(_: Union[scapy.supersocket.SuperSocket, scapy.utils.SingleConversationSocket], configuration: scapy.contrib.automotive.scanner.configuration.AutomotiveTestCaseExecutorConfiguration) bool[source]
static enter(socket: Union[scapy.supersocket.SuperSocket, scapy.utils.SingleConversationSocket], configuration: scapy.contrib.automotive.scanner.configuration.AutomotiveTestCaseExecutorConfiguration, kwargs: Dict[str, Any]) bool[source]
get_transition_function(socket: Union[scapy.supersocket.SuperSocket, scapy.utils.SingleConversationSocket], edge: Tuple[scapy.contrib.automotive.ecu.EcuState, scapy.contrib.automotive.ecu.EcuState]) Optional[Tuple[Callable[[Union[scapy.supersocket.SuperSocket, scapy.utils.SingleConversationSocket], scapy.contrib.automotive.scanner.configuration.AutomotiveTestCaseExecutorConfiguration, Dict[str, Any]], bool], Dict[str, Any], Optional[Callable[[Union[scapy.supersocket.SuperSocket, scapy.utils.SingleConversationSocket], scapy.contrib.automotive.scanner.configuration.AutomotiveTestCaseExecutorConfiguration], bool]]]][source]
class scapy.contrib.automotive.gm.gmlan_scanner.GMLAN_WDBIEnumerator[source]

Bases: scapy.contrib.automotive.gm.gmlan_scanner.GMLAN_Enumerator

execute(socket: Union[scapy.supersocket.SuperSocket, scapy.utils.SingleConversationSocket], state: scapy.contrib.automotive.ecu.EcuState, **kwargs: Any) None[source]
Parameters
  • timeout (integer or float) – Timeout until a response will arrive after a request

  • execution_time (int) – Time in seconds until the execution of this enumerator is stopped.

  • state_allow_list (EcuState or list) – List of EcuState objects or EcuState object in which the the execution of this enumerator is allowed. If provided, other states will not be executed.

  • state_block_list (EcuState or list) – List of EcuState objects or EcuState object in which the the execution of this enumerator is blocked.

  • retry_if_none_received (bool) – Specifies if a request will be send again, if None was received (usually because of a timeout).

  • exit_if_no_answer_received (bool) – Specifies to finish the execution of this enumerator once None is received.

  • exit_if_service_not_supported (bool) – Specifies to finish the execution of this enumerator, once the negative return code ‘serviceNotSupported’ is received.

  • exit_scan_on_first_negative_response (bool) – Specifies to finish the execution once a negative response is received.

  • retry_if_busy_returncode (bool) – Specifies to retry a request, if the ‘busyRepeatRequest’ negative response code is received.

  • debug (bool) – Enables debug functions during execute.

  • scan_range (list or tuple or range or iterable) – Specifies the identifiers to be scanned.

  • rdbi_enumerator (GMLAN_RDBIEnumerator) – Specifies an instance of a GMLAN_RDBIEnumerator which is used to extract possible data identifiers.

class scapy.contrib.automotive.gm.gmlan_scanner.GMLAN_WDBISelectiveEnumerator[source]

Bases: scapy.contrib.automotive.scanner.staged_test_case.StagedAutomotiveTestCase