Rootkit internales

23
Rootkit Internals By- Mr. Omkar Pardeshi Malware Analyst & Developer [email protected]

description

null Mumbai April 2012 Monthly Meet

Transcript of Rootkit internales

Page 1: Rootkit internales

Rootkit Internals By- Mr. Omkar Pardeshi

Malware Analyst & [email protected]

Page 2: Rootkit internales

Types of threats Tools to Analyze threats Methodology of analysis of Malwares. Rootkit internals. Fighting with Rootkit.

Topics Overview

Page 3: Rootkit internales

Basic Worm-Replicate Trojan-Stand alone File infector-Infect Adware, Spyware, Backdoor , Boot Sector

Virus, Browser Hijacker,  Macro Virus, Polymorphic

Virus, Scripting Virus, Logic Bombs,Metamorphic .

Classification of computer viruses

Page 4: Rootkit internales

Sysinternal suit Procmon Process explorer. Regmon ,Regshot Pe view Systracer

Tools to analyze computer virus

Page 5: Rootkit internales

1982 Siberian pipeline sabotage 2001 Magic Lantern 2005 Sony BMG copy protection rootkit

scandal digital rights management software called Extended Copy Protection.

Mark Russinovich 2004–2005 Greek wiretapping case  Rootkit.Duqu.A

Trail of Rootkit

Page 6: Rootkit internales

is just a technology Subverting standard operating system. the design goals of a rootkit are to provide

three services: 1>remote access.2> monitoring.3>concealment.

Rootkit

Page 7: Rootkit internales

Real mode :-ring 3 -MS-DOS kernel .- Interrupt Service Routines (ISRs). &

Interrupt vector table(IVT) . protected mode:- ring 0 -system os loads in protected mode called

ring 0 or os kernel mode-unprivileged area called ring 3 or user mode.

Types

Page 8: Rootkit internales

User mode

Kernel mode

Page 9: Rootkit internales

User mode Rootkit Demo

Page 10: Rootkit internales

What happen Exactly..?Os level

Page 11: Rootkit internales

Process Level

Taskmgr

NTDLL

Ntoskernel.exe

NTDLL

AppInitHook

Taskmgr After inject

NtqueryInfo

result

DeliverModified result

Page 12: Rootkit internales

Memory Level

`

AppInitHook

NTDLL

0x2000

0x6500 NtQuerySystemInformation

0x6000

0x6500

0x2100

NtQuerySystemInformation

Ret 0x2100

Call to ntdll

Page 13: Rootkit internales

AppInit_DLLs -HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT \CurrentVersion\Windows 

Other ways SetWindowsHook. WriteProcessMemory+CreateRemoteThread Change in import table.

Dll injection

Page 14: Rootkit internales

Code Injection-inject dll

-Create Remote thread.

-write physical memory

-Hooking

Lot of ways to inject your code

Page 15: Rootkit internales

AppInit_DLLs  DllMain Hook NtQuerySystemInformation HookedNtQuerySystemInformation

NtQuerySystemInformation( __in SYSTEM_INFORMATION_CLASS SystemInformationClass,__inout PVOID SystemInformation, __in ULONG SystemInformationLength, __out_opt PULONG ReturnLength )

User mode Rootkit Demo Details

Page 16: Rootkit internales

HookedNtQuerySystemInformation( __in SYSTEM_INFORMATION_CLASS SystemInformationClass, __inout PVOID SystemInformation, __in ULONG SystemInformationLength, __out_opt PULONG ReturnLength )

Call to original NtQuerySystemInformation

PMY_SYSTEM_PROCESS_INFORMATION pNext = (PMY_SYSTEM_PROCESS_INFORMATION)SystemInformation;

if (!wcsncmp(pNext->ImageName.Buffer, L"calc.exe", pNext->ImageName.Length))

Return result

Page 17: Rootkit internales

Kernel Mode Rootkit Demo

Page 18: Rootkit internales

What happen Exactly..?

Page 19: Rootkit internales

In kernel

Page 20: Rootkit internales

Get Address of SSDT Get offset address of functions from SSDT Save Address Write Address of our function into SSDT If query call is for our file deny access If not call original function from saved

address.

Algo For Kernel Fun hooking

Page 21: Rootkit internales

Ways root kit to system-SSDT hook-Shadow SSDT hook w32k.sys-FS callback-Registry Callback-Interrupt Descriptor Table (IDT)-Register Notify Routines-Windows hook-Driver hook-Dispach hook-keyboard hook-System thread-list goes on

Welcome in Kernel mode

Page 22: Rootkit internales

Gmer Rootkkit unhooker Sysrevaler Various rootkit scanners. To stay secure use updated AV & install all

the security patches.

Detection Tools

Page 23: Rootkit internales

Questions…….?

Thank you