ECE 471 Embedded Systems Lecture 22

Similar documents
(Early) Memory Corruption Attacks

Secure Coding Techniques

Advanced Systems Security: Ordinary Operating Systems

Buffer Overflows. A brief Introduction to the detection and prevention of buffer overflows for intermediate programmers.

Secure Software Development: Theory and Practice

20: Exploits and Containment

I run a Linux server, so we re secure

Software Security II: Memory Errors - Attacks & Defenses

Privilege Escalation

Hackveda Training - Ethical Hacking, Networking & Security

ECE 598 Advanced Operating Systems Lecture 12

CSE 565 Computer Security Fall 2018

CSCE 548 Building Secure Software Buffer Overflow. Professor Lisa Luo Spring 2018

ECE 571 Advanced Microprocessor-Based Design Lecture 12

Applications. Cloud. See voting example (DC Internet voting pilot) Select * from userinfo WHERE id = %%% (variable)

Beyond Stack Smashing: Recent Advances in Exploiting. Jonathan Pincus(MSR) and Brandon Baker (MS)

4. Jump to *RA 4. StackGuard 5. Execute code 5. Instruction Set Randomization 6. Make system call 6. System call Randomization

CIS 551 / TCOM 401 Computer and Network Security. Spring 2007 Lecture 2

Outline. Classic races: files in /tmp. Race conditions. TOCTTOU example. TOCTTOU gaps. Vulnerabilities in OS interaction

CSE 509: Computer Security

Lecture 08 Control-flow Hijacking Defenses

Department of Electrical Engineering and Computer Science MASSACHUSETTS INSTITUTE OF TECHNOLOGY Fall Quiz I Solutions

Confinement (Running Untrusted Programs)

Lecture Notes for 04/04/06: UNTRUSTED CODE Fatima Zarinni.

Cyber Moving Targets. Yashar Dehkan Asl

ECE 598 Advanced Operating Systems Lecture 10

Linux Memory Layout. Lecture 6B Machine-Level Programming V: Miscellaneous Topics. Linux Memory Allocation. Text & Stack Example. Topics.

Computer Security. 04r. Pre-exam 1 Concept Review. Paul Krzyzanowski. Rutgers University. Spring 2018

ECE 471 Embedded Systems Lecture 12

Security and Privacy in Computer Systems. Lecture 5: Application Program Security

ECE 598 Advanced Operating Systems Lecture 14

Other array problems. Integer overflow. Outline. Integer overflow example. Signed and unsigned

Language Security. Lecture 40

Lab 2: Buffer Overflows

ECE 498 Linux Assembly Language Lecture 1

One-Slide Summary. Lecture Outline. Language Security

1.1 For Fun and Profit. 1.2 Common Techniques. My Preferred Techniques

ECE 471 Embedded Systems Lecture 12

Università Ca Foscari Venezia

ECE 435 Network Engineering Lecture 23

CMSC 414 Computer and Network Security

ECE 471 Embedded Systems Lecture 4

Lecture 4 September Required reading materials for this class

Survey of Cyber Moving Targets. Presented By Sharani Sankaran

CMPSC 497 Buffer Overflow Vulnerabilities

Play with FILE Structure Yet Another Binary Exploitation Technique. Abstract

First order of Business

Buffer Overflows Defending against arbitrary code insertion and execution

Security-Aware Processor Architecture Design. CS 6501 Fall 2018 Ashish Venkat

Basic Buffer Overflows

Module: Program Vulnerabilities. Professor Trent Jaeger. CSE543 - Introduction to Computer and Network Security

Lecture 10. Pointless Tainting? Evaluating the Practicality of Pointer Tainting. Asia Slowinska, Herbert Bos. Advanced Operating Systems

Module: Program Vulnerabilities. Professor Trent Jaeger. CSE543 - Introduction to Computer and Network Security

We will focus on Buffer overflow attacks SQL injections. See book for other examples

Spectre and Meltdown. Clifford Wolf q/talk

CSE 565 Computer Security Fall 2018

Software Vulnerabilities. Jeff Foster University of Maryland, College Park

Sandboxing Untrusted Code: Software-Based Fault Isolation (SFI)

ECE 571 Advanced Microprocessor-Based Design Lecture 13

Buffer Overflow Vulnerability

ECE 471 Embedded Systems Lecture 16

Buffer overflows (a security interlude) Address space layout the stack discipline + C's lack of bounds-checking HUGE PROBLEM

Reserve Engineering & Buffer Overflow Attacks. Tom Chothia Computer Security, Lecture 17

SoK: Eternal War in Memory

BUFFER OVERFLOW. Jo, Heeseung

Buffer Overflow. Jo, Heeseung

Shellbased Wargaming

CS 161 Computer Security

ECE 598 Advanced Operating Systems Lecture 10

How to Break Software by James Whittaker

The Protocols that run the Internet

Week 5, continued. This is CS50. Harvard University. Fall Cheng Gong

Lecture 1: Buffer Overflows

Shellcode Analysis. Chapter 19

Buffer Overflow. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

New York University CSCI-UA : Advanced Computer Systems: Spring 2016 Midterm Exam

Simple Overflow. #include <stdio.h> int main(void){ unsigned int num = 0xffffffff;

CSci 4061 Introduction to Operating Systems. Programs in C/Unix

Meltdown and Spectre - understanding and mitigating the threats (Part Deux)

