76
Thinking in rings Michael Shalyt Malware Research Team Leader @ Check Point PRIVILEGE ESCALATION

Intro To Privilege Elevation

  • Upload
    shalyt

  • View
    40

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Intro To Privilege Elevation

Thinking in rings

Michael Shalyt

Malware Research Team Leader @ Check Point

PRIVILEGE ESCALATION

Page 2: Intro To Privilege Elevation

MICHAEL SHALYT – BIO-IN-A-GRAPH

Technology

Rese

arch

Page 3: Intro To Privilege Elevation

MICHAEL SHALYT – BIO-IN-A-GRAPH

Technology

Rese

arch

First program (8yo)

Page 4: Intro To Privilege Elevation

MICHAEL SHALYT – BIO-IN-A-GRAPH

Technology

Rese

arch

First program (8yo)

ASM (13yo)

Page 5: Intro To Privilege Elevation

MICHAEL SHALYT – BIO-IN-A-GRAPH

Technology

Rese

arch

First program (8yo)

ASM (13yo)

IPHO 2005

Page 6: Intro To Privilege Elevation

MICHAEL SHALYT – BIO-IN-A-GRAPH

Technology

Rese

arch

First program (8yo)

ASM (13yo)

IPHO 2005BSc. Physics + EE

Page 7: Intro To Privilege Elevation

MICHAEL SHALYT – BIO-IN-A-GRAPH

Technology

Rese

arch

First program (8yo)

ASM (13yo)

Cyber Cyber

IPHO 2005BSc. Physics + EE

Page 8: Intro To Privilege Elevation

MICHAEL SHALYT – BIO-IN-A-GRAPH

Technology

Rese

arch

First program (8yo)

ASM (13yo)

Cyber Cyber

Reverse Engineering

IPHO 2005BSc. Physics + EE

Page 9: Intro To Privilege Elevation

MICHAEL SHALYT – BIO-IN-A-GRAPH

Technology

Rese

arch

First program (8yo)

ASM (13yo)

Cyber Cyber

Reverse Engineering

Research TL

IPHO 2005BSc. Physics + EE

Page 10: Intro To Privilege Elevation

MICHAEL SHALYT – BIO-IN-A-GRAPH

Technology

Rese

arch

First program (8yo)

ASM (13yo)

Cyber Cyber

Reverse Engineering

Research TL

IPHO 2005BSc. Physics + EE

MSc. Quantum Information

Page 11: Intro To Privilege Elevation

MICHAEL SHALYT – BIO-IN-A-GRAPH

Technology

Rese

arch

First program (8yo)

ASM (13yo)

Cyber Cyber

Reverse Engineering

Research TL

IPHO 2005BSc. Physics + EE

MSc. Quantum Information

Malware Research TL @CP

Page 12: Intro To Privilege Elevation

MICHAEL SHALYT – BIO-IN-A-GRAPH

Technology

Rese

arch

First program (8yo)

ASM (13yo)

Matlab

Javascript

Actionscript

Mathematica

C

Scheme

Cyber Cyber

Reverse Engineering

Research TL

PythonIPHO 2005BSc. Physics + EE

MSc. Quantum Information

Malware Research TL @CP

Pascal

AutoIT

Page 13: Intro To Privilege Elevation

MICHAEL SHALYT – BIO-IN-A-GRAPH

Technology

Rese

arch

First program (8yo)

Lifeinagraph.blogspot.com

ASM (13yo)

Matlab

Javascript

Actionscript

Mathematica

C

Scheme

Cyber Cyber

Reverse Engineering

Research TL

PythonIPHO 2005BSc. Physics + EE

MSc. Quantum Information

Malware Research TL @CP

Pascal

AutoIT

Catapults

Humans

Page 14: Intro To Privilege Elevation

WHAT’S A HACKER?

Page 15: Intro To Privilege Elevation

WHAT’S A HACKER?

• People committed to circumvention of computer security.

Page 16: Intro To Privilege Elevation

WHAT’S A HACKER?

• People committed to circumvention of computer security.

