Secure Programming Dr. X

Slides:



Advertisements
Similar presentations
ROP is Still Dangerous: Breaking Modern Defenses Nicholas Carlini et. al University of California, Berkeley USENIX Security 2014 Presenter: Yue Li Part.
Advertisements

CSc 352 Programming Hygiene Saumya Debray Dept. of Computer Science The University of Arizona, Tucson
Computer Security: Principles and Practice EECS710: Information Security Professor Hossein Saiedian Fall 2014 Chapter 10: Buffer Overflow.
Lecture 16 Buffer Overflow modified from slides of Lawrie Brown.
Principles of Computer Security: CompTIA Security + ® and Beyond, Third Edition © 2012 Principles of Computer Security: CompTIA Security+ ® and Beyond,
CMSC 414 Computer and Network Security Lecture 22 Jonathan Katz.
Part III Counter measures The best defense is proper bounds checking but there are many C/C++ programmers and some are bound to forget  Are there any.
Java.  Java is an object-oriented programming language.  Java is important to us because Android programming uses Java.  However, Java is much more.
Software and Security Buffer Overflow 1.
Teaching Buffer Overflow Ken Williams NC A&T State University.
Teaching Buffer Overflow Ken Williams NC A&T State University.
1 Securing the Net: Where the Holes Are Steven M. Bellovin AT&T Labs – Research
Andrea Bittau, Adam Belay, Ali Mashtizadeh, David Maziéres, Dan Boneh
1 Security and Software Engineering Steven M. Bellovin AT&T Labs – Research
Lecture 16 Buffer Overflow
Buffer Overflow Attacks. Memory plays a key part in many computer system functions. It’s a critical component to many internal operations. From mother.
Safety in the C programming Language Peter Wihl May 26 th, 2005 CS 297 Security and Programming Languages.
A survey of Buffer overflow exploitation on HTC touch mobile phone Advanced Defense Lab CSIE NCU Chih-Wen Ou.
Security Exploiting Overflows. Introduction r See the following link for more info: operating-systems-and-applications-in-
Web Application Access to Databases. Logistics Test 2: May 1 st (24 hours) Extra office hours: Friday 2:30 – 4:00 pm Tuesday May 5 th – you can review.
Lecture 6: Buffer Overflow CS 436/636/736 Spring 2014 Nitesh Saxena *Adopted from a previous lecture by Aleph One (Smashing the Stack for Fun and Profit)
Exploitation: Buffer Overflow, SQL injection, Adobe files Source:
Computer Security and Penetration Testing
3-Protecting Systems Dr. John P. Abraham Professor UTPA.
Attacking Applications: SQL Injection & Buffer Overflows.
Buffer Overflows : An In-depth Analysis. Introduction Buffer overflows were understood as early as 1972 The legendary Morris Worm made use of a Buffer.
Mitigation of Buffer Overflow Attacks
Lecture slides prepared for “Computer Security: Principles and Practice”, 3/e, by William Stallings and Lawrie Brown, Chapter 10 “Buffer Overflow”.
CNIT 127: Exploit Development Ch 4: Introduction to Format String Bugs.
Problem of the Day  Why are manhole covers round?
Lecture 8: Buffer Overflow CS 436/636/736 Spring 2013 Nitesh Saxena *Adopted from a previous lecture by Aleph One (Smashing the Stack for Fun and Profit)
Buffer Overflow Group 7Group 8 Nathaniel CrowellDerek Edwards Punna ChalasaniAxel Abellard Steven Studniarz.
Information Leaks Without Memory Disclosures: Remote Side Channel Attacks on Diversified Code Jeff Seibert, Hamed Okhravi, and Eric Söderström Presented.
Lecture 13 Page 1 CS 236 Online Major Problem Areas for Secure Programming Certain areas of programming have proven to be particularly prone to problems.
Group 9. Exploiting Software The exploitation of software is one of the main ways that a users computer can be broken into. It involves exploiting the.
Foundations of Network and Computer Security J J ohn Black CSCI 6268/TLEN 5550, Spring 2013.
Security Attacks Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.
Slides by Kent Seamons and Tim van der Horst Last Updated: Nov 11, 2011.
1988 Morris Worm … estimated 10% penetration 2001 Code Red … 300,00 computers breached 2003 Slammer/Sapphire … 75,00 infections in 10 min Zotob …
VM: Chapter 7 Buffer Overflows. csci5233 computer security & integrity (VM: Ch. 7) 2 Outline Impact of buffer overflows What is a buffer overflow? Types.
Buffer Overflows: Attacks and Defenses for the Vulnerability of the Decade Crispin Cowan SANS 2000.
@Yuan Xue Worm Attack Yuan Xue Fall 2012.
Lecture 5 Page 1 CS 111 Summer 2013 Bounded Buffers A higher level abstraction than shared domains or simple messages But not quite as high level as RPC.
Shellcode COSC 480 Presentation Alison Buben.
Major Problem Areas for Secure Programming
Buffer Overflow By Collin Donaldson.
Mitigation against Buffer Overflow Attacks
Buffer Overflow Buffer overflows are possible because C doesn’t check array boundaries Buffer overflows are dangerous because buffers for user input are.
Sabrina Wilkes-Morris CSCE 548 Student Presentation
Protecting Memory What is there to protect in memory?
Buffer Overflow Defenses
Introduction to Information Security
The Hardware/Software Interface CSE351 Winter 2013
Types for Programs and Proofs
Protecting Memory What is there to protect in memory?
Secure Programming Dr. X
Protecting Memory What is there to protect in memory?
Choosing Technologies
CSC 495/583 Topics of Software Security Stack Overflows (2)
Secure Software Development: Theory and Practice
CMSC 414 Computer and Network Security Lecture 21
CS 465 Buffer Overflow Slides by Kent Seamons and Tim van der Horst
Software Security Lesson Introduction
Lecture 9: Buffer Overflow*
Buffer Overflow Defenses
Buffer Overflows.
CS5123 Software Validation and Quality Assurance
Buffer Overflow Slide Set #7 Textbook Chapter 10 Clicker Questions
Understanding and Preventing Buffer Overflow Attacks in Unix
Outline Introduction Memory protection Buffer overflows
Presentation transcript:

Secure Programming Dr. X Slides adopted from Dr. Steven Bellovin, Columbia University

Outline One last presentation for project update Questions on today’s lab – SQL injection, XSS Buffer overflow SigFree - Louis Secure programming

“If our software is buggy, what does that say about its security?” —Robert H. Morris, creator of the Morris worm

It’s all about the software Most penetrations are due to buggy software Crypto won’t help there: bad software defeats good crypto Design matters, too

Security isn’t about Cryptography Cryptography is necessary (and we’ll talk about it) But it’s possible for cryptographic software to have bugs, too In one recent study, 80% of mobile apps had problems with their cryptography

Three separate aspects Enforcing security Avoiding bugs Proper components and proper composition

Avoiding bugs Many simple bugs can be exploited to cause security problems (The C language is a large part of the problem) Much of the trouble is compounded by poor specifications

Buffer overflows Once responsible for about half of all security vulnerabilities; still a serious problem Fundamental problems: – Character strings in C are actually arrays of chars – There is no array bounds checking done in C Attacker’s goal: overflow the array in a controlled fashion

How can such things happen? C has lots of built-in functions that don’t check array bounds Programmers frequently don’t check, either The attacker supplies too-long input

Java vs. C Java checks array bounds C# checks array bounds Go checks array bounds More or less everything but C and C++ check. . .

ASLR: Address Space Layout Randomization Put stack at different random location each time program is executed Put heap at different random location as well Defeats attempts to address known locations But—makes debugging harder

Non-executable data areas Modern computer architectures have permission bits for memory pages: can only execute code if the “execute” bit is set Defense: on pages with the “write” bit set, don’t set “execute” The stack is writable, so code injected by the attacker won’t be executable Called “DEP” (Data Execution Prevention) or “W ⊕X”

Checking code Look for suspect calls Use static checkers Use language feature like Perl’s “taint” mode

Stack vs Heap Easiest to exploit if the buffer is on the stack Exploits for heap buffers are also possible, though they’re harder

Issues for the attacker Finding vulnerable programs NUL bytes Uncertainty about addresses

Finding vulnerable programs Use nm and grep to spot use of dangerous routines Probe via very-long inputs Look at source or disassembed/decompiled code

NUL Bytes C strings can’t have embedded 0 bytes Some instructions do have 0 bytes, perhaps as part of an operand Solution: use different instruction sequence

Address Uncertainty Pad the evil instructions with NOPs This is called a landing zone or a NOP sled Set the return address to anywhere in the landing zone

Buffer overflow summary You must check buffer lengths Where you can, use the safer library functions Write your own safe string library (there’s no commonly-available standard) Use C++ and class String Use Java Use anything but raw C!

Heap overflow Code execution Memory may be affected Phone jailbreaking Heap is dynamic Prevention: Sanity checks on heap Randomization Prevent execution Sources on heap overflow https://www.owasp.org/index.php/Testing_for_Heap_Overflow https://security.stackexchange.com/questions/67075/vulnerability-exploitation-in- java

Sources for secure coding OWASP Security by design: https://www.owasp.org/index.php/Security_by_Design_Principles https://www.owasp.org/images/0/08/OWASP_SCP_Quick_Reference _Guide_v2.pdf