Dynamic Storage Allocation

2 Sadeghi, Davi TU Darmstadt 2012 Secure, Trusted, and Trustworthy Computing Chapter 6: Runtime Attacks

Hacking Blind BROP. Presented by: Brooke Stinnett. Article written by: Andrea Bittau, Adam Belay, Ali Mashtizadeh, David Mazie`res, Dan Boneh

ECE 598 Advanced Operating Systems Lecture 23

Buffer Overflow. Jinkyu Jeong Computer Systems Laboratory Sungkyunkwan University

Advanced Systems Security: Ordinary Operating Systems

Buffer overflow background

Why bother? Default configurations Buffer overflows Authentication mechanisms Reverse engineering Questions?

ECE 471 Embedded Systems Lecture 16

CompTIA Security+ Malware. Threats and Vulnerabilities Vulnerability Management

ECE 435 Network Engineering Lecture 23

Fundamentals of Linux Platform Security

Infecting the Embedded Supply Chain

Sandboxing. CS-576 Systems Security Instructor: Georgios Portokalidis Spring 2018

Secure Programming I. Steven M. Bellovin September 28,

Lecture 9: Buffer Overflow* CS 392/6813: Computer Security Fall Nitesh Saxena

Lecture 09 Code reuse attacks. Stephen Checkoway University of Illinois at Chicago CS 487 Fall 2017

Buffer Overflow. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

Why bother? Default configurations Buffer overflows Authentication mechanisms Reverse engineering Questions?

Spectre, Meltdown, and the Impact of Security Vulnerabilities on your IT Environment. Orin Jeff Melnick

ECE 471 Embedded Systems Lecture 6

Transcription:

ECE 471 Embedded Systems Lecture 22 Vince Weaver http://www.eece.maine.edu/~vweaver vincent.weaver@maine.edu 31 October 2018

Don t forget HW#7 Announcements 1

Computer Security and why it matters for embedded systems Most effective security is being unconnected from the world and locked away in a box. Until recently most embedded systems matched that. Modern embedded systems are increasingly connected to networks, etc. Embedded code is not necessarily prepared for this. Internet of Things 2

The Problem Untrusted inputs from user can be hostile. Users with physical access can bypass most software security. 3

Fun / Mischief Profit What can an attacker gain? A network of servers that can be used for illicit purposes (SPAM, Warez, DDOS) Spying on others (companies, governments, etc) 4

Sources of Attack Untrusted user input Web page forms Keyboard Input USB Keys (CD-ROMs) Autorun/Autostart on Windows Scatter usb keys around parking lot, helpful people plug into machine. Network 5

cellphone modems ethernet/internet wireless/bluetooth Backdoors Debugging or Malicious, left in place Brute Force trying all possible usernames/passwords 6

Types of Compromise Crash ping of death DoS (Denial of Service) User account compromise Root account compromise Privilege Escalation 7

Rootkit Re-write firmware? VM? Above OS? 8

Unsanitized Inputs Using values from users directly can be a problem if passed directly to another process If data (say from a web-form) directly passed to a UNIX shell script, then by including characters like ; can issue arbitrary commands: system("rm %s\n",userdata); SQL injection attacks; escape characters can turn a command into two, letting user execute arbitrary SQL commands; xkcd Robert ); DROP TABLE Students;-- 9

Buffer Overflows User (accidentally or on purpose) copies too much data into a fixed sized buffer. Data outside expected area gets over-written. This can cause a crash (best case) or if user carefully constructs code, can lead to user taking over program. 10

Buffer Overflow Example void function ( int * values, int size ) { int a [10] ; memcpy (a,values, size ); } return ; Maps to push {lr} sub sp,#44 memcpy add sp,#44 pop {pc} 11

link register Stack pointer before entry a[9] a[8] a[7] a[6] a[5] a[4] a[3] a[2] a[1] a[0] Stack pointer after prolog A value written to a[11] overwrites the saved link register. If you can put a pointer to a function of your choice there you can hijack the code execution, as it will be jumped to at function exit. 12

Mitigating Buffer Overflows Extra Bounds Checking / High-level Language (not C) Address Space Layout Randomization Putting lots of 0s in code (if strcpy is causing the problem) Running in a sandbox 13

Dangling Pointer / Null Pointer Dereference Typically a NULL pointer access generates a segfault If an un-initialized function pointer points there, and gets called, it will crash. But until recently Linux allowed users to mmap() code there, allowing exploits. Other dangling pointers (pointers to invalid addresses) can also cause problems. Both writes and executions can cause problems if the address pointed to can be mapped. 14

Privilege Escalation If you can get kernel or super-user (root) code to jump to your code, then you can raise privileges and have a root exploit If a kernel has a buffer-overrun or other type of error and branches to code you control, all bets are off. You can have what is called shell code generate a root shell. Some binaries are setuid. They run with root privilege but drop them. If you can make them run your code 15

before dropping privilege you can also have a root exploit. Tools such as ping (requires root to open raw socket), X11 (needs root to access graphics cards), web-server (needs root to open port 80). 16

Information Leakage Can leak info through side-channels Detect encryption key by how long other processes take? Power supply fluctuations? RF noise? Timing attacks Meltdown and Spectre 17

Finding Bugs Source code inspection Watching mailing lists Static checkers (coverity, sparse) Dynamic checkers (Valgrind). Can be slow. Fuzzing 18