Skip to content
This repository was archived by the owner on Mar 29, 2022. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions demo/demo_primary.py
Original file line number Diff line number Diff line change
Expand Up @@ -659,6 +659,29 @@ def listen():



def ATTACK_corrupt_the_manifest_of_secondary():
"""
Attack: MITM w/o key modifies secondary ECU manifest.
Modify the ECU manifest without updating the signature.
"""

import copy

# Copy the most recent signed ecu manifest sent by the seconday,
# then modify it and add it back to the list of ecu manifets.
corrupt_signed_manifest = copy.copy(primary_ecu.ecu_manifests['TCUdemocar'][-1])
corrupt_signed_manifest['signed']['attacks_detected'] += 'Everything is great, I PROMISE!'
primary_ecu.ecu_manifests['TCUdemocar'].append(corrupt_signed_manifest)

print(YELLOW + 'ATTACK: Corrupted Secondary Manifest (bad signature):' + ENDCOLORS)
print(' Modified the signed manifest of a Secondary as a MITM, simply changing a value:')
print(' The attacks_detected field now reads "' + RED +
repr(corrupt_signed_manifest['signed']['attacks_detected']) + ENDCOLORS)





def clean_up_temp_file(filename):
"""
Deletes the pinned file and temp directory created by the demo
Expand Down