Slashdot Mirror


How To Guarantee Malware Detection

itwbennett writes "Dr. Markus Jakobsson, Principal Scientist at PARC, explains how it is possible to guarantee the detection of malware, including zero-day attacks and rootkits and even malware that infected a device before the detection program was installed. The solution comes down to this, says Jakobsson: 'Any program — good or bad — that wants to be active in RAM has no choice but to take up some space in RAM. At least one byte.'"

21 of 410 comments (clear)

  1. Theory and Reality by ircmaxell · · Score: 4, Insightful

    In theory, theory and reality are equivalent. In reality, they are quite different...

    Seriously, how could this possibly work for ALL (including undocumented, and hereto unknown) threats? And if it does it by reading straight from RAM (through the kernel), wouldn't a rootkit be able to trivially defeat that?

    --
    If a man isn't willing to take some risk for his opinions, either his opinions are no good or he's no good
  2. In case anybody was wondering... by fuzzyfuzzyfungus · · Score: 5, Informative

    He is indeed selling something...

  3. Still a needle by dmgxmichael · · Score: 4, Insightful

    A needle in a haystack wants roughly the same amount of space as a straw - doesn't make it any easier to find (indeed, that's part of the reason it's so hard to find).

    Even if this technique has merits, it does nothing to correct the primary reason for computer infection - stupid users.

    1. Re:Still a needle by mooingyak · · Score: 4, Insightful

      I think god has a monopoly on causing death in that department. (Take that last sentence however you will. Just remember: however you take it is how I meant it.)

      You're sleeping with your mother? Gross.

      --
      William of Ockham had no beard. The most likely explanation is that it was chewed off by squirrels every morning.
  4. Which one is the detector? by mangu · · Score: 4, Insightful

    How about a malware that masquerades as this detector and reports the RAM checksum is OK?

  5. Re:At least one byte by palegray.net · · Score: 4, Informative
    I don't normally quote huge chunks of articles, but I'm making an exception on grounds that I don't believe you RTFA before replying:

    Assume now that we have a detection algorithm that runs in kernel mode, and that swaps out everything in RAM. Everything except itself. Well, malware may interfere, of course, as it often does, and remain in RAM. But if we know how big RAM is, we know how much space should be free. Assume we write pseudo-random bits over all this supposedly free space. Again, a malware agent could refuse to be overwritten. It could store those random bits somewhere else instead... like in secondary storage.

    Then, let us compute a keyed hash of the entire memory contents -- both our detection program and all the random bits. Here is what could happen: If there is no malware in RAM, the results will be the expected result. An external verifier checks this, and tells us that the scanned device is clean. Or there could be malware in RAM, and the checksum will be wrong. The external verifier would notice and conclude that the device must be infected. Or malware could divert the read requests directed at the place it is stored to the place in secondary storage where it stored the random bits meant for the space it occupies. That would result in the right checksum... but a delay. This delay would be detected by the external verifier, which would conclude that the device is infected.

    Why a delay, you ask? Because secondary storage is slower than RAM. Especially if the order of the reads and writes are done in a manner that intentionally causes huge delays if diverted to flash, hard drives, etc.

    There's more details in RTFA.

  6. Re:At least one byte by dmgxmichael · · Score: 5, Funny

    Not a fair comparison. Malware usually does what it's supposed to.

  7. "Guarantee" by Reason58 · · Score: 4, Insightful

    You can't guarantee anything in security. Especially when a human is involved.

    1. Re:"Guarantee" by dmgxmichael · · Score: 4, Funny

      Reminds me of Murphy's 7th law - "Should you ever idiot proof anything God will make a better idiot."

  8. Malware detection is Bogus. by bmo · · Score: 4, Informative

    How about we change things in Windows so it actually prevents infection in the first place?

    1. Educate users. Microsoft does a piss-poor job of this.
    2. STOP DEPENDING ON 3 MAGIC LETTERS TO DETERMINE IF SOMETHING IS CODE OR DATA. COME ON, SERIOUSLY. THIS SHOULD HAVE DIED WITH CP/M.
    3. Kill ActiveX - I know of no legitimate website besides Microsoft.com that requires ActiveX.
    4. If a file comes in from the outside world - STRIP ITS PERMISSION TO EXECUTE. MAKE THE USER UNPACK IT FROM AN ARCHIVE OR SET ITS PERMISSION.

    Really. Seriously.

    No, the above won't cover every situation, but it's a pretty good start.

    --
    BMO

  9. register by bugs2squash · · Score: 4, Interesting

    Some processors may have big enough register sets that malware could reside entirely within the CPU.

    --
    Nullius in verba
  10. Some amazingly bad assumptions by nahdude812 · · Score: 5, Insightful

    Sure, malware has to occupy memory. That doesn't mean it has to be its own memory. Buffer overflows are all about corrupting another application's memory space.

    His basic argument is that if you want to scan RAM, the kernel can halt all processing except its RAM scanner, and have a go at the RAM safely. If it's particularly insidious malware, it'll try to hide itself in various ways, one of which would be to masquerade the portion of RAM it was using with something legitimate looking (maybe erase that portion of memory). But you know it did this because you can see that memory which was supposed to be free is no longer free. Except the hardware has no concept of free or occupied memory. It just has memory, and the OS keeps track of what's free and not. The OS - the same space where malware is running.

    OR, the malware could simply not do this, then its behavior is no different from any legitimate program. So how do you detect it now? You still need definitions that say, "When running in memory, this virus looks like X," then look through memory for that pattern.

    Besides, who's to say that the kernel space is guaranteed free of malware itself? Even if you would have successfully identified the threat in RAM, you have no guarantee that the malware hasn't corrupted the identification routine.

    It's like someone came along and said, "Hey, you guys are looking for malware wrong. You have to look for it! And I mean really look for it!"

  11. Re:At least one byte by Chris+Burke · · Score: 5, Funny

    While it might be true that any application will take up at least a byte of memory, there is no reason malware couldn't masquerade as another binary down to the exact number of bytes.

    Oh see he didn't finish explaining.

    Any program that wants to be resident has to occupy at least one byte of RAM. And that byte should include the Evil Bit, which all malware should set. Then your anti-virus program just checks the Evil Bit and problem solved!

    --

    The enemies of Democracy are
  12. Refuting the imaginary article in your head by spun · · Score: 5, Informative

    Still haven't read the article, eh? The technique is to swap everything out except the scanner, then write random bits to the entire memory space, then hash the memory. I could explain it all in greater detail, but, you know, there's this article, already there. Please do try to constrain your criticisms to things that actually apply to the article that was written, you know, the one we can all read. Refuting the imaginary article in your head does nothing for the rest of us.

    --
    - None can love freedom heartily, but good men; the rest love not freedom, but license. -- John Milton
    1. Re:Refuting the imaginary article in your head by spun · · Score: 4, Insightful

      Protection from malware should function like the immune system, with many lines of defense and many avenues of detection and counter attack. Prevention will never be perfect by itself.

      --
      - None can love freedom heartily, but good men; the rest love not freedom, but license. -- John Milton
    2. Re:Refuting the imaginary article in your head by Romancer · · Score: 4, Insightful

      I'm not an expert and not sure if I'm missing something obvious here but what is confusing me is the part about "swap everything out except the scanner". Wouldn't you then just be moving the malware too? Into a protected space that you then have to scan and know what to look for?

      If it's a zero day infection then you don't know what to look for and you swapped it out of memory for nothing really. I do get that if it tries to protect itself it will look suspicious but what if it looks like a normal program? A service or scheduled task that could be normal. What if it takes on the guise of an adobe update program in size/hash and function until it is time do act? Say a slight change to your systems dns entries. Then goes dormant again.

      This may not be possible but I haven't seen why not and it leaves a pretty big hole for zero day infections that this method claims to be able to catch 100%.

      --


      ) Human Kind Vs Human Creation
      ) It'd be interesting to see how many humans would survive to serve us.
    3. Re:Refuting the imaginary article in your head by HungryHobo · · Score: 4, Insightful

      After reading TFA I'm still not seeing how this is supposed to detect unknown malware.
      As far as I can see it would decide that a new install of any kind was a virus.

      Sure if you know every program which is supposed to be installed and none of them do wierd things in memory(a big if) then you might be able to spot when some kind of change has been made but if you can do that then you have a situation where you might as well just re-image the machine from ROM every now and then.

      I don't see any amazing new ideas in TFA

    4. Re:Refuting the imaginary article in your head by TheLink · · Score: 4, Insightful

      > have to scan and know what to look for?

      If Dr. Markus Jakobsson has solved that, it is strange he hasn't also announced that he has solved the halting problem ;).

      Figuring out whether a bunch of bits is or isn't malware is going to be as hard (or harder[1]) to figure out whether a program given a particular input will halt or not.

      [1] Especially when that bunch of bits might later on download a new bunch of bits. Yes I know in theory it is impossible to solve the halting problem (no general solution), but in practice some special cases can be solved.

      In contrast it's harder to solve the malware problem when you assume they can fetch new instructions and data, and from an active hostile party.

      Sandboxing is the way to go. Sandboxing is analogous to avoiding the halting problem by having a time limit on the program.

      No need to figure out whether the program is malware or not. Just make sure it can't do what you don't want it to do. Let the OS sandbox it.

      --
    5. Re:Refuting the imaginary article in your head by edmicman · · Score: 4, Funny

      Wrong! Abstinence is the one and only preventative answer!

    6. Re:Refuting the imaginary article in your head by clone53421 · · Score: 4, Informative

      But it does seem to be foolproof if you start from a known clean machine.

      That’s the whole point of his system: to scan from a machine that isn’t known to be clean.

      The standard way to scan from a “known clean machine” is one of the following:

      1) Use a known-clean boot CD. This ensures that the system RAM is clean. Once booted into the clean system, scan the possibly-infected secondary storage devices.

      2) Use a separate known-clean computer. Its system RAM is clean. Attach the possibly-infected secondary storage devices from the first computer to the known-clean computer and scan them.

      The 3rd way, which is not foolproof, is to attempt to avoid a boot CD or second computer by scanning the system RAM. Once the system RAM is known to be clean, you can proceed from there as in either 1 or 2 above. However, there is no foolproof way to ensure that the RAM of a running system is clean.

      He proposed a “foolproof” way to ensure that the RAM of a system is clean (without shutting it down and booting it from a clean boot device). That’s the only thing that makes his suggestion useful.

      However, it isn’t foolproof, and even you see that.

      FWIW, RootkitRevealer uses exactly the same method, so it’s not like this guy came up with anything novel. In fact, RootkitRevealer even has the disclaimer:

      note: RootkitRevealer is not intended to detect rootkits like Fu that don't attempt to hide their files or registry keys

      It only finds things that are trying to hide. If they aren’t trying to hide, you have to scan them conventionally.

      --
      Alexander Peter Kristopeit bought his basement from his mommy for one dollar.
  13. Redeeculous idea. by Ancient_Hacker · · Score: 4, Interesting

    I tried reading TFA a few times. First time, utter confusion. Second, third times, no better. I can't make any sense out of these points:

    >1) There are absolutely only three things malware can do when you scan for it. One: be active in RAM, maybe trying to interfere with the detection algorithm. Two: not be active in RAM, but store itself in secondary storage. It cannot interfere with the detection algorithm then, quite obviously. And option number three: erase itself.

    Absolutely, not. There are many other things malware could be doing. Inactive in RAM, compressed and inactive in RAM, encoded as plausible-looking entries in the File Name Table or the Virtual Memory map.

    >2) Any program -- good or bad -- that wants to be active in RAM has no choice but to take up some space in RAM. At least one byte, right?

    No, it could be sleeping, existing only as an entry in the swapped-out process table. Or in unused space below a thread stack.

    >Assume now that we have a detection algorithm that runs in kernel mode, and that swaps out everything in RAM. Everything except itself.

    Whoah there fella. Everything? Are you going to turn off all timers and interrupt enables so their service routines don't get called?
    Hard to do without mucking up all the device drivers. Are you going to swap out the kernel too, as malware is quite capable of infesting kernel space. And what about device drivers? They're constantly mucking with their internal tables and I/O buffers.
    And if you turn off all device drivers, you lose, as there's nothing stopping malware from masquerading as a device driver. Many do.

    >>But if we know how big RAM is, we know how much space should be free.

    Whoa there again, big guy. There are plenty of machines with RAM at places not generally known to the OS, such as video RAM, graphics polygon RAM, network card RAM buffers, and kernel stacks.

    >> Assume we write pseudo-random bits over all this supposedly free space. Again, a malware agent could refuse to be overwritten.

    You don't need a checksum test to do this-- each page of virtual memory has R/W control bits.
    And you're foiled here again, as there are plenty of system areas that are write-protected, such as pre code areas and the VM tables themselves.

    >>Then, let us compute a keyed hash of the entire memory contents -- both our detection program and all the random bits. Here is what could happen: If there is no malware in RAM, the results will be the expected result. An external verifier checks this, and tells us that the scanned device is clean.

    Nooo, that just tells you that either you overwrote the malware, so you'll never find it, or the malware during your two sweeps did not change any RAM contents. Quite possible as most malware just sits around most of the time.

    >> Or there could be malware in RAM, and the checksum will be wrong.

    Well, no, unless you disabled all interrupts and stopped all kernel tasks, there will still be system timers and interrupts and device drivers changing their state in RAM.

    >> The external verifier would notice and conclude that the device must be infected.

    Or some part of the system or some device driver is still running. Huge chance of false positives.

    This essay seems to have been written by someone with only a glancing familiarity with hardware and system software.