17
Rootkit 101 - 2nd Edion cmj @ 2015 1

Rootkit 101 - 2nd Edition

Embed Size (px)

Citation preview

Page 1: Rootkit 101 - 2nd Edition

Rootkit 101 - 2nd Edition

cmj @ 2015

1

Page 2: Rootkit 101 - 2nd Edition

> rootkit

rootkit is a stealthy type of software, typically malicious, designed to hide some running processes / files / network connections

2

Page 3: Rootkit 101 - 2nd Edition

Tamper and Hide

3

Page 4: Rootkit 101 - 2nd Edition

Simple Rootkit Design - lv1

• You can cheat the user

• Replace the command used to get resource status

• ls / ps / top / …etc

• You DID NOT exactly tamper the tool, only cheat the user

4

Page 5: Rootkit 101 - 2nd Edition

Cheat ls

5

Page 6: Rootkit 101 - 2nd Edition

Simple Rootkit Design - lv2

• Replace the tool used to get the resource

• A wrapper of the original tool

• Rebuild the tool

• … etc

6

Page 7: Rootkit 101 - 2nd Edition

Replacement

7

Page 8: Rootkit 101 - 2nd Edition

• All of the previous tool are reply the unusual response

• Color / syntax missing

• Layout not match

• … etc

• We NEED to keep mysterious and unknown

8

Page 9: Rootkit 101 - 2nd Edition

Useful Rootkit Design - lv3

• Understand how ls work - ls will call …

• opendir

• readdir

• … etc

• You can trace by strace / dtruss / …etc

9

Page 10: Rootkit 101 - 2nd Edition

Shared Library Hookusing LD_PRELOAD

10

Page 11: Rootkit 101 - 2nd Edition

LD_PRELOAD Hook

11

Page 12: Rootkit 101 - 2nd Edition

But still can find the clue on the system

• The extra library on configure / environment

• Still can find out the file / folder

If I direct using dlopen / dlsym like the rootkit do …

12

Page 13: Rootkit 101 - 2nd Edition

Robust Rootkit design - lv4

• Tamper from the kernel-level

• Directly replace the response as deeper as possible

• You will never find the rootkit if the response comes from rootkit

13

Page 14: Rootkit 101 - 2nd Edition

朕不給,你不能搶 ∼

14

Page 15: Rootkit 101 - 2nd Edition

cmj

NEVER know the kernel programming XD

15

Page 16: Rootkit 101 - 2nd Edition

Concept

1. Hijack the syscall table

2. Hijack the response function

3. Hijack the data in kernel

4. … etc

16

Page 17: Rootkit 101 - 2nd Edition

Thanks for your attention ~

17