Slashdot Mirror


Rootkits: Subverting the Windows Kernel

nazarijo (Jose Nazario) writes "A group of people out there, let's call them 'elite hacker d00ds,' are able to skillfully craft Windows rootkits that evade almost any known detection system. Some people want to know how this is done, be they aspiring elite hackers, security professionals who have to try and find these rootkits, or just interested parties. If you're one of them, Grog Hoglund and James Butler's new book, Rootkits: Subverting the Windows Kernel is for you. It's focused like a laser on how to defeat detection at various levels in the Windows OS once you're in." Read on for the rest of Nazario's review. Rootkits: Subverting the Windows Kernel author Grog Hoglund and James Butler pages 352 publisher Addison-Wesley Longman rating 9 reviewer Jose Nazario ISBN 0321294319 summary A highly technical tour of how to develop and detect Windows rootkits

Some may wonder if Hoglund and Butler are being irresponsible by writing a book that shows you how to bypass detection. If you look closely, however, you'll see that all of the methods they outline are detectable by current rootkit revealing mechanisms. And they also show you how to detect many new rootkits in the process. I consider this book to be a responsible contribution to the community, professionals and amateurs alike, in the finest tradition full disclosure.

The book is organized into three major sections, even if it's note explicitly marked as such. The first section serves as an introduction to the topic and some of the high level concepts you'll need to know about Windows, control mechanisms, and where you can introduce your code. The second part is a highly technical tour of the techniques used to hook your rootkit in and hide it, And the third section is really one chapter covering detection of rootkits.

The first few chapters, which serve to introduce the topic, get technical right away. Chapter 2, for example, shows you some basic mechanisms for hooking in your rootkit. If you're getting lost at this point, you'll want to probably augment your reading with a Win32 internals book. The resources listed by the authors, though, are great. By this point you can also see that the writing is clear and the examples contribute perfectly to the topic. Hardware hooking basics are covered in chapter 3, which should give you some indication of the book's pace (quick!).

By the time you get to chapter 4 and discussing how to hook into both userland and the kernel, you're getting at some very valuable material. Although the book focuses on kernel hooking, a brief description of userland hooking is provided. Chapter 5 covers runtime patching, a black art that's not well known. This is almost worth the full price of admission, but the material gets even better.

In chapters 6-9 you get into some serious deep voodoo and dark arts. In these chapters you'll learn the basics of direct kernel object manipulation, layered device drivers (which can save you a lot of work), hardware manipulation, and network handling. All of these are techniques used by rootkit authors to varying degrees and effect, so you should become familiar with them. The code examples are clear and functional, and you'll learn enough to write a basic rootkit in only about 150 pages. Simple keyboard sniffers and covert channels are described in the code examples. Useful stuff.

I can't say I found many errors or nits in the book. There's some problems at times getting the code formatting just right, and what appear to be a few stray characters here and there, but nothing too obvious to me. Then again, I'm not a Windows kernel programmer, so I don't feel qualified to comment on the correctness of the code.

In the finest tradition of using a blog and dynamic website to assist your readers, the authors have set up rootkit.com, which nicely supplements their book. Most of the resources they mention in the book are available here, as well as a great array of contributors and evolving techniques. Without the book the site is still useful, but together they're a great combination. Too many books lose their value once you read them, and some books stay with you because you're having difficulty understanding the authors. Rootkits will stay near you while you develop your skills because it's a lot of material in a small space, and although it's very clearly written, there is a deep amount of material to digest. You'll be working with this one for a while.

My only major wish for this book is for it to have covered detection more significantly. One chapter covers how to detect rootkits, and although you may be able to look for some specific telltale signs of rootkits depending on how they were introduced, a more complete coverage of this approach would have made the book even more worthwhile.

Rootkits is an invaluable contribution in the wider understanding of advanced attack and hacker techniques. Previously, much of this material was known to only a handful of people, and assembling your own knowledge base was difficult. Hoglund and Butler write clearly, use great code examples, and deliver an excellent book on a high technical and specialized topic. If you're interested in learning how to write your own rootkit or detect someone else's rootkit on your system, you should definitely start with this book.

You can purchase Rootkits: Subverting the Windows Kernel from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.

