Skip to content

This repo is used as documentation for my CAN Arsenal addition in NetHunter apk.

Notifications You must be signed in to change notification settings

V0lk3n/NetHunter-CANArsenal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

NetHunter-CANArsenal

This repo is used as documentation for my CAN Arsenal addition in NetHunter apk.

Description

This module allow you to control your CAN Interface and diagnostic your car with can-utils and cannelloni tools. Device should have CAN, SLCAN, VCAN, CAN-RAW, CAN-GW, CAN-BCM enabled as module in the kernel, optionally enable USB_SERIAL_CH341 and CAN USB Interfaces Drivers too.

Prerequisite - Kernel Modification

TODO

CAN Arsenal Module Documentation

Menu

menu

Documentation

This button will open the following documentation in a Browser.

Setup

This button will run Setup to install needed CAN tools and packages. Note that it shouldn't be needed as it should be launched as first run.

Update

This button will update the installed CAN tools and packages.

Settings

menu

These settings are needed to be used as variable while running commands with the buttons interaction.

Modules

menu

If these USB Modules drivers are enabled in your Kernel. You can use the dropdown to select the desired module, and press the button to load it (if unloaded) or to unload it (if loaded).

Note : Full path of modules should be specified in the Modules tab of the Nethunter App.

Interface

menu

Here you can Start or Stop CAN, VCAN or SLCAN interface.

CAN

Command run to Start CAN :

Prerequisite : Set "CAN Interface" and "UART Speed" in Settings

modprobe -a can can-raw can-gw can-bcm
sudo ip link set <CAN Interface> type can bitrate <UART Speed>
sudo ip link set up <CAN Interface>

Command run to Stop CAN interface :

Prerequisite : Set "CAN Interface" in Settings

modprobe -r can-raw can-gw can-bcm can
sudo ip link set <CAN Interface> down

VCAN

Command run to Start VCAN :

Prerequisite : Set "CAN Interface" and "MTU" in Settings

modprobe -a vcan can can-raw can-gw can-bcm
ip link add dev <CAN Interface> type vcan && ip link set <CAN Interface> mtu <MTU>
ip link set up <CAN Interface>

Command run to Stop VCAN interface :

Prerequisite : Set "CAN Interface" in Settings

modprobe -r can-raw can-gw can-bcm vcan can
sudo ip link set <CAN Interface> down 

SLCAN

Command run to Start SLCAN :

Prerequisite : CAN USB Adapter plugged in and set "CAN Interface", "CAN Speed" and "UART Speed" in Settings Note : Flow Control is set to Software as default

modprobe -a can slcan can-raw can-gw can-bcm
sudo slcan_attach -f -s<CAN Speed> -o /dev/ttyUSB0
sudo slcand -o -s<CAN Speed> -t sw -S <UART Speed> /dev/ttyUSB0 <CAN Interface>
sudo ip link set up <CAN Interface>

Command run to Stop SLAN interface :

Prerequisite : CAN USB Adapter plugged in and set "CAN Interface" in Settings

sudo ip link set <CAN Interface> down
sudo slcan_attach -d /dev/ttyUSB0
modprobe -r can-raw can-gw can-bcm can slcan

Tools

menu

Can-Utils - CanGen

Command to run CanGen to generate CAN traffic :

Prerequisite : Started your desired CAN interface and set "CAN Interface" in Settings

cangen <CAN Interface> -v

Can-Utils - CanSniffer

Command to run CanSniffer to sniff CAN traffic :

Prerequisite : Started your desired CAN interface and set "CAN Interface" in Settings

cansniffer <CAN Interface>

Can-Utils - CanDump

Command to run CanDump to dump CAN traffic to a file :

Prerequisite : Started your desired CAN interface and set "CAN Interface", "Output" path in Settings

candump <CAN Inteface> -f <Output Log>

Can-Utils - CanSend

Command to run CanSend to replay a specific sequence :

Prerequisite : Started your desired CAN interface and set "CAN Interface", "Sequence" in Settings

cansend <CAN Interface> <Sequence>

Can-Utils - CanPlayer

Command to run CanPlayer to replay dumped sequences in a log file :

Prerequisite : Started your desired CAN interface and set "CAN Interface", "Input" path in Settings

canplayer -I <Input Log>

Custom Script - SequenceFinder

You can see the source code here.

Command to run SequenceFinder to find the exact sequence of the desired action from a log file :

Note : This custom script will auto split a log files using head and tail, replay these in loop using CanPlayer until finding the exact sequence of the desired action and replay it with CanSend.

Prerequisite : Started your desired CAN interface and set "Input" path in Settings

/opt/car_hacking/sequence_finder.sh <Input Log>

Cannelloni

menu

Command to run Cannelloni to communicate with two machine on a CAN interface by Ethernet :

Prerequisite : Started your desired CAN interface in Settings and set "RHOST", "RPORT" and "LPORT" in Cannelloni.

sudo cannelloni -I <CAN Interface> -R <RHOST> -r <RPORT> -l <LPORT>

Logging

menu

Asc2Log

Command to run Asc2Log to convert ASC format file to classic log file :

Prerequisite : Set "Input" and "Output" path in Settings.

asc2log -I <Input Log> -O <Output File>

Log2Asc

Command to run Log2Asc to convert dumped log in the ASC format :

Prerequisite : Set "Input", "Output" path and "CAN Interface" in Settings.

log2asc -I <Input Log> -O <Output File> <CAN Interface>

Custom Command

menu

This is in case you need to run a specific command which doesnt match the one provided.

About

This repo is used as documentation for my CAN Arsenal addition in NetHunter apk.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages