in-memory attacks explained-nginx - ibm research · • analyze the system to find a vulnerability...

Post on 04-Apr-2019

224 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

In-memory Cyber Attacks

2

Large Database of Known Vulnerabilities

3

For Example: nginx HTTP server

How do Hackers Attack?

4

Hidden securitysoftware bug

Bugs exploited to run malware

Malware compromises the system

Malware

A Four-Stage Attack Process

5

1. Find a vulnerability

2. Create a payload to exploit the vulnerability

3. Bring malicious code (using payload)

4. Control the kernel; attack

• Analyze the system to find a vulnerability• Casting mismatch vulnerability

6

Nginx – Step 1

• Create the payload that exploits the vulnerability• A malformed http request, crafted to overflow,

and than poison the memory

7

Nginx – Step 2

• Bring malicious code• Gain super user privileges and

connect to the remote attacker

8

Nginx – Step 3

• Control the kernel • Attack

9

Nginx – Step 4

• Raspbian• Based on Raspberry Pi

10

Demo

11

Where is the bug?

12

off_t (signed long long)size_t (unsigned int) 4096

13

Casting Mismatch

14

Buffer Overflow

• Before Overflow:

Return address = 0x0004c73c

• After Overflow

Return address = 0x000136c4 (our first ROP gadget)

15

Now What?

Understanding ROP – The Problem

16

• Data Execution Prevention (DEP)

Understanding ROP – The Solution

17

• Execute machine instruction

sequences ("gadgets“)

• Gadgets ends with return, and

are located in existing libraries

• Chained together, gadgets allow performing arbitrary operations• In libc sufficient gadgets exist for Turing-complete functionality

Understanding ROP – The Solution

18

19

ROP example

20

The Shell Code We Used

Recommendations

21

• With open source software:• Stay up to date (patch)

• Register to the security mailing list(s)

• Closed source are just as bad…

• Install a zero day tool• Protects against unknown vulnerabilities

Karamba’s Automatically Generated Hardening

22

Seal ECU according to factory settings

Detectsecurity bugs’ exploits

Prevent the attack at the ECU level

Malware

top related