Become a fan of Slashdot on Facebook

 



Forgot your password?
typodupeerror
×
Security IT

How To Guarantee Malware Detection 410

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.'"
This discussion has been archived. No new comments can be posted.

How To Guarantee Malware Detection

Comments Filter:
  • At least one byte (Score:3, Insightful)

    by BadAnalogyGuy ( 945258 ) <BadAnalogyGuy@gmail.com> on Monday March 15, 2010 @12:21PM (#31483136)

    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.

    Hell, Windows is a whole slew of malware that masquerades as the whole OS.

  • Theory and Reality (Score:5, Insightful)

    by ircmaxell ( 1117387 ) on Monday March 15, 2010 @12:21PM (#31483148) Homepage
    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?
  • Still a needle (Score:5, Insightful)

    by dmgxmichael ( 1219692 ) on Monday March 15, 2010 @12:24PM (#31483200) Homepage

    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.

  • by mangu ( 126918 ) on Monday March 15, 2010 @12:24PM (#31483202)

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

  • "Guarantee" (Score:5, Insightful)

    by Reason58 ( 775044 ) on Monday March 15, 2010 @12:27PM (#31483256)
    You can't guarantee anything in security. Especially when a human is involved.
  • by Anonymous Coward on Monday March 15, 2010 @12:27PM (#31483262)

    Even if you whitelist, if the memory space isn't properly protected by the OS, malware could use memory owned by the OS or a common application. 7 and the most recent version of MacOS are better at this, but I think there is still room for improvement.

  • by sopssa ( 1498795 ) * <sopssa@email.com> on Monday March 15, 2010 @12:31PM (#31483344) Journal

    I did, and he doesn't say anything about this point.

    Regarding making a keyed hash of the entire memory content, how would that even work? Every program modifies it's memory all the time. Then there's the programs like copy protections and Skype etc that modify it's own code in real-time too.

  • by nahdude812 ( 88157 ) * on Monday March 15, 2010 @12:34PM (#31483414) Homepage

    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!"

  • Re:Still a needle (Score:5, Insightful)

    by mooingyak ( 720677 ) on Monday March 15, 2010 @12:35PM (#31483422)

    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.

  • by OeLeWaPpErKe ( 412765 ) on Monday March 15, 2010 @12:37PM (#31483456) Homepage

    There are several weaknesses. Note how he says something about an external verifier, which is delay-sensitive. Note how for the first 2 steps he keeps repeating "malware may of course interfere but this doesn't matter because", and then he stops considering malware interference. That's because at those points, malware interference would be fatal.

    Of course, malware could simply take over the entire procedure, computing the keyed hash itself (a process which can run in a lot less memory : it doesn't actually index memory, it just generates the pseudo-random bytes directly, then it sends back the correct keyed has).

    Calculating the entire hash in the processor cache will let this method outperform the checksummer by a large margin, meaning it can send the data back after any chosen interval.

    (and before you say "keyed", obviously the encryptor needs to know the key)

    In practice you'll also find that large amounts of ram space cannot be swapped out : BIOS, some bits of the operating system, ... There's even memory locations that aren't in the memory map, but are nevertheless backed by physical ram (in a pci card or ...), and thus won't be included in any (sane) scan. Surely one can find some place where a virus could squeeze in.

  • by goombah99 ( 560566 ) on Monday March 15, 2010 @12:45PM (#31483546)

    His whole point was not "this is how you should do it", it was "you could do this, and because you could do this it shows that it's theoretically possible". This is a variant of what is know as a gedanken experiment-- an argument that proves or disproves some fact is true while not actually being somethign you would want to carry out. For example, you could suppose that you could measure the force field is under by running a pole from the earth to the moon and pushing slightly on it. Not that you want to do this, but it shows that measuring that force field is possible at all. Now you need to figure out an easy way to do that.

  • by evanbd ( 210358 ) on Monday March 15, 2010 @12:53PM (#31483668)

    Detecting a malware detector is just as hard as detecting malware. In general, detecting software of a specific type is halting-equivalent. In practice, the goal is to take shortcuts so that your adversary has a halting-equivalent problem and you don't. At present, the malware authors are winning. If we could force them to detect the malware detectors, that would be a huge advance.

    My skepticism about this is the obvious one: what if the malware just lets itself get swapped out, and relies on stealth to survive the process?

  • 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.

  • 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%.

  • by HungryHobo ( 1314109 ) on Monday March 15, 2010 @01:00PM (#31483758)

    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

  • by c++0xFF ( 1758032 ) on Monday March 15, 2010 @01:12PM (#31483926)

    As near as I can tell, the article makes a HUGE assumption: the malware is actively trying to hide itself. This is not an unreasonable assumption, but it makes everything more clear. Let's go through his steps:

    1) The algorithm swaps out memory.
    2) The malware decides to stay active in RAM.
    3) Random bits are written to memory.
    4) Optional: The malware masks its presence by falsifying the memory reads.
    5) A bad hash or delay reveals the presence of something trying to stay hidden.

    For the special case that malware hides itself in memory that won't get swapped out, this might work. But a special case is a far cry from the claims in the article:

    We can guarantee detection of malware. And that includes zero-day attacks and rootkits. We can even guarantee that we will detect malware that infected a device before we installed our detection program.

    What if the malware is fine with being swapped out to disk? This algorithm detects nothing, of course, and the malware continues as normal, and can only be detected by traditional means.

    I find the analogy from the paper quite revealing:

    An analogy of our approach is that of an air marshal that at given time intervals demands of all travelers to take a step out on the wing, reporting to an authority on the ground who was there, providing them evidence that the plane is empty -- and first then, allows everybody to come in again. Our solution works even if the air marshal was delivered to the plane after takeoff.

    So ... what happens if the marshal is clubbed over the head when entering the plane? What if the traveler carrying the bomb just leaves with everybody else? What if, what if ...

    There's just too many holes to count.

  • by TheLink ( 130905 ) on Monday March 15, 2010 @01:14PM (#31483962) Journal
    > 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.
  • by Magic5Ball ( 188725 ) on Monday March 15, 2010 @01:16PM (#31483986)

    "detect unknown malware... a new install of any kind was a virus"

    Yes, unless the new software is authorized, it should be considered malware.

    "I don't see any amazing new ideas in TFA"

    Also, yes. Shockingly, unauthorized software is unauthorized; and you can inspect a running system externally without being owned by that system.

  • by clone53421 ( 1310749 ) on Monday March 15, 2010 @01:33PM (#31484252) Journal

    From TFA:

    Anti-virus products scan for malware in two ways. They look for sequences of bits that are found in programs that are known to be bad (but which are not commonly found in good programs). And they run programs in sandboxes and look for known malicious actions. The first approach only catches known malware instances, while the second can also catch variants of these.

    His “solution”:

    Create a sandbox consisting of all available RAM which definitely contains no “good” programs except for the scanner. Scan the sandbox to detect any “bad” programs that remained (by looking for the malicious action of attempting to mask its process RAM). Then scan the hard disk for sequences of bits that are found in programs that are known to be bad (but which are not commonly found in good programs).

    Thus, it is subject to exactly the same limitations that he was trying to improve upon.

  • by Chris Mattern ( 191822 ) on Monday March 15, 2010 @01:40PM (#31484370)

    If the malware isn't active, then it can't hide it's tracks. We will see it's memory footprint.We know how much space everything else should be taking up, and we know more space than that is allocated, so we know something is afoot.

    Unless, of course, the infected system is lying to you about the memory allocations.

  • by alexhs ( 877055 ) on Monday March 15, 2010 @01:46PM (#31484456) Homepage Journal

    I think you missed the following parts :

    Instead of looking for known patterns -- whether of instructions and data, or of actions -- wouldn't it be great if we could look for anything that is malicious? That may sound like a pipe dream.

    Not to me.

    [...]

    This tells us a few interesting things. We can guarantee detection of malware. And that includes zero-day attacks and rootkits.

    Even with your interpretation :

    We can even guarantee that we will detect malware that infected a device before we installed our detection program.

    You can't detect known malware that way if it virtualizes the computer, because you will only scan for the memory the malware is willing to show you.

    By the way, the following assumption is unworkable:

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

    You can't swap out many parts of the kernel.
    And I'm pretty sure kernel space parts of a rootkit won't let themselves swap out. Which does not mean uncooperative kernel modules are malware. If you're swapping out the disk driver, how will you get it back ? But maybe this exact disk driver is infected by the rootkit ?

  • by Runaway1956 ( 1322357 ) on Monday March 15, 2010 @01:50PM (#31484534) Homepage Journal

    "As good as this technique may or may not be, it's not security."

    Ehhh, you could have been a sailor. Back in the day, we had "security alert" drills, to deal with "intruders" all the time. But, that's all we ever had, were drills. The REAL security was focused OUTSIDE! If some boat, ship, helicopter, or even a frogman came close to our ship, we just blew them out of the water or sky. There was never a need to look for an intruder INSIDE the ship!

    The most likely time and place any intruder might get aboard, was when we were tied up to a pier. Social engineering MIGHT cause some young fool to bring a malevalent guest aboard. But, the OOD, the POOW, and the duty section were all there to screen for potential bad people.

    Trying to find the bad guy AFTER he comes aboard would be utterly ridiculous. He only needs a minute or two to plant his bomb, his bug, or whatever the hell he was there to do.

    Security means killing it before it gets here. So, yeah, I like the way you think. Now, the problem is, convincing others to think that way. Most especially, those others at Microsoft.

  • by nabsltd ( 1313397 ) on Monday March 15, 2010 @01:59PM (#31484714)

    Suffice it to say, you haven't understood it yet.

    I think these people have all understood the article quite well, and are pointing out real flaws with this scanning method.

    The #1 flaw is the assumption that an exact byte count of what is running can be known if malware is also running on the system.

    If malware is actively running, then if scanning code calls any outside functions, the results must be considered tainted. Since there is no way for code that does not query the OS to even guess about what else is loaded in RAM, sufficiently intelligent malware will be able to hide itself from any scan. Hell, you can't even determine how much RAM is in a computer running in x86 protected mode without calling some OS or BIOS function, either of which can be hooked by the malware.

    One of the other assumptions is that the time it takes to compute a hash of RAM on a particular machine can be known with enough precision to detect that it is being "delayed" by malware.

    Last, there is one piece of code that can never be swapped out to disk, and will likely show up as malware as it refuses to be overwritten: the code that swaps and restores pages to/from disk.

  • by clone53421 ( 1310749 ) on Monday March 15, 2010 @02:03PM (#31484796) Journal

    No, YOU are the one who doesn’t understand the concept of what is happening.

    Looking for “space” that is occupied by malware in this manner will only detect malware that attempts to hide itself. There are multiple ways of defeating this scan, not the least of which is simply to not attempt to hide, allowing itself to be swapped out of memory like any other application.

    In which case, you would not be “guaranteed” to detect all malware, because you’d be scanning it in the swap file like any other application and you’d be depending on your signature database to find the malicious code. It didn’t do the one malicious action that you were relying on to give away its presence.

  • by nabsltd ( 1313397 ) on Monday March 15, 2010 @02:19PM (#31485032)

    If we start from a known clean machine

    By doing this, there's really no reason to run any high-tech malware detector, as this assumes you have two machines that are identical in every way except one might have malware while the other is known to be clean. If that's the case, just clone the one that is known to be clean and you now have two known clean machines.

    In other words, there is no way to use an external machine to assist you in determining things like memory used by a process because you can't have both a clean machine and one infected by malware and have them identical enough to get a meaningful comparison.

    There is no 'empty space' in a rpogram's code segment.

    There very often is, as pages are 4096 bytes (at least, normal pages on x86 are this size), and it's rare to have code completely fill the page.

    Since all the protections on x86 are at the page level, malware can hide in the bytes after the real executable. This type of technique has been used for years (malware used to hide in the file slack on floppy disks).

  • by dskoll ( 99328 ) on Monday March 15, 2010 @02:40PM (#31485364) Homepage

    From the Our Solutions [fatskunk.com] page:

    A technique known as software-based attestation can provide an alternative defense against malware by performing infection scans periodically and detect the presence of any program that refuses to be inactivated – as well as any inactivated program that is known to be malicious.

    So, it can detect malware that refuses to be inactivated which is a tiny (vanishingly-tiny?) percentage of malware, as well as inactivated software that is known to be malicious (eg, because of a known virus signature.)

    So what's the advantage over signature-based virus-scanners? Well, you get to detect completely hypothetical software that (somehow) refuses to allow the kernel to swap it out (and how that is possible is never explained) at the cost of hugely-expensive computations.

    Great.

  • by amRadioHed ( 463061 ) on Monday March 15, 2010 @03:30PM (#31486214)

    I have a hard time believing a technique that starts with "swap out everything in RAM" could ever be used for real-time detection.

  • by maestroX ( 1061960 ) on Monday March 15, 2010 @03:34PM (#31486254)

    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?

    No. Symantec is the scanner.

  • by turbidostato ( 878842 ) on Monday March 15, 2010 @05:18PM (#31487934)

    "Still haven't read the article, eh?"

    I did. The relevant parts:

    "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?"

    More news from Captain Obvious Dept.: any program -- good or bad -- that wants to be resilient between cold bootups has not choice but to take up some space in persistent storage. At least one byte, right?

    "All we need is the help of an external verifier that knows how much RAM a device we want to protect has, and how fast its processor is. And ways to avoid latency variance when we measure the time to compute the checksum.
    This tells us a few interesting things. We can guarantee detection of malware. And that includes zero-day attacks and rootkits. We can even guarantee that we will detect malware that infected a device before we installed our detection program. Think about it. Or read more here and here."

    What does it add to current solutions? My answer: almost nothing to absolutly nothing.

    1) By trashing out everything from RAM you effectlively have disrupted the service so it's no advantage from other stablished disruptive means like... scanning the disk out of a cold boot.

    2) By just cleanning RAM you will have only the ability, even if your system is 100% guaranteed, to detect *only* the malware that was in RAM by the time of the scan. A simple script running from cron will be absolutly undetectable unless it happens to be running by the time the scan was scheduled.

    3) No, it won't work on already compromised systems: even if it's run from kernel mode the execution space will already be tainted: think about a virtual server and a virtualized box.

    4) As I already said, for a system to survive cold boots it needs to go to persistent storage. If I can know what the RAM contents are expected to be I certainly can easilyl know what the HDD (or BIOS EEPROM, or any other persistent storage) should look like too, so I can compare checksums.

    5) Oh! but the system used to get a clean checksum can be compromised! So does the system used to provide the RAM space.

    So, in the end this system offers absolutly nothing from the "standard" off-line verification scenario: on a home system boot from CD and check the hard disk; on a corporate system boot from PXE and check the hard disk.

    But it offers nothing either on the real time field: TPM can offer just the same only in real time so while it only inspects RAM it inspects RAM at every moment, so the moment the malware is trying to get into RAM it's the time it gets revealed.

  • by smallfries ( 601545 ) on Monday March 15, 2010 @06:37PM (#31488952) Homepage

    Ok, so you want serious criticisms?

    1. They assume that the read back from external storage doesn't overlap with computation. This is not true of any DMA-based transfer that is asynchronous. This breaks their argument as I can hide the time to do a memory / storage swap by using DMA during calculation of the hash of a different region.

    2. It is brittle. It depends on a very narrow margin between computation time and retrieval time. There are many things that could cause this margin to change but their complete avoidance of cache variations would kill it (yes I've read it, no their "worst-case measurement" doesn't cut it).

    3. As many other people have pointed out it requires a trusted third-party to do the verification. If we allow a trusted party then installing a TPM is much simpler way to do it.

    4. If the malware allows itself to be swapped out (i.e it has infected a callback hook) then the system must drop back to standard scanning techniques. These are not guaranteed because of the halting problem - so the author's claim that this method gives guaranteed detect is a crock of shit.

    5. Although they've cited Naccahe's paper they've not really done it justice. His approach was much more elegant as it did not require a trusted party, and it got bonus points for using Quines in a serious research setting.

  • See people? If you read the article, you can offer cogent criticisms. If you don't you can offer irrelevant criticisms you will then have to spend the next several hours massaging and defending.

    I think number 4 is the most cogent. The author claims his system can detect 0-day malware that was on the system before the scanner was installed. Maybe, if the malware tries to interfere. But if it doesn't, you have no signatures or checksums to fall back on, how could this system work?

The hardest part of climbing the ladder of success is getting through the crowd at the bottom.

Working...