Code Monkey home page Code Monkey logo

meltdown_attack_lab-learning's Introduction

Meltdown_Attack_Lab-Learning

Continue To Update…

Share the process of the Meltdown_Attack_Lab

Welcome to exchange and discuss!!

Experimental environment

  • CPU : Intel 6700
  • OS : Ubuntu 16.04

Task 1: Reading from Cache versus from Memory

About CacheTime.c

  • purpose : To show the difference between reading data from the cache and reading data from memory.

  • Steps:

    • Type the following in the terminal to compile
    $ gcc -march=native -o CacheTime CacheTime.c
    • Run the compiled file
    $ ./CacheTime

We can see the consequence

Access time for array[0*4096]: 466 CPU cycles
Access time for array[1*4096]: 502 CPU cycles
Access time for array[2*4096]: 524 CPU cycles
Access time for array[3*4096]: 276 CPU cycles
Access time for array[4*4096]: 522 CPU cycles
Access time for array[5*4096]: 502 CPU cycles
Access time for array[6*4096]: 640 CPU cycles
Access time for array[7*4096]: 252 CPU cycles
Access time for array[8*4096]: 502 CPU cycles
Access time for array[9*4096]: 516 CPU cycles

Task 2: Using Cache as a Side Channel

Use the side channel to extract a secret value used by the victim function.

Method : FLUSH + RELOAD

Steps:

  • FLUSH the entire array from the cache memory to make sure the array is not cached.
  • Invoke the victim function, which accesses one of the array elements based on the value of the secret. This action causes the corresponding array element to be cached.
  • Invoke the victim function, which accesses one of the array elements based on the value of the secret. This action causes the corresponding array element to be cached.

image-20230401102338499

Diagram depicting the Side Channel Attack

About FLUSH + RELOADc

  • Compile & Run
$ gcc -march=native -o FlushReload FlushReload.c
$ sudo ./FlushReload
  • Consequence
array[94*4096 + 1024] is cache.
The Secret = 94
  • Notice : It should be noted that the technique is not 100 percent accurate, and you may not be able to observe the expected output all the time.

I have tried 20 times and just 10 times show me the secret correctly.

meltdown_attack_lab-learning's People

Contributors

qing-ran avatar

Watchers

 avatar

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.