• RFC 1392: “A person who delights in having an intimate understanding of the internal workings of a system”. (1960s around MIT's Tech Model Railroad Club)

Page 17: Intro To Privilege Elevation

WHAT’S A HACKER?

• People committed to circumvention of computer security.

• RFC 1392: “A person who delights in having an intimate understanding of the internal workings of a system”. (1960s around MIT's Tech Model Railroad Club)

• Vs. “user” (like “script kiddies”)

Page 18: Intro To Privilege Elevation

PRIVILEGE

Page 19: Intro To Privilege Elevation

PRIVILEGE

Page 20: Intro To Privilege Elevation

RINGS AND GATEKEEPERS

Page 21: Intro To Privilege Elevation

RINGS AND GATEKEEPERS

Page 22: Intro To Privilege Elevation

RINGS AND GATEKEEPERS

Page 23: Intro To Privilege Elevation

PRINCIPAL OF LEAST PRIVILEGE

Page 24: Intro To Privilege Elevation

PRINCIPAL OF LEAST PRIVILEGE

• System stability.

Page 25: Intro To Privilege Elevation

PRINCIPAL OF LEAST PRIVILEGE

• System stability.

• Security.

Page 26: Intro To Privilege Elevation

PRINCIPAL OF LEAST PRIVILEGE

• System stability.

• Security.

• Ease of deployment.

Page 27: Intro To Privilege Elevation

PRINCIPAL OF LEAST PRIVILEGE

• System stability.

• Security.

• Ease of deployment.

• In RL: Compartmentalization / Encapsulation.

Page 28: Intro To Privilege Elevation

X86 RINGS

Most privileged

Least privileged

Page 29: Intro To Privilege Elevation

VERTICAL PE - WHAT

Page 30: Intro To Privilege Elevation

VERTICAL PE - WHAT

• User -> admin.

Page 31: Intro To Privilege Elevation

VERTICAL PE - WHAT

• User -> admin.• User -> system/root.

Page 32: Intro To Privilege Elevation

VERTICAL PE - WHAT

• User -> admin.• User -> system/root.• Javascript -> shellcode.

Page 33: Intro To Privilege Elevation

VERTICAL PE - WHAT

• User -> admin.• User -> system/root.• Javascript -> shellcode.• Username -> access.

Page 34: Intro To Privilege Elevation

VERTICAL PE - WHAT

• User -> admin.• User -> system/root.• Javascript -> shellcode.• Username -> access. • Hypervisor instance traversal.

Page 35: Intro To Privilege Elevation

VERTICAL PE - WHAT

• User -> admin.• User -> system/root.• Javascript -> shellcode.• Username -> access. • Hypervisor instance traversal.• Access to restricted places/documents/data.

Page 36: Intro To Privilege Elevation

VERTICAL PE - WHAT

• User -> admin.• User -> system/root.• Javascript -> shellcode.• Username -> access. • Hypervisor instance traversal.• Access to restricted places/documents/data.• Etc.

Page 37: Intro To Privilege Elevation

HORIZONTAL PE - WHAT

Page 38: Intro To Privilege Elevation

HORIZONTAL PE - WHAT

• User impersonation (bank app credentials).

Page 39: Intro To Privilege Elevation

HORIZONTAL PE - WHAT

• User impersonation (bank app credentials).

• User data theft (credit card).

Page 40: Intro To Privilege Elevation

HORIZONTAL PE - WHAT

• User impersonation (bank app credentials).

• User data theft (credit card).

• Hypervisor instance spying.

Page 41: Intro To Privilege Elevation

HORIZONTAL PE - WHAT

• User impersonation (bank app credentials).

• User data theft (credit card).

• Hypervisor instance spying.

• Framing someone else.

Page 42: Intro To Privilege Elevation

HORIZONTAL PE - WHAT

• User impersonation (bank app credentials).

• User data theft (credit card).

• Hypervisor instance spying.

• Framing someone else.

• Etc.

Page 43: Intro To Privilege Elevation

PE – BATTLE PLAN

Page 44: Intro To Privilege Elevation

PE – BATTLE PLAN

• You already have limited capabilities.

Page 45: Intro To Privilege Elevation

PE – BATTLE PLAN

• You already have limited capabilities.

• Use them to:

• Gather info (profiling).

Page 46: Intro To Privilege Elevation

PE – BATTLE PLAN

• You already have limited capabilities.

• Use them to:

• Gather info (profiling).

• Pass through the guard mechanism (appear as legitimate low ring-high ring interaction).

Page 47: Intro To Privilege Elevation

PE – BATTLE PLAN

• You already have limited capabilities.

• Use them to:

• Gather info (profiling).

• Pass through the guard mechanism (appear as legitimate low ring-high ring interaction).

• Trick the higher ring to do as you wish.

Page 48: Intro To Privilege Elevation

VERTICAL PE - HOW

Page 49: Intro To Privilege Elevation

VERTICAL PE - HOW

• XSS.

Page 50: Intro To Privilege Elevation

VERTICAL PE - HOW

• XSS.• Password guessing/brute forcing.

Page 51: Intro To Privilege Elevation

VERTICAL PE - HOW

• XSS.• Password guessing/brute forcing.• Driver vulnerabilities.

Page 52: Intro To Privilege Elevation

VERTICAL PE - HOW

• XSS.• Password guessing/brute forcing.• Driver vulnerabilities.• Service privileges.

Page 53: Intro To Privilege Elevation

VERTICAL PE - HOW

• XSS.• Password guessing/brute forcing.• Driver vulnerabilities.• Service privileges.• Design bug-features.

Page 54: Intro To Privilege Elevation

VERTICAL PE - HOW

• XSS.• Password guessing/brute forcing.• Driver vulnerabilities.• Service privileges.• Design bug-features.• SE.

Page 55: Intro To Privilege Elevation

VERTICAL PE - HOW

• XSS.• Password guessing/brute forcing.• Driver vulnerabilities.• Service privileges.• Design bug-features.• SE.• Etc. Etc.

Page 56: Intro To Privilege Elevation

HORIZONTAL PE - HOW

Page 57: Intro To Privilege Elevation

HORIZONTAL PE - HOW

• XSS.

Page 58: Intro To Privilege Elevation

HORIZONTAL PE - HOW

• XSS.

• Session cookies theft.

Page 59: Intro To Privilege Elevation

HORIZONTAL PE - HOW

• XSS.

• Session cookies theft.

• Cross-tab data leakage.

Page 60: Intro To Privilege Elevation

HORIZONTAL PE - HOW

• XSS.

• Session cookies theft.

• Cross-tab data leakage.

• Password guessing/brute forcing.

Page 61: Intro To Privilege Elevation

HORIZONTAL PE - HOW

• XSS.

• Session cookies theft.

• Cross-tab data leakage.

• Password guessing/brute forcing.

• Hypervisor/driver data leakage.

Page 62: Intro To Privilege Elevation

HORIZONTAL PE - HOW

• XSS.

• Session cookies theft.

• Cross-tab data leakage.

• Password guessing/brute forcing.

• Hypervisor/driver data leakage.

• SE.

Page 63: Intro To Privilege Elevation

HORIZONTAL PE - HOW

• XSS.

• Session cookies theft.

• Cross-tab data leakage.

• Password guessing/brute forcing.

• Hypervisor/driver data leakage.

• SE.

• Etc. Etc.

Page 64: Intro To Privilege Elevation

EXAMPLES – LOOK MOM NO VULNS

Page 65: Intro To Privilege Elevation

EXAMPLES – LOOK MOM NO VULNS

• Service EXE overwriting.

Page 66: Intro To Privilege Elevation

EXAMPLES – LOOK MOM NO VULNS

• Service EXE overwriting.• Unprotected autorun directories.

Page 67: Intro To Privilege Elevation

EXAMPLES – LOOK MOM NO VULNS

• Service EXE overwriting.• Unprotected autorun directories.• Misconfigurations.

Page 68: Intro To Privilege Elevation

EXAMPLES – LOOK MOM NO VULNS

• Service EXE overwriting.• Unprotected autorun directories.• Misconfigurations.• Plain text passwords.

Page 69: Intro To Privilege Elevation

EXAMPLE – DLL HIJACKING

Page 70: Intro To Privilege Elevation

EXAMPLE – API EXPLOITATION

Page 71: Intro To Privilege Elevation

EXAMPLE – API EXPLOITATION

• User -> kernel.

Page 72: Intro To Privilege Elevation

EXAMPLE – API EXPLOITATION

• User -> kernel.• Ntdll.dll – wrapper and guard.

Page 73: Intro To Privilege Elevation

EXAMPLE – API EXPLOITATION

• User -> kernel.• Ntdll.dll – wrapper and guard.• Wealth of info before attack.

Page 74: Intro To Privilege Elevation

EXAMPLE – API EXPLOITATION

• User -> kernel.• Ntdll.dll – wrapper and guard.• Wealth of info before attack.• Kernel bug exploitation.

Page 75: Intro To Privilege Elevation

EXAMPLE – API EXPLOITATION

• User -> kernel.• Ntdll.dll – wrapper and guard.• Wealth of info before attack.• Kernel bug exploitation.• Often – make kernel mode run code from user mode.

Page 76: Intro To Privilege Elevation

QUESTIONS?