lkm rootkits 1 - 情報セキュリティ株式会社about lkm (linux kernel module) rootkits 5...

15
Information Security Inc. LKM rootkits 1

Upload: others

Post on 31-Jan-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: LKM rootkits 1 - 情報セキュリティ株式会社About LKM (linux kernel module) rootkits 5 •Insertion of malicious code into kernel on the fly •Enables overriding kernel system

Information Security Inc.

LKM rootkits 1

Page 2: LKM rootkits 1 - 情報セキュリティ株式会社About LKM (linux kernel module) rootkits 5 •Insertion of malicious code into kernel on the fly •Enables overriding kernel system

Information Security Confidential - Partner Use Only

Contents

2

• What are rootkits?

• Brief history

• About LKM (linux kernel module) rootkits

• Testing Environment

• Diamorphine LKM

• Installing Diamorphine

• Using Diamorphine

• References

Page 3: LKM rootkits 1 - 情報セキュリティ株式会社About LKM (linux kernel module) rootkits 5 •Insertion of malicious code into kernel on the fly •Enables overriding kernel system

Information Security Confidential - Partner Use Only

What are rootkits?

3

• A rootkit establishes a remote interface on a machine that allows

the system to be manipulated (C2) and data to be collected

(surveillance) in a manner that is difficult to observe (concealment)

Page 4: LKM rootkits 1 - 情報セキュリティ株式会社About LKM (linux kernel module) rootkits 5 •Insertion of malicious code into kernel on the fly •Enables overriding kernel system

Information Security Confidential - Partner Use Only

Brief history

4

• Ken Thompson’s rootkit

• Brain virus

• SunOS rootkit, 1990

• SonyBMG rootkit

• Greek wiretapping

• CarrierIQ rootkit on smartphone and handheld devices

Page 5: LKM rootkits 1 - 情報セキュリティ株式会社About LKM (linux kernel module) rootkits 5 •Insertion of malicious code into kernel on the fly •Enables overriding kernel system

Information Security Confidential - Partner Use Only

About LKM (linux kernel module) rootkits

5

• Insertion of malicious code into kernel on the fly

• Enables overriding kernel system calls

• Enables manipulation of /dev/kmem device file, allowing intruder to

virtually control the kernel on runtime, monitoring every read/write

memory operations

Page 6: LKM rootkits 1 - 情報セキュリティ株式会社About LKM (linux kernel module) rootkits 5 •Insertion of malicious code into kernel on the fly •Enables overriding kernel system

Information Security Confidential - Partner Use Only

About LKM (linux kernel module) rootkits

6

• Allows for CPU register hooking

• Facilitates Kernel object hooking

• Allows direct kernel object manipulation

Page 7: LKM rootkits 1 - 情報セキュリティ株式会社About LKM (linux kernel module) rootkits 5 •Insertion of malicious code into kernel on the fly •Enables overriding kernel system

Information Security Confidential - Partner Use Only

Testing Environment

7

• Kali Linux 2017

Page 8: LKM rootkits 1 - 情報セキュリティ株式会社About LKM (linux kernel module) rootkits 5 •Insertion of malicious code into kernel on the fly •Enables overriding kernel system

Information Security Confidential - Partner Use Only

Diamorphine LKM

8

• Diamorphine is a LKM rootkit for Linux Kernels 2.6.x/3.x/4.x

Features

==========

• When loaded, the module starts invisible;

• Hide/unhide any process by sending a signal 31;

• Sending a signal 63(to any pid) makes the module become (in)visible;

• Sending a signal 64(to any pid) makes the given user become root;

• Files or directories starting with the MAGIC_PREFIX become invisble;

Page 9: LKM rootkits 1 - 情報セキュリティ株式会社About LKM (linux kernel module) rootkits 5 •Insertion of malicious code into kernel on the fly •Enables overriding kernel system

Information Security Confidential - Partner Use Only

Installing Diamorphine

9

• Verify if the kernel is 2.6.x/3.x/4.x -> uname –r

Page 10: LKM rootkits 1 - 情報セキュリティ株式会社About LKM (linux kernel module) rootkits 5 •Insertion of malicious code into kernel on the fly •Enables overriding kernel system

Information Security Confidential - Partner Use Only

Installing Diamorphine

10

• Clone the repository

Page 11: LKM rootkits 1 - 情報セキュリティ株式会社About LKM (linux kernel module) rootkits 5 •Insertion of malicious code into kernel on the fly •Enables overriding kernel system

Information Security Confidential - Partner Use Only

Installing Diamorphine

11

• Enter the folder, compile and load the module (as root)

Page 12: LKM rootkits 1 - 情報セキュリティ株式会社About LKM (linux kernel module) rootkits 5 •Insertion of malicious code into kernel on the fly •Enables overriding kernel system

Information Security Confidential - Partner Use Only

Using Diamorphine

12

• When loaded, the module starts invisible

Page 13: LKM rootkits 1 - 情報セキュリティ株式会社About LKM (linux kernel module) rootkits 5 •Insertion of malicious code into kernel on the fly •Enables overriding kernel system

Information Security Confidential - Partner Use Only

Using Diamorphine

13

• Hide a python process by sending a signal 31

• Python process -> pid 4264

Page 14: LKM rootkits 1 - 情報セキュリティ株式会社About LKM (linux kernel module) rootkits 5 •Insertion of malicious code into kernel on the fly •Enables overriding kernel system

Information Security Confidential - Partner Use Only

Using Diamorphine

14

• Hide the process with pid 4264 by sending a signal 31

Page 15: LKM rootkits 1 - 情報セキュリティ株式会社About LKM (linux kernel module) rootkits 5 •Insertion of malicious code into kernel on the fly •Enables overriding kernel system

Information Security Confidential - Partner Use Only

References

15

• Wikipedia

https://en.wikipedia.org/wiki/Rootkit

• Kali Linux

https://www.kali.org/downloads/

• Diamorphine Kitploit

http://www.kitploit.com/2017/11/diamorphine-lkm-rootkit-for-linux.html