julian cohen [email protected] thotcon 0x2€¦ · linux bugs exist in code anything that...

45
Julian Cohen [email protected] THOTCON 0x2

Upload: others

Post on 16-Jun-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Julian Cohen HockeyInJune@isis.poly.edu THOTCON 0x2€¦ · Linux Bugs exist in code Anything that has attack surface is vulnerable Exploitation cost can be manipulated Make it really

Julian Cohen [email protected]

THOTCON 0x2

Page 2: Julian Cohen HockeyInJune@isis.poly.edu THOTCON 0x2€¦ · Linux Bugs exist in code Anything that has attack surface is vulnerable Exploitation cost can be manipulated Make it really

Julian Cohen [email protected]

THOTCON 0x2

Page 3: Julian Cohen HockeyInJune@isis.poly.edu THOTCON 0x2€¦ · Linux Bugs exist in code Anything that has attack surface is vulnerable Exploitation cost can be manipulated Make it really

Julian Cohen [email protected]

THOTCON 0x2

Page 4: Julian Cohen HockeyInJune@isis.poly.edu THOTCON 0x2€¦ · Linux Bugs exist in code Anything that has attack surface is vulnerable Exploitation cost can be manipulated Make it really

Julian Cohen [email protected]

THOTCON 0x2

Page 5: Julian Cohen HockeyInJune@isis.poly.edu THOTCON 0x2€¦ · Linux Bugs exist in code Anything that has attack surface is vulnerable Exploitation cost can be manipulated Make it really

Capture The Flag competition Application Security Worldwide

http://csawctf.poly.edu/

http://www.poly.edu/csaw

Page 6: Julian Cohen HockeyInJune@isis.poly.edu THOTCON 0x2€¦ · Linux Bugs exist in code Anything that has attack surface is vulnerable Exploitation cost can be manipulated Make it really

Insecure platform Too much attack surface Outdated software We don’t want to get owned!

Page 7: Julian Cohen HockeyInJune@isis.poly.edu THOTCON 0x2€¦ · Linux Bugs exist in code Anything that has attack surface is vulnerable Exploitation cost can be manipulated Make it really

Linux Bugs exist in code Anything that has attack surface is vulnerable Exploitation cost can be manipulated

Page 8: Julian Cohen HockeyInJune@isis.poly.edu THOTCON 0x2€¦ · Linux Bugs exist in code Anything that has attack surface is vulnerable Exploitation cost can be manipulated Make it really

Make it really fucking hard to land an exploit

Page 9: Julian Cohen HockeyInJune@isis.poly.edu THOTCON 0x2€¦ · Linux Bugs exist in code Anything that has attack surface is vulnerable Exploitation cost can be manipulated Make it really

Memory Corruption

Integer Manipulation

Uncontrolled Format String

Memory Mismanagement

Race Condition

Smashing the Stack

Return To Library

Return Oriented Programming

Global Offset Table Overwrite

Use After Free

