45085481KIDS – Kernel Intrusion Detection System.ppt
《45085481KIDS – Kernel Intrusion Detection System.ppt》由会员分享,可在线阅读,更多相关《45085481KIDS – Kernel Intrusion Detection System.ppt(66页珍藏版)》请在三一办公上搜索。
1、KIDS Kernel Intrusion Detection System,Rodrigo Rubira BrancoDomingo Montanaro,Disclaimer,This presentation is just about issues we have worked on in our own time,and is NOT related to the companies ideas,opinions or works.We are just security guys who work for big companiesand in our spare time we d
2、o security research and we areorganizers of the Brazilians largest hacking conferencecalled H2HC Hackers 2 Hackers Conference(Hope 2 c u there!)Montanaro main research efforts are in Forensics and Anti-Forensics technics and backdoor detection/reversingRodrigo research efforts are in going inside th
3、eSystem Internals and trying to create new problems tobe solved,Agenda,Motivation Actual Issues to be solvedTools that try to act on this issues and their vulnerabilitiesDifferences between protection levels(software/hardware)StMichael what it actually doesOur ProposalComments on efforts of breaking
4、 our ideasImprovements on StMichael Technical StuffQuestions and Astalavista baby:D,Motivation,Linux is not secure by default(we know,many*secure*linux distributions exist.)Most of efforts till now on OS protection dont really protect the kernel itselfMost of modern OSs use only 2 privileges rings p
5、rovided by Intel arch(4)These efforts in most of current security tools/methods/politics try to block ring3(user-mode)scalation to ring0(kernel-mode)Many(a lot!)of public exploits were released for direct kernel exploitationBeyond of the fact above,it is possible to bypass the systems protectors(suc
6、h as SELinux)After a kernel compromise,life is not the same(never ever!),Userland protections,We enjoined this picture from Julie Tinnes presentationon Windows HIPS evaluation with Slipfest,In ring0 fights,its all a mess.-Lets protect the ring0!First thing the we should do to analize a compromised m
7、achine is to clone the RAM contents.Why?Because all binaries in the system can be cheated statically(binary itself modified)or dynamically(hooked in int80h).So,what do we find in the RAM analisys?*Should be*Everything,Structures commonly searched in memoryEPROCESS and ETHREAD blocks(with references
8、to the memory pages used by the process/threads)Lists like PsActiveProcessList and waiting threads to be scheduled(used for cross-view detection)Interfaces(Ex:Ethernet IP,MAC addr,GW,DNS servers)Sockets and other objects used by running processes(with detailed information regarding endpoints,proto,e
9、tc),There are many techniques in the wild to subvert forensics analisys,Never ever?,Grabbing RAM contents,RAM clone,WindowsE:binUnicodeRelease.dd.exe if=.PhysicalMemory of=E:Ram_Clone.bin bs=512 conv=noerror Linuxking:/mnt/sda1#./dcfldd if=/dev/mem of=Ram_Clone.bin bs=512 conv=noerror,Trustable Meth
10、od?,Windows Malware,Piece of cake:Malware running in user-space(99%of trojan horses that attack brazilian users in Scam),Windows Malware,Inject kernel modules to hide themselvesExamples:Hacker DefenderSuckitAdoreShadow Walker,These rootkits use well known techniques(Ex:IDT hooking)to monitor/subvert
11、 user-space/kernel-space conversations.,dd.exe,Kernel,User-Space,Kernel-Space,ReadFile(),Which File?.PhysicalMemory.PhysicalDrive0Etc.,RAM Forensics Linux Scenario,On Linux,to proceed with RAM analysis,tools like Fatkit are used(Static memory dump file analysis)But at clone time,the destination imag
12、e can be subverted if the machine is compromised with a custom rootkit,dcfldd,Kernel,User-Space,Kernel-Space,int0 x80,execve-/bin/dcflddopen-/etc/ld.so.cacheread-/bin/dcfldd(ELF)mmap2,fstat and others,Is it requesting the addrs of my backdoor task_struct?Yes?So send httpd task_struct,RAM Forensics,s
13、size_t h_read(int fd,void*buf,size_t count)unsigned int i;ssize_t ret;char*tmp;pid_t pid;If the fd(file descriptor)contains somethingthat we are looking for(kmem or mem)return_address();At this point we could check the offset beingrequired.If is our backdoor addr,send another task_structret=o_read(f
14、d,buf,count);change_address();return ret;,int change_address()put our hacks into the kernel,int return_address()return our hacks to the original state,Windows Malware,Lets say our scanner/detector/memory dumper/whatever resides in Kernel-Space and althout using ReadFile()uses ZwReadFile or ZwOpenKey
15、 or Zw*.Reliable?,SST System Service Table Hooking,C:SDTrestore.exeSDTrestore Version 0.2 Proof-of-Concept by SIG2 G-TEC(www.security.org.sg)KeServiceDescriptorTable 80559B80KeServiceDecriptorTable.ServiceTable 804E2D20KeServiceDescriptorTable.ServiceLimit 284ZwClose 19-hooked by unknown at FA881498
16、-ZwCreateFile 25-hooked by unknown at FA881E16-ZwCreateKey 29-hooked by unknown at FA882266-ZwCreateThread 35-hooked by unknown at FA880F8E-ZwEnumerateKey 47-hooked by unknown at FA882360-ZwEnumerateValueKey 49-hooked by unknown at FA881EDE-ZwOpenFile 74-hooked by unknown at FA881D6C-ZwOpenKey 77-ho
17、oked by unknown at FA8822E2-ZwQueryDirectoryFile 91-hooked by unknown at FA881924-ZwQuerySystemInformation AD-hooked by unknown at FA881A4A-ZwReadFile B7-hooked by unknown at FA8810EE-ZwRequestWaitReplyPort C8-hooked by unknown at FA881310-ZwSecureConnectPort D2-hooked by unknown at FA8813EA-ZwWrite
18、File 112-hooked by unknown at FA881146-Number of Service Table entries hooked=14,Windows Malware,Ok,lets say we want to go deeper and grab a file directly from the HD:Then we use IoCallDriver()to talk directly with the HDD.Reliable?,IRP(I/O Request Packet)Hooking,Fonte:Rootkits Advanced MalwareDarre
19、n Bilby,Keep it simple!,How about if our memory grabber just sets up a pointer to offset 0 x00 of RAM memory and copies to another var till it reaches the end of memory?(Regardless of race conditions to kernel memory),Reliable?,WatchPoints in memory pages(DR0 to DR3),When our backdoor offset is hitb
20、y the“inspector”it will generate a#DB(Debug Exception)which we can work on it,Securely?Grabbing the RAM contents,Some hardwares attempt to get the RAM contents,These type of solutions rely on the DMA method of accessing the RAM and then acting on it(CoPolit)or dumping it(Tribble)Tribble Takes a snap
21、shot(dump)of the RAMhttp:/www.digital-evidence.org CoPilot Audits the system integrity by looking at the RAM C Other Firewire(IEEE 1394)Methods Michael Becher,Maximillian Dornseif,Christian N.Klein Core05 CanSecWest,So,after all these steps,we conclude that we*need*to protect the kernel(even from th
22、e own kernel),Breaking into security systems SELinux&LSM,Spenders public exploit(null pointerdereference is a sample):-get_current-disable_selinux&lsm-change gids/uids of the current-chmod/bin/bash to be suid,Disabling SELinux&LSM,disable_selinux-find_selinux_ctxid_to_string()/*find string,then find
23、 the reference to it,then work backwards to find a call to selinux_ctxid_to_string*/What string?audit_rate_limit=%d old=%d by auid=%u subj=%s-/*look for cmp addr,0 x0*/then set selinux_enable to zero-find_unregister_security();What string?%s:trying to unregister aThan set the security_ops to dummy_s
24、ec_ops;),Why this code is so important?,It is a public way to bypass security mechanisms if you have kernel code executionWE HAVE USED IT TO PROTECT SELINUX AND LSM in StMichael;),PaX Details Kernel Protections,-KERNEXEC*Introduces non-exec data into the kernel level*Read-only kernel internal struct
25、ures-RANDKSTACK*Introduce randomness into the kernel stack address of a task*Not really useful when many tasks are involved nor when a task isptraced(some tools use ptraced childs)-UDEREF*Protects agains usermode null pointer dereferences,mapping guardpages and putting different user DS The PaX KERN
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 45085481KIDS Kernel Intrusion Detection System 45085481 KIDS

链接地址:https://www.31ppt.com/p-2910480.html