File tree 6 files changed +28
-0
lines changed
6 files changed +28
-0
lines changed Original file line number Diff line number Diff line change
1
+ # This script bridges two CAN interfaces, so that anything received on one is
2
+ # sent on the other, and vice-versa.
3
+
1
4
from __future__ import print_function
2
5
import sys
3
6
import can
Original file line number Diff line number Diff line change
1
+ # This ugly python script is designed to scan the OBD2 / UDS range looking for
2
+ # things the board responds to. It includes a list of standard packets that the
3
+ # board already randomly emits, so we can filter those out.
4
+
1
5
from __future__ import print_function
2
6
import sys
3
7
import can
Original file line number Diff line number Diff line change
1
+ # This is the seed->key function that the board uses to determine if we're
2
+ # allowed security access. I transcribed this in case we needed to get it right
3
+ # on the first try. Turns out to have been wasted effort.
4
+
1
5
def nswap (c ):
2
6
return (c >> 4 ) | (c << 4 & 0xf0 )
3
7
Original file line number Diff line number Diff line change @@ -499,6 +499,14 @@ Examples:
499
499
- possibly it tracks number of attempts and you'd need to reset if exceeded
500
500
501
501
What we have might be a custom variant
502
+ ### Online References
503
+ https://hackaday.com/2013/10/29/can-hacking-protocols/
504
+ - service ids
505
+ - CAN frame format
506
+ https://automotiveembeddedsite.wordpress.com/uds/
507
+ - more details
508
+ https://en.wikipedia.org/wiki/ISO_15765-2
509
+ - correct framing rules
502
510
503
511
## Can Setup
504
512
ip link show dev can0
Original file line number Diff line number Diff line change
1
+ # This code is to dump a section of firmware, assuming we already have security
2
+ # access. It's "good enough" code, I'm sure I could have refined it, but there
3
+ # wasn't any need. Re-running it until I happened to get clean "uploads" was
4
+ # good enough.
5
+
1
6
from __future__ import print_function
2
7
import sys
3
8
import can
Original file line number Diff line number Diff line change
1
+ # This script enabled "Security Access" to the chosen AID. The original version
2
+ # brute-forced the key space, but post-dump, I changed it to compute the
3
+ # correct response on the first try.
4
+
1
5
from __future__ import print_function
2
6
import sys
3
7
import can
You can’t perform that action at this time.
0 commit comments