Lecture 8 Rootkits Hoglund/Butler (Chapter 7-8). Avoiding detection Two ways rootkits can avoid detection –Modify execution path of operating system to.

Slides:



Advertisements
Similar presentations
Operating-System Structures
Advertisements

Operating System Structures
VICE – Catch the hookers! (Plus new rootkit techniques)
Utilizing the GDB debugger to analyze programs Background and application.
Operating-System Structures
IT Systems Operating System EN230-1 Justin Champion C208 –
Operating System Structure. Announcements Make sure you are registered for CS 415 First CS 415 project is up –Initial design documents due next Friday,
2: OS Structures 1 Jerry Breecher OPERATING SYSTEMS STRUCTURES.
Home: Phones OFF Please Unix Kernel Parminder Singh Kang Home:
Figure 1.1 Interaction between applications and the operating system.
Cs238 Lecture 3 Operating System Structures Dr. Alan R. Davis.
Chapter 12 File Management Systems
1 Process Description and Control Chapter 3 = Why process? = What is a process? = How to represent processes? = How to control processes?
Buffer Overflow Attacks Figure (a) Situation when the main program is running. (b) After the procedure A has been called. (c) Buffer overflow shown.
Lesson 9-Securing a Network. Overview Identifying threats to the network security. Planning a secure network.
ROOT KITS. Overview History What is a rootkit? Rootkit capabilities Rootkits on windows OS Rootkit demo Detection methodologies Good tools for detection.
Chapter 6 - Implementing Processes, Threads and Resources Kris Hansen Shelby Davis Jeffery Brass 3/7/05 & 3/9/05 Kris Hansen Shelby Davis Jeffery Brass.
COMPUTER SOFTWARE Chapter 3. Software & Hardware? Computer Instructions or data, anything that can be stored electronically is Software. Hardware is one.
Hands-On Microsoft Windows Server 2008
MODERN OPERATING SYSTEMS Third Edition ANDREW S. TANENBAUM Chapter 11 Case Study 2: Windows Vista Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall,
WINDOWS SERVICES. Introduction You often need programs that run continuously in the background Examples: – servers –Print spooler You often need.
ITE 1 Chapter 5. Chapter 5 is a Large Chapter It has a great deal of useful information about operating systems. You will find this VERY helpful when.
Hands-On Microsoft Windows Server 2003 Administration Chapter 2 Managing Windows Server 2003 Hardware and Software.
OPERATING SYSTEM OVERVIEW. Contents Basic hardware elements.
Chapter 1. Introduction What is an Operating System? Mainframe Systems
CSC 322 Operating Systems Concepts Lecture - 25: by Ahmed Mumtaz Mustehsan Special Thanks To: Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall,
Rootkits in Windows XP  What they are and how they work.
Architecture Support for OS CSCI 444/544 Operating Systems Fall 2008.
Chapter 2: Operating-System Structures. 2.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 2: Operating-System Structures Operating.
Chapter 41 Processes Chapter 4. 2 Processes  Multiprogramming operating systems are built around the concept of process (also called task).  A process.
Monnappa KA  Info Security Cisco  Member of SecurityXploded  Reverse Engineering, Malware Analysis, Memory Forensics 
Lecture 3 Process Concepts. What is a Process? A process is the dynamic execution context of an executing program. Several processes may run concurrently,
Windows 2000 System Mechanisms Computing Department, Lancaster University, UK.
CE Operating Systems Lecture 11 Windows – Object manager and process management.
CAP6135: Malware and Software Vulnerability Analysis Rootkits Cliff Zou Spring 2012.
CE Operating Systems Lecture 3 Overview of OS functions and structure.
UNIX Files File organization and a few primitives.
Operating Systems Lecture November 2015© Copyright Virtual University of Pakistan 2 Agenda for Today Review of previous lecture Hardware (I/O, memory,
Hidden Processes: The Implication for Intrusion Detection
© 2004, D. J. Foreman 1 Implementing Processes and Threads.
Lecture Topics: 10/29 Architectural support for operating systems –timers –kernel mode –system calls –protected instructions.
Full and Para Virtualization
Privilege Escalation Two case studies. Privilege Escalation To better understand how privilege escalation can work, we will look at two relatively recent.
OSes: 2. Structs 1 Operating Systems v Objective –to give a (selective) overview of computer system architectures Certificate Program in Software Development.
Lecture 7 Rootkits Hoglund/Butler (Chapter 5-6). Avoiding detection Two ways rootkits can avoid detection –Modify execution path of operating system to.
Lecture 5 Rootkits Hoglund/Butler (Chapters 1-3).
Concepts and Structures. Main difficulties with OS design synchronization ensure a program waiting for an I/O device receives the signal mutual exclusion.
OPERATING SYSTEMS DO YOU REQUIRE AN OPERATING SYSTEM IN YOUR SYSTEM?
CSCI/CMPE 4334 Operating Systems Review: Exam 1 1.
1.3 Operating system services An operating system provide services to programs and to the users of the program. It provides an environment for the execution.
A+ Guide to Managing and Maintaining Your PC, 7e Chapter 2 Introducing Operating Systems.
Introduction to Operating Systems Concepts
Chapter Objectives In this chapter, you will learn:
Chapter 2: System Structures
Operating System Structure
Chapter 3: Windows7 Part 1.
Hidden Processes: The Implication for Intrusion Detection
Chapter 3: Windows7 Part 2.
Windows Internals Brown-Bag Seminar Chapter 1 – Concepts and Tools
Chapter 2: System Structures
Chapter 3: Windows7 Part 2.
Lecture Topics: 11/1 General Operating System Concepts Processes
Process Description and Control
Chapter 2: Operating-System Structures
Operating Systems Lecture 3.
Modern PC operating systems
Process Description and Control
Chapter 2: Operating-System Structures
Chapter 2: Operating-System Structures
In Today’s Class.. General Kernel Responsibilities Kernel Organization
Presentation transcript:

Lecture 8 Rootkits Hoglund/Butler (Chapter 7-8)

Avoiding detection Two ways rootkits can avoid detection –Modify execution path of operating system to hide rootkit presence –Modify data that stores information about processes, files, etc. that would reveal presence of rootkit This chapter –Modifying data that stores information on rootkit

Direct Kernel Object Manipulation Hooking disadvantages –If someone knows where to look, hooks can usually be detected –Modern kernel/hardware memory protection mechanisms may make some hooks unusable (read-only, no-execute protection) DKOM –Directly modify objects the kernel relies upon for its bookkeeping and reporting –Normally, modifications to processes or tokens is done via Object Manager in kernel Performs protection checks –DKOM bypasses Object Manager and its checks

DKOM Disadvantages –Must disassemble format of object WinDbg makes it easier –Must know how object is used so that code doesn’t break after modification –Must know how object changes between versions of OS –Only objects the kernel keeps in memory and uses for accounting purposes can be modified Can not be used to hide files Can be used to hide processes, device drivers, ports Can be used to elevate privilege levels

Determining OS version User-mode –Win32 API OSVERSIONINFOEX structure –Returned by GetVersionEx Kernel-mode –Old versions of Windows PsGetVersion API –New versions (XP) of Windows RtlGetVersion –Parse string that is returned Either mode –Windows registry query HKEY_LOCAL_MACHINE\SOFTWARE\Microso ft\Windows\NT\CurrentVersion\* RegQueryValueEx

Making it happen From user-mode –Must create IOCTLs to communicate with driver that performs DKOM I/O Control Codes –IOCTLs included within IRPs –Example in book

Process hiding Objects referenced by user process such as Taskmgr.exe ZwQuerySystemInformation call lists running processes –Traverses doubly linked list in the EPROCESS structure of each process FLINK = pointer to process in front BLINK = pointer to process in back –Find a reference to EPROCESS of current process by calling PsGetCurrentProcess

Process hiding Hiding done based on process name –PIDs are pseudo-random –Name is included in EPROCESS structure –Location of name obtained via GetLocationOfProcessName –16 byte character string (first 16 characters of binary on disk) Traverse list and update FLINK and BLINK pointers to point around process to be hidden –Must ensure that hidden process has valid FLINK and BLINK pointers when hidden process exits via PspExitProcess –Have them point to itself What about process scheduler? –Apparently does not rely on FLINK/BLINK

Device driver hiding drivers.exe utility Windows Device Manager –Rely on ZWQuerySystemInformation with a SYSTEM_INFORMATION_CLASS of 11 –Modules also referenced via doubly linked list Same trick used Modify FLINK and BLINK again –Finding the list is hard Scan memory manually for MODULE_ENTRY object structure Use Kernel Processor Control Block (KPRCB) for Windows XP and beyond Use WinDbg to view members of the DRIVER_OBJECT structure (contains an undocumented field 0x14 into structure that is a pointer to driver’s MODULE_ENTRY

Issues in list traversal Processes and modules may be added or deleted while traversing –Must grab PspActiveProcessMutex –Must deal with possible pre-emption while modifying Must run at DISPATCH_LEVEL to prevent

Token privilege and group elevation Process token derived from login session of user that spawned process Every thread within process has its own token Use modifications to token to gain elevated privileges to install rootkit –Win32 API: OpenProcessToken, AdjustTokenPrivileges, AdjustTokenGroups –One can modify token privileges without elevated privileges by directly modifying privelege information in token Stored in variable length portion of token Example privileges: p 197 –SeCreateTokenPrivilege –SeAssignPrimaryTokenPrivilege –SeLockMemoryPrivilege –SeIncreaseQuotaPrivilege –SeUnsolicitedInputPrivilege –etc

Token privilege and group elevation Major problem –Adding privileges to variable length part of token –Must avoid increasing token size –Look to modify in place –Many privileges are included but are in a DISABLED state SE_PRIVILEGE_DISABLED SE_PRIVILEGE_ENABLED_BY_DEFAULT SE_PRIVILEGE_ENABLED

Token privilege and group elevation Group elevation –Privileges associated with group membership Determined by group SID Adding SIDs to a process token adds privileges –Much more complicated than adding privileges Requires allocating new memory and updating pointers in SID_AND_ATTRIBUTE table i.e. unlike privileges there are no “disabled” SIDs to fill in

Hiding while performing DKOM Events generated upon all actions –Registered callbacks upon certain events must be disabled to ensure stealth –Example: Windows Event Log Process being created Parent PID Username that owns process Must change values in process token to other users to hide tracks

Other DKOM targets Hiding network ports –Modifying tables of open ports in TCPIP.SYS Recommended tools –SoftIce –WinDbg –IDA Pro –Microsoft Symbol Server

Hardware manipulation Physical access allows for hardware/firmware changes to be made –BIOS modifications CIH virus destroyed BIOS No known public rootkit for BIOS –BIOS modifications to PCI devices Example in book 8259 keyboard controller –Modifies HAL.DLL (Hardware Abstraction Layer) –Technically not a hardware modfication, but adds exploit at interrupt processing level using assembly commands specific to hardware Microcode update for processors –Used to fix bugs –Stored in BIOS and uploaded to processor every time machine boots –Protected by strong encryption on Intel processors (but not AMD processors) AMD K8 microcode update driver IA32 microcode driver