Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 70cff4f
Showing
18 changed files
with
8,587 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
CC=gcc | ||
CFLAGS=-I/usr/include/SDL2 | ||
LDFLAGS=-lSDL2 -lSDL2_image | ||
|
||
all: icsim controls | ||
|
||
icsim: icsim.o lib.o | ||
$(CC) $(CFLAGS) -o icsim icsim.c lib.o $(LDFLAGS) | ||
|
||
controls: controls.o | ||
$(CC) $(CFLAGS) -o controls controls.c $(LDFLAGS) | ||
|
||
lib.o: | ||
$(CC) lib.c | ||
|
||
clean: | ||
rm -rf icsim controls icsim.o controls.o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
Instrument Cluster Simulator for SocketCAN | ||
------------------------------------------ | ||
|
||
By: OpenGarages <agent.craig@gmail.com> | ||
|
||
Compiling | ||
--------- | ||
You will need SDL2 and SDL2_Image | ||
you will also need can-utils https://git.gitorious.org/linux-can/can-utils.git | ||
This is mainly just used for the canplayer app to play background can messages | ||
|
||
Testing on a virtual CAN interface | ||
---------------------------------- | ||
You can run the following commands to setup a virtual can interface | ||
|
||
sudo modprobe can | ||
sudo modprobe vcan | ||
sudo ip link add dev vcan0 type vcan | ||
sudo ip link set up vcan0 | ||
|
||
If you type ifconfig vcan0 you should see a vcan0 interface. A setup_vcan.sh file has also been provided with this | ||
repo. | ||
|
||
Usage | ||
----- | ||
Default operations: | ||
|
||
Start the Instrument Cluster (IC) simulator: | ||
|
||
./icsim vcan0 | ||
|
||
Then startup the controls | ||
|
||
./controls vcan0 | ||
|
||
The hard coded defaults should be in sync and the controls should control the IC. Ideally use a controller similar to | ||
an XBox controller to interact with the controls interface. The controls app will generate corrosponding CAN packets | ||
based on the buttons you press. The IC Sim sniffs the CAN and looks for relevant CAN packets that would change the | ||
display. | ||
|
||
CAN Hacking Training Usage | ||
-------------------------- | ||
To *safely* train on CAN hacking you can play back a sample recording included in this repo of generic CAN traffic. This will | ||
create something similar to normal CAN "noise". Then start the IC Sim with the -r (randomize) switch. | ||
|
||
./icsim -r vcan0 | ||
Using CAN interface vcan0 | ||
Seed: 1401717026 | ||
|
||
Now copy the seed number and paste it as the -s (seed) option for the controls. | ||
|
||
./controls -s 1401717026 vcan0 | ||
|
||
This will randomize what CAN packets the IC needs and by passing the seed to the controls they will sync. Randomizing | ||
changes the arbitration IDs as well as the byte position of the packets used. This will give you experience in hunting down | ||
different types of CAN packets on the CAN Bus. | ||
|
||
For the most realistic training you can change the difficulty levels. Set the difficulty to 2 with the controls: | ||
|
||
./controls -s 1401717026 -l 2 vcan0 | ||
|
||
This will add additional randomization to the target packets, simulating other data stored in the same arbitration id. | ||
|
Oops, something went wrong.