61 of 381 comments (clear)

  1. It is an interesting book by confusion · · Score: 3, Interesting

    Hopefully the hax0rs are not the only ones reading this. There are some valuable lessons for MS and security providers.

    Jerry
    http://www.cyvin.org/

    1. Re:It is an interesting book by ryanr · · Score: 3, Insightful

      What do you think Microsoft is going to do about it? If someone has system access there isn't anything to be done about them moving in with a rootkit.

      Oh wait, did you mean you want Palladium? Microsoft is way ahead of you, then.

  2. My opinion by Umbral+Blot · · Score: 5, Interesting

    I own this book and I thought it was great. I am not a rootkit creator, but I am woking with drivers, and the information this book gives is great for a driver developer. This book is very straight forward and understandable, even for someone with little driver experiance, unlike many resources for driver developers. Also it gives actual source code to illustrate concepts, unlike many books which spend too much time covering concepts and too little getting those concepts to do actual work for you.

    1. Re:My opinion by sean23007 · · Score: 4, Insightful

      I think the fact that a book about rootkits is considered good documentation by a driver developer is demonstrative of the sorry state of affairs of drivers these days. Most exploits and crashes are due to bugs in drivers ... perhaps it wouldn't be so bad if driver developers didn't have to code their driver as if it were hijacking the OS.

      (No offense to the parent post, of course. I'd like better driver documentation too.)

      --

      Lack of eloquence does not denote lack of intelligence, though they often coincide.
  3. I wonder... by squoozer · · Score: 2, Insightful

    ...how long it will be beofre someone tries to ban books like this?

    --
    I used to have a better sig but it broke.
    1. Re:I wonder... by TripMaster+Monkey · · Score: 3, Funny


      If hacker knowledge is outlawed, only outlaws will have hacker knowledge.

      --
      ____

      ~ |rip/\/\aster /\/\onkey

    2. Re:I wonder... by ndansmith · · Score: 2, Interesting

      If they are not banned outright, don't be suprised if your FBI file is augmented when you check this book out from the library.

    3. Re:I wonder... by failure-man · · Score: 4, Funny

      Cash is suspicious. Use a gift card that you bought with cash at a different store. And use a disguise. Nothing's less suspicious than a guy in a trenchcoat buying a book with blackhat potential with a gift card . . . . . . .

  4. Rootkit Sleuthing IRL by chota · · Score: 5, Informative

    Here's a story of some peeps from Microsoft Product Support Services who got a call about a weird crash in Exchange; tracked it down with the debugger, and found a pretty well-hidden rootkit. In fact, it would've remained hidden if it didn't have a bug in it!

    Don't believe everything the debugger is telling you!!! (aka Rootkit)

    1. Re:Rootkit Sleuthing IRL by Monstard · · Score: 2, Interesting

      Wow, I read up on rootkits. Amazing. And hacker defender reads like a manifesto on hacking PCs.

      As I Mac user I keep hearing about how much more secure Macs are than PC's, and sort of believe that. But in reality, what is the true security of a Mac vs. a PC? I mean, I *want* to believe I have the more secure system, but complacency is the surest way to hack a system. So, anybody know the real deal.

      If a Mac hacker was as motivated as any PC hacker, could a rootkit like hacker defender be installed just as easily on a Mac?

  5. We've got to stop them! by The+Woodworker · · Score: 3, Funny

    DMCA...no, that won't work. How about PATRIOT ACT! Yeah, those damn terrorists and their first amendment.

    --
    Give a man a fish and he'll eat for a day. Teach him to fish and he'll wipe out the species.
  6. Don't tell girls you're going to root their box by Anonymous Coward · · Score: 5, Funny

    I was chatting up this chick in a bar last night and I said, "Yeah, I could root your box in about five seconds," and she slapped me! I thought that would impress the chixxors!

    1. Re:Don't tell girls you're going to root their box by GPLDAN · · Score: 3, Funny

      I used to have a machine which had the DNS name "fishysmell". When people asked me why I called it that, I told them "because it's a box."

      Ah.... nevermind....

  7. Hmmmm by chriso11 · · Score: 2, Funny

    I keep thinking I need this book just to secure my own PCs and also help out friends...

    You have to love the windows environment.

    --
    No, I don't trust in god. He'll have to pay up front, like everybody else.
  8. Re:Obligatory spelling/capitalization gripe by SlayerofGods · · Score: 4, Funny

    Yah I saw them too. Everyone knows it's not 'elite hacker' but rather 'l33t hax0r'
    Damn editors.

    --

    Technology, the cause of and solution to all of life's problems.
  9. Re:Great! (not) by Anonymous Coward · · Score: 2, Insightful

    It is nice to see that you took the time to post a knee-jerk response, but could not be bothered to read the first paragraph of the article.

    Some may wonder if Hoglund and Butler are being irresponsible by writing a book that shows you how to bypass detection. If you look closely, however, you'll see that all of the methods they outline are detectable by current rootkit revealing mechanisms. And they also show you how to detect many new rootkits in the process. I consider this book to be a responsible contribution to the community, professionals and amateurs alike, in the finest tradition full disclosure.

  10. Does this still work? by meditation_dude · · Score: 2, Informative

    I remember people had Linux boot disks for changing the Windows NT admin password. But does this kind of thing still work for Windows XP and the server editions? I wonder if Microsoft will take this info and use it in Windows Vista to counteract rooting.

    1. Re:Does this still work? by TripMaster+Monkey · · Score: 3, Funny


      But does this kind of thing still work for Windows XP and the server editions?

      Short answer: yes.
      Long answer: hell yes.

      There is no such thing as security if you have physical access to the box. Period.

      --
      ____

      ~ |rip/\/\aster /\/\onkey

    2. Re:Does this still work? by morgan_greywolf · · Score: 2

      There is no such thing as security if you have physical access to the box. Period. Exactly. You could boot from alternate media, swap hard drives, or heck, you could even just put the system hard drive(s) in your pocket. That's why locking down desktops is basically pointless for anyone that knows what they're doing.

    3. Re:Does this still work? by Grantmillie · · Score: 2, Informative

      One thing I just recently learned when trying to recover files from a bad boot sector drive along the same lines is Windows security for protecting profile specific data (my documents etc.) can just as easily be hacked using nothing more than windows. All you have to do is load the drive on another windows machine, when you try to view the files and you get an "access denied" message, merely go through the advanced security settings on the folder and there is the option to apply your own security settings directly over the old ones. Bam, easy access.

    4. Re:Does this still work? by RetroGeek · · Score: 3, Insightful

      There is no such thing as security if you have physical access to the box. Period.

      Which is why you need disk encryptors. The entire disk is encrypted. Go ahead, access it outside the OS environment. All you get is random bits.

      Yes, you can try to brute force the password, but that takes many, many CPU cycles, and much time.

      Google it

      --

      - - - - - - - - - - -
      I am a programmer. I am paid to produce syntax not grammar. Deal with it.
    5. Re:Does this still work? by SharpFang · · Score: 3, Funny

      You can always booby-trap the case.

      --
      45 5F E1 04 22 CA 29 C4 93 3F 95 05 2B 79 2A B2
    6. Re:Does this still work? by lgw · · Score: 2, Insightful

      Encryption on disk helps, but like any security measure, it merely delays the attacker. Unless you do file-by-file encryption without any help from the system in storing the keys, of course, but that's not the normal case (and these days any key you can memorize is weak).

      Beyond that special case, NOTHING is safe vs an in-circuit emulator. If the machine can access those files, the key is in memory at some point. If I can't give myself rights to debug that point, I'll replace the CPU with a hardware emulator that lets me have my way with *everything* without any running process being the wiser. (ICEs are actually very cool to work with, great for recovering source from encrypted object code and other fun tricks.)

      Physical access to a machine is access to the data, sooner or later.

      --
      Socialism: a lie told by totalitarians and believed by fools.
  11. Root a box by totallygeek · · Score: 2, Informative
    In Australia, to root something is to have sexual intercourse with it. So, chatting with some chick about rooting her box may get you a slap. You should buy her a drink first.


    Where I learned this. Well, about the rooting, not about the smoothing over chicks.

    1. Re:Root a box by Aardpig · · Score: 4, Funny

      Outside Australia, in the rest of the world, to explain the joke as though nobody else gets it is to demonstrate that you don't have much of a sense of humour yourself.

      --
      Tubal-Cain smokes the white owl.
  12. Wow by ryanr · · Score: 3, Interesting

    I don't think I've ever seen Jose be so complimentary about a book before. Nice job, guys. I have the book as well, and I like what I've seen so far, but I haven't read enough yet to comment meaningfully.

    I will point out though that the rootkit.com site has been around for a few years now, and obviously predates the book. In fact, I hope the book will explain in greater detail a lot of the technical topics from the site that are often only presented via code.

  13. Re:The great thing about this book by defile · · Score: 3, Insightful

    It's also a useful tool for advocates who try to convince people to switch from Windows to another OS (no, not just Linux), the argument being "look, you wonder if Windows is insecure? how about a whole friggin book, with an ISBN and all, about how to do nasty things in Windows despite A/V software and anti-spywares!"

    Which OS were you talking about? I could swear the ones you might name have hacking books written about them too.

  14. w00t by vga_init · · Score: 3, Funny

    r0x0rz j00r b0x0rz, d00d

  15. Re:Obligatory spelling/capitalization gripe by anandamide · · Score: 5, Funny
    Okay, so after glancing at the first two paragraphs, I had immediately caught three typos/spelling errors/capitalization problems. ARGH.


    Sorry, that's spelled 'ARGV'.

  16. Fat bloated kernels by drgonzo59 · · Score: 4, Interesting
    The lesson in this article should be also that there is something wrong with the Windows kernel if there can be written whole books about how to make rootkits for it. The same can go for the Linux kernel. (Yeah that's right, I bashed _the_ penguin on the head, mod me down!)

    Kernels are so big and bloated that there is almost %100 chance of there being some exploitable whole in them. If the "good hackers" discover it, it will be patched, if the "bad hackers" discover it, they will make rookits.

    A lot of the code that is not tested and buggy is in the drivers, and I don't understand why do current operating systems still have drivers that are run in the kernel instead of in the user space. The machines are fast enough to switch contexts between the display, mouse, sound, disk and communication with the ports. The kernel should be very small and only implement the security policies and handle communications between devices. If the hacker manages to exploit a hole in the display driver, the driver will not crash the system. These are called secure microkernels or separation kernels. I think the present 4Ghz machines can hangle a %10 slowdown at the expense of say, %80, improved security. In 18 months, the speed will double anyway ;)

    Check out this paper from NIST that talks about this. Also, more general info about it here

    1. Re:Fat bloated kernels by arkanes · · Score: 5, Informative

      You can make a rootkit for any OS, even a minimal microkernel, unless your OS runs out of ROM or there's similiar hardware level measures in place. A rootkit is the end result of an exploit, not an exploit itself - the tricky part is getting sufficent access to install a rootkit.

    2. Re:Fat bloated kernels by lgw · · Score: 2, Insightful

      The preformance / security tradeoff was a bit different 13 years ago. The best decision in 1992 isn't necessarily the best decision today. Folks are *far* more concerned about security today, and CPU performance doesn't seem as large a concern.

      This sort of slow change is normal in any engineering field. You have to adapt to changing materials and changing requirements.

      --
      Socialism: a lie told by totalitarians and believed by fools.
    3. Re:Fat bloated kernels by drgonzo59 · · Score: 2, Interesting
      The point of the post of was that in 1992 the top of the line might have been 60MHz machines, now you can overclock a pentium to 6Ghz, so we are talking about 100x speedup. The bus+memory didn't speed up as much, but still it many times faster. So in 1992 you couldn't do context switches fast enough, today you can and you might not notice much of a difference.

      The problem is that people do want performance, but after their box gets rooted and their hard drive erased, they tend to change their priorities. I sure could have lived with a 10% slowdown and play Quacke at 90 fps instead of 100 fps if that meant that I had a more secure OS and my box did get rooted.

      In 1992 for Linus, performance was very important. I don't think he anticipated the popularity of Linux and that one day people would be using it on their desktops and they will be connected to the net, and script kiddies will turn them into zombies.

      But it is not 1992 anymore and I think it is time to reconsider. Security is becoming more and more important and slowdown can be compensated by just buying a faster CPU next year.

    4. Re:Fat bloated kernels by SLi · · Score: 2, Interesting

      (no, 20% efficiency/speed lost is NOT an acceptable loss)

      I've been wondering about this. In a huge number of cases I would gladly swap 20% or even 50% of the speed for absolute guaranteed security. And in my opinion in lots of cases it would be the obviously correct choice (if there was such a choice, that is). What makes people value their security so little?

    5. Re:Fat bloated kernels by grozzie2 · · Score: 3, Interesting
      The kernel should be very small and only implement the security policies and handle communications between devices.

      This is all fine and dandy in theory, but, out here in the real world, device drivers still have to talk to hardware directly. When a device driver sends commands to hardware that will effectively pre-empt data bus operations at the hardware level (outside of cpu control), you have to sit back and go 'gotta trust the driver code'. Unless the kernel has full knowledge of the consequences of all hardware i/o operations, it's really pointless to run it thru a mapping layer so that the kernel actually does the io on behalf of a higher level program.

      I remember once many years ago, somebody showing me a shiny new install of WindowNT, and they were telling me it was a secure, crash proof box. I chuckled, and took a look at some of the installed hardware. I then proceeded to sit down, start 'debug', write a value to one video port, and another value to another video port. Screen went blank, machine sat there for a while, then it reset. It's not hard to set a video card into a state where it's going to assert wait on the memory bus until an event occurs, yet pre-program the device so that the event will never occur. At that point, the main bus is effectively dead, the cpu can no longer access memory, game over. This 'exploit' took advantage of a not so well known flaw in Video Seven graphics controllers.

      The hardware attached to the various busses on modern computers has the ability to halt/corrupt the bus. As long as that's the case, there's no point trying to put a kernel layer in between to 'protect' the system, unless the kernel layer has full knowledge of all aspects of the hardware in question, and will prevent such conditions from being set up. This is typically the responsibility of [drum roll] the device driver for the device [/drum roll].

      If you are suffering from driver instability problems, then, you are part of the problem. You chose to buy the cheapest crap, and then sit back blaming 'somebody else' because the driver support is crap. You had the opportunity to vote with your wallet, buy stuff that's well supported, and doesn't have stability problems. If the market as a whole actually used this 'vote with the wallet' clout, the state of affairs would be different, because only vendors providing good support would survive in the marketplace. Sadly, that's not the case. The market is driven by 'the cheapest price' and you get what you pay for.

      The computer I'm using to write this, doesn't have any driver stability problems. I paid a little extra to get a set of video cards (plural, I have 3 displays on this computer) that would operate cleanly, and not cause problems in a multi-display environment. I paid a little extra for a motherboard that's known to be solid and reliable. I paid a little extra for a disk that doesn't have a history of failures.

      I voted with my wallet, because I understand, it's not physically possible for an operating system running on the cpu to recover from problems generated in the hadware. If a given device corrupts a data bus, or asserts reset at the wrong time, there are going to be problems. The key is, buy the devices that dont do that, and choose the ones that have a track record of good software support in the form of drivers.

      I have zero sympathy for folks that complain about buggy drivers all the time. It was your choice to buy the crap hardware. You saved a few bucks, and bought a stack of aggrivation. That's your choice, but, there were other choices. You could have chosen to make informed purchases, and buy based in quality rather than price.

      As long as the operating system is something that runs ON TOP OF THE HARDWARE, it's going to be subject to the problems of the hardware. The software support for the hardware is part and parcel of the package. Isolating drivers up to user space is NOT going to solve the problem, because that driver is still going to be manipulating dat

    6. Re:Fat bloated kernels by drgonzo59 · · Score: 2, Insightful
      Did you read the post at all? I was not talking about Mhz to performance ratio in different pentium and amd models. The point was that there was a _large_ speed increase in processing power since 1992 - that is all you should read into it. If you think there wasn't a _large_ speed increase in the last 14 years, then you don't live in the real world. It might not have been 100x it might have been 90.3x, that is not the point!

      In _general_ on the same processor the faster the clock speed the greater computational throughput. If Mhz!=speed, then underclock you machines to 100Mhz, see if you'll notice a difference...

      I can run 10Ghz over a copper wire, WHOA that is fast.

      Good for you. Whatch the output power and keep it away from the brain and the reproductive organs.

    7. Re:Fat bloated kernels by Krach42 · · Score: 2, Insightful

      I'll take this one on. Let's start with minimal microkernel, then build ontop of that an OpenBSD like subsystem. (just because it has the resources that I'm aware of, and will be using.)

      Now, all the absolutely vital system components that could be used for the exploitation of the system for a rootkit. Mark those system immutable.

      Now, the hacker needs physical access, and single user mode to hijack your system. I'd call that as secure as you can get.

      Now, granted... like you said, this is the end of the exploit. If they had sufficient eploits to get physical access and single user mode, well then, I suppose they *could* install a root kit.

      But how many script kiddies do you let into your house?

      --

      I am unamerican, and proud of it!
    8. Re:Fat bloated kernels by Thuktun · · Score: 2, Insightful

      You can make a rootkit for any OS, even a minimal microkernel, unless your OS runs out of ROM or there's similiar hardware level measures in place. A rootkit is the end result of an exploit, not an exploit itself - the tricky part is getting sufficent access to install a rootkit.

      Depends on whether you're talking a remote or local rootkit, doesn't it? All bets are off when you can tweak the machine directly, but an OS can be secured sufficiently to not run any code from the outside.

    9. Re:Fat bloated kernels by pegr · · Score: 2, Funny

      You can make a rootkit for any OS, even a minimal microkernel, unless your OS runs out of ROM or there's similiar hardware level measures in place.
       
      That's it, I'm breaking out my Commodore 64!

    10. Re:Fat bloated kernels by billsoxs · · Score: 2, Interesting
      I'll take this one on. Let's start with minimal microkernel, then build ontop of that an OpenBSD like subsystem. (just because it has the resources that I'm aware of, and will be using.)

      Now, all the absolutely vital system components that could be used for the exploitation of the system for a rootkit. Mark those system immutable.

      Wouldn't this also stop auto updates and similar? Of course provided that your code is perfect the first time there would be no need - but as a previous post pointed out - we is human and we makes mistakes

      --
      This message was brought to you by "Lack of Sleep."
  17. Shameless plug by republican+gourd · · Score: 3, Interesting

    Since its vaguely on topic, and I'd like feedback if I can get it, here is some shameless whoring for a Free rootkit detection program I wrote:

    Heres the URL

    This is a multithreaded script that establishes socket connections between the threads and tries to pass a keyphrase between them. The assumption is that even if windows is compromised, a successfull TCP connection will indicate that the port is really not in use, regardless of what netstat says. Unless a rootkit is slick enough to make multiple programs share a port regardless of SO_REUSEADDR, this should catch it. The drawback, unfortunately, is that it can take a significant amount of time to scan 65,000 odd ports in this manner. Anyway, its GPL, so have at it.

    1. Re:Shameless plug by republican+gourd · · Score: 2, Informative

      This could be largely incoherent, its been a long day:

      Regarding the "hop around the port numbers" tactic, depending on how much hopping they do, this would actually make them more findable. One of the major issues I ran into writing this script in originally was what happens to a socket set once the connection is dropped. The TCP/IP stack doesn't actually remove the connection, it sits around in a waiting-for-death state (I have forgotten the actual technical name at the moment) until it has been idle for the timeframe of twice the maximum time to live. The technical reason for this is that it is conceivable that some errant packet may go all the way out by 1 ttl unit, and then wander back by 1 other ttl unit, and until it is no longer possible that any packets will make it home, the stack holds onto that port rather than reassigning it a new connection.

      The fun part here is if my scanner scanned numerically, and the OS also is assigning outgoing ports numerically, what you end up with is a mess of everybody stomping on themselves in order (crashing on 1000, then 1001, then 1002... etc) for hundreds and hundreds of ports.

      What a port-hopper would run into a situation where his *old* connection, even if he had given it up, would still show up on the scanner as 'in use' for something on the order of an entire minute after the connection was dropped. A substantial amount of port hopping would (after some mathematically calculatable limit) actually make you more easily detectable.

      Regarding the client/server version, that wouldn't alleviate my biggest concern: a patched network stack that does an inspect/pass on of interesting packets. If the rootkit is capable of saying "hey, thats mine!" and holding packets that it knows are intended for it and simply passes on all other packets to the "real" port, it wouldn't need to worry about whether or not the machines talking to it were rootkitted or not. They could concievably simply use the Evil Bit for that determination.

      I don't think our local script kiddies are going to be that clever though. The way I figure it, if we can force the kiddies to push deeper into the kernel to avoid detection, the harder it will be for their tricks to be version independent and the better off we'll be.

  18. The need for ROM kernels by G4from128k · · Score: 5, Interesting

    The core problem with detecting a rootkit is that the detection software would seem to need to run inside the infected codespace. Unless the detector is 100% self-contained (e.g., involves NO calls to OS API during the detection process) the detector is itself detectable and defeatable by a skilled rootkit. Since invoking any software on a running system means calling APIs of that system (to read the executable, spawn a new process, etc.) and those APIs are not trustworthy on a rooted system, detection seems like a tricky problem.

    The solution is either to boot the detector from its own media (inconvenient if you want to scan your system for rootkits on any regular basis) or to create a ROM core to the OS that is totally incorruptible. To be safe, this core needs to be not patchable or modifiable by any software running outside the ROM.

    The point is that no computer can trust code fragments stored of writable media. The only way to really secure a system is with hardware (i.e., functionality embedded in a chip) or ROM-based software.

    Moving to ROM isn't without its challenges. The writers of the code will actually need to be very good at their jobs because they won't be able to fix the problem later with a simple patch. But maybe the core of an OS should be this way -- based on very well-written code that does not need patching.

    --
    Two wrongs don't make a right, but three lefts do.
    1. Re:The need for ROM kernels by Animats · · Score: 5, Insightful

      A secure microkernel is quite possible, but, as Ballmer once said, "If we stopped adding features to Windows, it would become a commodity, like a BIOS. And Microsoft is not in the BIOS businees".

  19. Re:Although good for security experts, by g0bshiTe · · Score: 2, Interesting

    I doubt it would do them much good, I suppose you would have to have more technical knowledge than the average script kiddie to make effective use of this title.

    Not to mention know how to read.

    --
    I am Bennett Haselton! I am Bennett Haselton!
  20. And with it I can hack the gibson in 3 seconds ... by PalmKiller · · Score: 2, Funny

    oh nevermind

  21. No Obligatory Snipery? by sadomikeyism · · Score: 3, Funny

    Where is the "I for one welcome our rootkit overlords"? Or the "ALL YOUR ROOT ARE BELONG TO US"?

    --
    "Necessity is the plea for every infringement of human freedom. It is the argument of tyrants; it is the creed of slaves
  22. Re:The great thing about this book by LurkerXXX · · Score: 3, Insightful
    Yeah, it'd be terrible to use an OS with rootkits available for it.

    Instead of windows they could switch to Linux or a *BSD or MacOS.

    Oh wait, almost all OS's out there right now have rootkits for them.

  23. Rootkit revealer by markh1967 · · Score: 4, Informative
    If you run Windows and want to check if your system has a rootkit installed try running Rootkit revealer.

    It scans all files and registry entries at a high and low level then compares the two to see which files and registry entries were hidden to the high level scan.

    --
    Input error. Replace user and press any key to continue.
  24. predictions? by dioscaido · · Score: 2, Insightful

    How many readers won't know what a root kit is, and declare 'ha, see! windowze is insecure, glad I run [alternate]'? :}

  25. Re:Great! (not) by jurt1235 · · Score: 3, Insightful

    If you are running MS windows, is it then really your computer? Look good at the licensing, it might reveal some things in the really small print......

    Ok, you got moderated as a troll, this should really score good!

    --

    My wife's sketchblog Blob[p]: Gastrono-me
  26. It works - unless you encrypt the filesystem by arete · · Score: 2, Informative

    If you encrypt the Windows Filesystem then there is no trivial way to get the data without the decryption key. This is breakable given time, etc. depending on how strong the encryption is.

    It also makes it a royal pain to recover if certain things go wrong.

    If you DIDN'T encrypt the filesystem then it is absolutely trivial to change the admin password, to put the disk in another machine, to boot linux and read the HD... etc. Because the data is completely insecure.

    This is COMPLETELY THE SAME on Linux. You can boot any normal linux install from a boot disk and reset the root password. Actually in Linux you don't even usually need a disk, you just need to enter init=bash in LILO (depending on LILO/Linux settings; this can certainly be turned off)

    Security means not giving people physical access, or at a minimum restricting the boot sequence to only be harddrive, locking the CPU, locking the BIOS and locking the boot loader. This is true in any OS.

    --
    Looking for freelance Actionscript (Flash/Flex) or ColdFusion work and/or freelance developers. Email me, put Slashdot
  27. Re: Is it easy to get rooted for Macs? by chota · · Score: 5, Informative

    Well, it's not really an Apples-to-Apples comparison, of course. But to answer your question, No, it could not be installed "just as easily." However, once installed, it might be "just as difficult" to remove or detect. :)

    Two main points:

    1. It all comes down to default user permissions. On Windows (by default), everyone is an admin, so, with one wrong click, and you really can bring your system to its knees. With OSX, users are just users by default, and you have to authenticate to install something potentially nasty. I've observed that the actual *authentication* (typing in a super-user password, different from your own) is enought to get a user sit back and think "Gee, maybe I shouldn't do this." Contrast this with the Windows equivalent of a popup with 2 buttons, "Run" and "Don't Run." People condition themselves to click the "Run" button automatically. This is because of the inherent differences in the OS.
      • Windows has a legacy of having its users being administrators; therefore, the vast majority of Windows apps assume that they can write files and registry entries willy-nilly. (If you don't think it's that bad of a problem, talk to a knowledgable and responsible Windows network admin, trying to secure a general-access lab that MUST have Adobe and Macromedia apps on it -- it's a nightmare, I tell you)!
      • Mac OSX, in contrast, since it didn't have a "legacy" (i.e., it was architected from the ground up, and purposefully did NOT include backward-compatibility), all apps written for OSX simply must be written to the security spec, or they simply won't work. Additionally, with 10.4, Apple has proven that they care more about security and logic in the OS than backward compatibility (whether you think that's good or bad, it's there) -- witness the extreme breakage of pretty much every non-Apple OSX network utility.
    2. OSX has Single User Mode . There is no Windows equivilent. Safe mode is a laughable comparison. With OSX's Single User Mode, you can pretty darn easily clean up our theoretical infected machine.
    3. Third point that doesn't really count: Although I hate to stereotype; Apple users are generally smarter than Windows users. There, I said it.

    Disclaimer: I am a Windows network admin (and MCSE:2003 certified), but I lead a double life where I use and administer a small network of Macs.

  28. Ugh. by Sheepdot · · Score: 5, Informative

    I hate it when non-technical posts get rated as informative. First off, as others here have misstated, rootkits are essentially malicious drivers or kernel-level backdoors. They are *not* exploits, not bugs, and not driver cracks. Rootkits are essentially malware that runs at a higher level than most malware, with the intention of using API-hooking to misreport filesystem, process, and network status. The expertise required to make them is generally several orders higher than DDOS zombies or botnets. Though ironically, that same kind of malware is almost always installed and then subsequently hidden by the rootkit after one is installed.

    I only felt it necessary to mention this because of those individuals who seem to think rootkits themselves are exploits to get escalated privileges. While some rootkits get installed via "shatter attacks" and other priviledge escalation exploits, they themselves aren't doing any exploiting.

  29. Yes, rootkits are now in Malware by ErikTheRed · · Score: 4, Interesting

    I found an interesting pop-up generating piece of malware several weeks ago that appeared to use rootkit-type techniques to hide itself. It was invisible from the process lists (including the nicer command line ones) and the filesystem. I was able to track it down and delete it (unfortunately, the machine was several hundred miles away and I was working on it remotely, otherwise I would have booted off a CD and made a copy of the little bugger), but it was a royal pain in the ass to do.

    For the interested (some of the details might be slightly off because I've consumed a lot of booze between then and now, but the overall gist is correct), I found the malware by using SysInternals RegMon to find the process ID that kept replacing the registry entries that loaded it. That Process ID couldn't be killed by any of the tools I could find (because they check to see if the pid is valid before trying to terminate it, and it had stealthed itself to the point where the ID appeared to be invalid ... grrr). So I used ProcMon to kill any threads associated with the pid - the process was invisible, but you could still find the threads by which libraries they were using and kill them there (use the search command). Once the threads were killed, I could overwrite the loader file (you couldn't read it, copy it, list it, etc., but it would give you an error if you tried to overwrite it while the threads were running).

    --

    Help save the critically endangered Blue Iguana
    1. Re:Yes, rootkits are now in Malware by value_added · · Score: 4, Interesting
      Your post reminds me of something I read on the NTBugTraq mailing list. I don't have a link so I'll quote it below.
      CWS, CoolWebSearch, is a particularly nasty incarnation of ad-ware. CWS is widely discussed on the web, but it's poorly understood and procedures to remove it are often lengthy, cumbersome and ineffective. ... The shield-DLL installs itself to the following registry value in NT4-type systems:

      HKLM\Software\Microsoft\Windows NT\CurrentVersion\Windows\AppInit_Dlls

      Per MSKB 197571, a .DLL listed there is "loaded by each Windows-based application running within the current logon session." IOW, any ad-ware found here runs concurrently with _every_ program launched. It is truly astonishing that such a registry location exists.

      Here's what the CWS shield-DLL manages to do:

      1. It prevents almost all registry editors from displaying it as an AppInit_Dlls value. This list includes, but is not limited to: Regedit.exe (even if renamed), Regedt32.exe, Reg.exe, Autoruns, HijackThis, and, my favorite (because I wrote it), the "Silent Runners.vbs" script. The _only_ program known to display it, for unknown reasons, is the freeware Registrar Lite 2.0, available here: http://www.resplendence.com/reglite/

      2. It prevents all GUI and command line tools from listing it or deleting it. This list includes, but is not limited to: Windows Explorer, DIR, ATTRIB, CACLS, and DEL.

      3. The .DLL file has eccentric security permissions (SYNCHRONIZE and FILE_EXECUTE) and is READ-ONLY. Once the shield-DLL is removed from memory, an Admin must reset security to delete the file.

      4. It has a unique name on every system it infects.

      5. It ensures that a BHO starts up with IE at every boot.

      6. If the BHO is deleted, it restores the BHO under a new name at the next boot.
      I'm sure you'd agree it's interesting reading. The conclusions one can draw are numerous, but I can't resist the comment that every time the folks at at Systernals decide to write a program, Microsoft should feel embarrassed.
  30. Re: Is it easy to get rooted for Macs? by linuxfanatic1024 · · Score: 3, Informative

    Not true? Yes it is. Windows XP sets up one admin account for the user, and it doesn't encourage using an unprivileged account. In fact, most Windows users think that it is best to use the admin account all the time (because of the reasons I just mentioned and also the fact that so many USER APPLICATIONS need administrative privileges (like games) when they really shouldn't need these privileges.

    --
    Microsoft-free since March 28, 2004
  31. Re:Why are you reviewing this book? by slavemowgli · · Score: 2, Interesting

    Oh, I sure do. I once briefly worked in a clinic for neurosurgery once (this was a summer job during school; I wasn't actually involved with the medical side of things in any way) - it was rather scary at times.

    We also a considerable amount of accident victims, too, though, and in the case of those, I think that even a 33% chance to improve isn't so bad, because otherwise, they'd have a 100% chance of dying.

    --
    quidquid latine dictum sit altum videtur.
  32. I have a Palladium prediction by TheNarrator · · Score: 3, Interesting

    I think when the Palladium platform is released, it will eventually be hacked or otherwise subverted by rootkit hackers. The rootkits will use the DRM restrictions of Palladium to prevent any tool from removing the rootkit. People who's computers get infected by these Palladium rootkits will be forced to throw entire computers out.

    1. Re:I have a Palladium prediction by ryanr · · Score: 2, Interesting

      I've not heard of any proposal for nonvolitile storage for Palladium. So worst case, you'd have to reformat your hard drive and reinstall. Or are you being sarcastic?

      To address part of your point though, I DO believe that it will be possible for someone to find a hole inthe Palladium software, and install a rootkit on the "Secure" side. If they do it right, then you might have to reformat to get rid of it.

  33. Re:Linux does this well. MS's approach is broken. by ryanr · · Score: 2, Insightful

    You've asked about three things:

    -How does one install a rootkit on a running box, while minimizing traces left behind
    -How do you leave your rootkit code on the machine such that booting it off of secure media and checking hashes of a class of files won't detect any changes
    -How do you maintain control over the machine from early in the boot process. Note that this isn't the only was to hide, depending on exactly what is checked in question two.

    How to get on the box in the first place is the easiest step. It's done all day, every day. Buffer overflows are not a solved problem. Buffer overflows are not the only way to break into a box. Your questions about binary signatures, hashes etc... at this point do not matter. You have nothing checking binaries on the fly. Or I can do my work using binaries with a perfectly valid signature, or binaries that already exist on the system. Or I can do everything in RAM. I believe all the popular exploit frameworks have options that work straight out of RAM. I know Metasploit does. I can install the rootkit into the live kernel by modifying kernel RAM. That was done several years ago.

    Question two: So, describe your file checking process to me. I believe you may have been originally talking about the RPM hash checking. That only covers a portion of your files. What about config files, your mail spool, your temp files, your documents, your log files, your profile files, and on and on. There are all these places code could be hidden. And then there is slack space, unused sectors, unpartitioned space, etc... Hiding isn't a problem.

    The third question is really the only hard one. There are simple cases, like DOS. Bootsector viruses are 20+ years old on DOS. Here's how I'd do one for Linux, conceptually. I wouldn't want to actually tackle this, mind you...

    Every operating system that wants to boot from a hard drive on a PC has to go through a particular process. After the BIOS is done, you sector 0, and start running it. Sector 0 knows enough to get to a several sectors, which know a little about a filesystem, which know how to find an OS-specific file, which switches the machine into real mode, and can load a disk driver, or a kernel, and so on.

    So, I would substitute a part of the boot sector or the next chain of sectors in the process. Instead of loading the next piece that gets us to the real grub, I load my modified grub, which I have hidden on the disk. My modified grub loads my modified kernel, which I have hidden on the disk. From there, I can use the rest of the real filesystem.

    The trick is, if you boot from a CD and inspect the filesystem, you find the original grub and kernel files. If you try to check things once Linux is up, my modified kernel is feeding you a version of reality that matches what you expect. I.e. if you check grub and the kernel file from the running Linux, it hands over copies of the original files for you to inspect.