Coder Social home page Coder Social logo

rhelmke / cant Goto Github PK

View Code? Open in Web Editor NEW
7.0 3.0 2.0 121 KB

On-the-fly manipulation of CAN/ISOBUS frames, for science!

Home Page: http://sys.cs.uos.de/cant/index.shtml

License: BSD 3-Clause "New" or "Revised" License

Go 100.00%
cant can controller area network isobus car vehicle tractor security privacy sciency university osnabrueck golang server cryptocan proxy mitm

cant's Introduction

CAN't

Go Report Card

CAN't is a multithreaded privacy proxy server for ISO-11898 Controller Area Networks that is mainly targeted at ISOBUS applications. Its purpose is to selectively block, perturbate, or round privacy sensitive data transmitted via CAN. The software can easily be configured using an HTML5 web interface. Implementation details and the motivation behind this project can be found in:

J. Bauer, R. Helmke, A. Bothe, and N. Aschenbruck, “CAN’t track us: Adaptable Privacy for ISOBUS Controller Area Networks”, Elsevier Computer Standards and Interfaces, 2019.

Concept, implementation, and evaluation were topic of a bachelor's thesis at the Distributed Systems Group, University of Osnabrück:

R. Helmke, “Konzeptionierung und Implementierung eines Proxys für erhöhten Datenschutz in Controller Area Networks“, 2018, supervised by: Prof. Dr. Nils Aschenbruck, Prof. Dr. Michael Brinkmeier.

Dependencies

  • GOOS=linux GOARCH=amd64
  • Golang (>=1.13)
  • go-bindata (go get -u github.com/jteeuwen/go-bindata/...)
  • MariaDB (apt install mysql-server)
  • npm/yarn
  • SocketCAN
  • Packages: See go.mod

Build

Make sure your CXX and CC variables are properly set:

export CXX=clang++ # or whatever you fancy
export CC=clang # or whatever you fancy

Then build the project:

git clone --recursive https://github.com/rhelmke/cant.git
cd cant
go generate # execute yarn and go-bindata to generate the webinterface
go build cant

General Synopsis

Usage:
  cant [command]

Available Commands:
  help        Help about any command
  run         run the main components
  seed        Seed the database
  setup       Interactive cant setup
  version     Print version

Flags:
  -h, --help   help for cant

Use "cant [command] --help" for more information about a command.
Usage:
  cant run [command]

Available Commands:
  proxy       run the proxy component

Flags:
  -h, --help   help for run

Use "cant run [command] --help" for more information about a command.

Manual Setup

Database

apt install mysql-server # install mariadb on debian or ubuntu
mysql -uroot -p # login to mariadb and create empty database + user
mysql> create database cant;
mysql> create user 'cant'@'localhost' identified by '<PASSWORD>';
mysql> grant all privileges on cant.* to 'cant'@'localhost';
mysql> exit

CAN Interface

CAN't needs two interfaces in order to work as man-in-the-middle between ECUs. For testing purposes, you might want to create two virtual interfaces. To do so, add following lines /etc/network/interfaces:

auto vcan0
iface vcan0 inet manual
    bitrate 250000 # ISOBUS uses a nominal bitrate of 250kbit/s
    pre-up /sbin/ip link add dev $IFACE type vcan
    post-up /sbin/ip link set $IFACE txqueuelen 1000

auto vcan1
iface vcan1 inet manual
    bitrate 250000 # ISOBUS uses a nominal bitrate of 250kbit/s
    pre-up /sbin/ip link add dev $IFACE type vcan
    post-up /sbin/ip link set $IFACE txqueuelen 1000

Also, be sure that you loaded all needed kernel modules:

modprobe can
modprobe vcan

You can then execute ifup vcan0 or ifup vcan1 to bring the interfaces up. You can read and write data using the can-utils package from your OS's repositories.

Seeding

  1. Make sure you did everything explained in Section "Database" and "CAN Interfaces".
  2. ./cant setup, this will guide you through a cli-based installation routine. You need a properly functioning MariaDB containing an empty database for CAN't.
  3. ./cant seed -f <pgn and spn data>.csv -t spnpgn, this will seed the database with all known PGN's and SPN's.
  4. ./cant seed -t filter, this will inject all implemented and compiled filters into the database.

Where to get SPN and PGN Data

The VDMA maintains a growing list of known PGN's and SPN's. Please use the csv-formatted database dump and extract SPNs and PGNs.csv. This file can be used to seed the database during setup.

Run the proxy

./cant run proxy

The proxy will expose its webinterface to a port (default: 8080) configured during setup.

[IMPORTANT] Security

This software is considered as proof of concept.

As this project originated from a bachelor's thesis with CAN privacy as its main topic, neither encryption nor secure API-Endpoints have been developed and planned as future work. At this point, it is highly discouraged to use the proxy in production or expose it to the internet.

cant's People

Contributors

rhelmke avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

firyuen lequibao

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.