Page 10: Julian Cohen HockeyInJune@isis.poly.edu THOTCON 0x2€¦ · Linux Bugs exist in code Anything that has attack surface is vulnerable Exploitation cost can be manipulated Make it really
Page 12: Julian Cohen HockeyInJune@isis.poly.edu THOTCON 0x2€¦ · Linux Bugs exist in code Anything that has attack surface is vulnerable Exploitation cost can be manipulated Make it really
Page 13: Julian Cohen HockeyInJune@isis.poly.edu THOTCON 0x2€¦ · Linux Bugs exist in code Anything that has attack surface is vulnerable Exploitation cost can be manipulated Make it really
Page 14: Julian Cohen HockeyInJune@isis.poly.edu THOTCON 0x2€¦ · Linux Bugs exist in code Anything that has attack surface is vulnerable Exploitation cost can be manipulated Make it really
Page 16: Julian Cohen HockeyInJune@isis.poly.edu THOTCON 0x2€¦ · Linux Bugs exist in code Anything that has attack surface is vulnerable Exploitation cost can be manipulated Make it really
Page 17: Julian Cohen HockeyInJune@isis.poly.edu THOTCON 0x2€¦ · Linux Bugs exist in code Anything that has attack surface is vulnerable Exploitation cost can be manipulated Make it really
Page 19: Julian Cohen HockeyInJune@isis.poly.edu THOTCON 0x2€¦ · Linux Bugs exist in code Anything that has attack surface is vulnerable Exploitation cost can be manipulated Make it really
Page 20: Julian Cohen HockeyInJune@isis.poly.edu THOTCON 0x2€¦ · Linux Bugs exist in code Anything that has attack surface is vulnerable Exploitation cost can be manipulated Make it really
Page 21: Julian Cohen HockeyInJune@isis.poly.edu THOTCON 0x2€¦ · Linux Bugs exist in code Anything that has attack surface is vulnerable Exploitation cost can be manipulated Make it really
Page 22: Julian Cohen HockeyInJune@isis.poly.edu THOTCON 0x2€¦ · Linux Bugs exist in code Anything that has attack surface is vulnerable Exploitation cost can be manipulated Make it really

Shared libraries are compiled PIC

-fpic -fPIC -shared

http://gcc.gnu.org/onlinedocs/gcc-4.6.0/gcc/Code-Gen-Options.html#Code-Gen-Options

http://tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html

http://www.gentoo.org/proj/en/hardened/pic-internals.xml

http://www.gentoo.org/proj/en/hardened/pic-guide.xml

Page 23: Julian Cohen HockeyInJune@isis.poly.edu THOTCON 0x2€¦ · Linux Bugs exist in code Anything that has attack surface is vulnerable Exploitation cost can be manipulated Make it really
Page 25: Julian Cohen HockeyInJune@isis.poly.edu THOTCON 0x2€¦ · Linux Bugs exist in code Anything that has attack surface is vulnerable Exploitation cost can be manipulated Make it really
Page 26: Julian Cohen HockeyInJune@isis.poly.edu THOTCON 0x2€¦ · Linux Bugs exist in code Anything that has attack surface is vulnerable Exploitation cost can be manipulated Make it really
Page 27: Julian Cohen HockeyInJune@isis.poly.edu THOTCON 0x2€¦ · Linux Bugs exist in code Anything that has attack surface is vulnerable Exploitation cost can be manipulated Make it really
Page 29: Julian Cohen HockeyInJune@isis.poly.edu THOTCON 0x2€¦ · Linux Bugs exist in code Anything that has attack surface is vulnerable Exploitation cost can be manipulated Make it really
Page 30: Julian Cohen HockeyInJune@isis.poly.edu THOTCON 0x2€¦ · Linux Bugs exist in code Anything that has attack surface is vulnerable Exploitation cost can be manipulated Make it really
Page 31: Julian Cohen HockeyInJune@isis.poly.edu THOTCON 0x2€¦ · Linux Bugs exist in code Anything that has attack surface is vulnerable Exploitation cost can be manipulated Make it really

.got always mapped to same memory location GOT dynamically updated during runtime An attacker can overwrite GOT entries

Page 33: Julian Cohen HockeyInJune@isis.poly.edu THOTCON 0x2€¦ · Linux Bugs exist in code Anything that has attack surface is vulnerable Exploitation cost can be manipulated Make it really
Page 34: Julian Cohen HockeyInJune@isis.poly.edu THOTCON 0x2€¦ · Linux Bugs exist in code Anything that has attack surface is vulnerable Exploitation cost can be manipulated Make it really

grsecurity kernel patch PaX

http://grsecurity.net/

http://pax.grsecurity.net/

