Giter VIP home page Giter VIP logo

defense-adversarial-in-ml-can-ids's Introduction

Defense-Adversarial-in-ML-CAN-IDS

Carla command

  1. One terminal for pythonAPI
make PythonAPI
  1. Another terminal for Carla server
make launch
  1. It will pop up an CarlaUE4 Engine Windows, then press “Launch” and “Play”.
  2. autopilot 不能用 while 收data client 會crash
  3. 用 buffer 收一樣會經過幾次attack 後crash
  4. SteerRightmax {0000014A#F3A8000000F3A801] 最後一個bit應為0, 用來label 為attack msg 使用(training 記得改回來)

CAN IDS Implementation

CAN IDS Training Result Record

  1. Real traffic not only ML f1-score
    1. method 1: save traffic log as an input file
    2. method 2: directly dump the traffic
model.predict(np.array(row.loc[$which row][element with feature].reshape(1,-1)
  1. Carla ECU ID
    1. Throttle → 0x1F5 → 501
    2. Steering → 0x14A → 330
    3. Brake → 0x1E7→ 487
    4. Gear → 0x191 → 401
    5. Speed → 0x309 → 777
  2. 要做Binary Classification or Multinomial Classification ?
    1. Jehoshua → Binary
    2. Multinomial → DoS, Spoofing, Replay
    3. 嘗試Spoofing 變成Binary dataset → GOOD
  3. Replay attack 如何Implement
  4. Using Models
    1. Decision Tree
    2. Logistic Regression
    3. XGB
    4. SVM
    5. KNN
    6. DNN
    7. CNN
    8. Random Forest
  5. 有需要做cross validation?

CAN IDS Dataset

  1. Dataset contain 5 ECU but only inject Throttle,Steering,Brake regard as attack msg.

  2. Gear, Speed regard as background noise

    # of Inject msgs

    1. Throttle → 9912(label:1)
    2. Steering → 2400(right,label:4) & 36999(left,label:2)
    3. Brake → 30000(label:3)

CAN bus command

  1. Create a virtual can

    sudo modprobe vcan
    sudo ip link add dev vcan0 type vcan
    sudo ip link set up vcan0
  2. can-utils

    • Install can-utils on Linux
    $sudo apt-get install can-utils
    • Dump msg on vcan0
    $candump vcan0
    • Dump msg on vcan0 to log file
    $candump vcan0 -l
    • Dump msg on vcan0 and decode it
    $candump vcan0 | cantools decode "dbc file"
    • Replay the log file
    $canplayer -I "file.log"
    • Send CA Message
    $cansend can0 123#1122334455667788
    • See the Bus state
    $ip -details -statistics link show vcan0
  3. cantools

defense-adversarial-in-ml-can-ids's People

Contributors

maxwang1104 avatar

Stargazers

 avatar  avatar

Forkers

sensewithyou

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.