Page 35: Julian Cohen HockeyInJune@isis.poly.edu THOTCON 0x2€¦ · Linux Bugs exist in code Anything that has attack surface is vulnerable Exploitation cost can be manipulated Make it really
Page 36: Julian Cohen HockeyInJune@isis.poly.edu THOTCON 0x2€¦ · Linux Bugs exist in code Anything that has attack surface is vulnerable Exploitation cost can be manipulated Make it really
Page 37: Julian Cohen HockeyInJune@isis.poly.edu THOTCON 0x2€¦ · Linux Bugs exist in code Anything that has attack surface is vulnerable Exploitation cost can be manipulated Make it really
Page 38: Julian Cohen HockeyInJune@isis.poly.edu THOTCON 0x2€¦ · Linux Bugs exist in code Anything that has attack surface is vulnerable Exploitation cost can be manipulated Make it really
Page 39: Julian Cohen HockeyInJune@isis.poly.edu THOTCON 0x2€¦ · Linux Bugs exist in code Anything that has attack surface is vulnerable Exploitation cost can be manipulated Make it really

checksec.sh paxtest

http://www.trapkit.de/tools/checksec.html

Page 40: Julian Cohen HockeyInJune@isis.poly.edu THOTCON 0x2€¦ · Linux Bugs exist in code Anything that has attack surface is vulnerable Exploitation cost can be manipulated Make it really

Locations of randomized sections are secret

If an attacker can obtain a piece of memory

An attacker can calculate the random offset

Page 41: Julian Cohen HockeyInJune@isis.poly.edu THOTCON 0x2€¦ · Linux Bugs exist in code Anything that has attack surface is vulnerable Exploitation cost can be manipulated Make it really

Stack Smashing Stack Canary Stack Canary

Bypass Heap

Exploitation

No eXecute Bit Return To

Library

Position Independent

Code / Address Space Layout

Randomization

Global Offset Table Overwrite

RELocation Read-Only

Return Oriented Programming

Position Independent Executable

Memory Disclosure

Page 42: Julian Cohen HockeyInJune@isis.poly.edu THOTCON 0x2€¦ · Linux Bugs exist in code Anything that has attack surface is vulnerable Exploitation cost can be manipulated Make it really

Actually, no. Our protections are based on exploits that

leverage known memory locations

But we achieved something A weaponized vulnerability for a release

version of software we used would not land

Page 43: Julian Cohen HockeyInJune@isis.poly.edu THOTCON 0x2€¦ · Linux Bugs exist in code Anything that has attack surface is vulnerable Exploitation cost can be manipulated Make it really

Make it really fucking hard to land an exploit

Protected from Jon Oberheide

Page 44: Julian Cohen HockeyInJune@isis.poly.edu THOTCON 0x2€¦ · Linux Bugs exist in code Anything that has attack surface is vulnerable Exploitation cost can be manipulated Make it really

Make it really fucking hard to land an exploit

Protected from @SecureTips

Page 45: Julian Cohen HockeyInJune@isis.poly.edu THOTCON 0x2€¦ · Linux Bugs exist in code Anything that has attack surface is vulnerable Exploitation cost can be manipulated Make it really

Thanks Jon Oberheide Dan Guido Brandon Edwards Dino Dai Zovi

Alex Sotirov Erik Cabetas Paolo Soto Stephen Ridley

Mike Zusman Kelly Lum Marcin W. Aaron Portnoy

Amber Baldet Shyama Rose Mark Dowd Peter Silberman

Chris Wysopal Zane Lackey Brian Holyfield Joe Hemler

Boris Kochergin Luis Garcia Efstratios Gavas Michael Aiello

Jon Tomek Ben Nell Zack Fasel M. Jakubowski

Beckie Mossman Apneet Jolly Leigh Hollowell Phil Da Silva

Jeff Jarmoc Mario Heiderich Kevin Nassery Justin Clarke

Nicholas Percoco Dug Song Dave Goldsmith Matthieu Suiche

Zach Lanier Spencer Pratt Colin Ames Raphael Mudge

Hugo Fortier Leigh Honeywell Dean De Beer Chris Valasek

Shawn Moyer Barnaby Jack Ron Gutierrez Rafal Los

NECCDC Red Team Dr. Raid Dual Core Tamari Kirtadze

SophSec PainSec MOBiLEDiSCO busticati.org