Please create an account to participate in the Slashdot moderation system

 



Forgot your password?
typodupeerror
×
Security Software Linux

New Approach To Malware Modifies Linux Kernel 170

Hugh Pickens writes "Professor Avishai Wool has unveiled a program to watch for malware on servers with a modification to the Linux kernel. 'We modified the kernel in the system's operating system so that it monitors and tracks the behavior of the programs installed on it,' says Wool. Essentially, Wool says, his software team has built a model that predicts how software running on a server should work (pdf). If the kernel senses abnormal activity, it stops the program from working before malicious actions occur. 'When we see a deviation, we know for sure there's something bad going on,' Wool explains. Wool cites problems with costly anti-virus protection. 'Our methods are much more efficient and don't chew up the computer's resources.'"
This discussion has been archived. No new comments can be posted.

New Approach To Malware Modifies Linux Kernel

Comments Filter:
  • Help! (Score:5, Funny)

    by i_liek_turtles ( 1110703 ) on Sunday September 28, 2008 @01:07PM (#25185871)
    It's stopped me from running Vista in a VM...
  • premise to shutdown (Score:5, Interesting)

    by thatchman1 ( 470825 ) on Sunday September 28, 2008 @01:10PM (#25185899)

    Is this not the very premise that caused the Amazon cloud shutdown? A failure to communicate back proper activity illogically deduced that there was an improper activity?

  • selinux (Score:5, Interesting)

    by perlchild ( 582235 ) on Sunday September 28, 2008 @01:14PM (#25185931)

    Great, sounds exactly like what people have been doing with selinux and capabilities. But selinux acknowledges we don't always do the same things with our computers as the next guy... Will this approach be as flexible?

    I don't want to boohoo his research, it's probably fine, but the article summary just gets my goat. Malware is a lot more complicated than most anti-malware software authors make them sound, and false positives are the biggest/most complicated problem they have to deal with, especially in automated systems that block like this...

    • Re:selinux (Score:5, Interesting)

      by icsx ( 1107185 ) on Sunday September 28, 2008 @01:34PM (#25186055)
      If you can detect and isolate a program that doesnt do what it is supposed to be doing and attracts attention with unusual behaviour, like scanning certain ports or trying to send packets etc, then it may be something that you dont have to have on your server. Most security programs today arent looking up what software does. They look what ports are used, what traffic is routed and so on.

      These malware programs today try to hide themselves into deep that you just couldnt find them if you dont know what you are looking for. This system here as i understand it tries to identify what are the normal parameters for a certain program to work. If the program doesnt do or behave like a normal software, then there must be something wrong with it and alarms go off, lights are blinking and all hell brokes lose.

      Oh crap, red lights and i hear noises. Oh it's only the cops.
    • Re:selinux (Score:5, Informative)

      by Kjella ( 173770 ) on Sunday September 28, 2008 @01:49PM (#25186137) Homepage

      Well, from my basic reading of the paper it sounds like it won't have false positives but it also will miss many negatives. Essentially when you build it it'll make a map of what system calls can be made and in what sequence. If an application makes a system call it never calls or never can call in that order because it's been hijacked then this thing will stop it. If you manage to do your nasty business using the system calls it normally uses, it won't. Think of it as a auto-hardening system turning off any syscalls or combinations that the application doesn't use anyway. One of the downsides is that if you know this system is in place, you can probably add dummy syscall patterns to your exploit to match the application's behavior unless it's a syscall it never does. Still, there's little reason assuming an attacker is perfect and this is a worthwhile protection for the cases where it does work.

      • Re: (Score:3, Insightful)

        by Plouf ( 957367 )

        If an application makes a system call it never calls or never can call in that order because it's been hijacked then this thing will stop it.

        The problem is that, for any non-trivial program, it is impossible for a static analyser to decide whether the software will call or not and in what order a specific trap. For instance, that static analyser is not able to tell you in advance at what time the exit syscall will be called.

        • Re: (Score:3, Insightful)

          by QuoteMstr ( 55051 )

          It can't catch every case, but it can rule out a lot of system calls. If setuid never appears in a program or library's source, it can't be called. If a program calls a bunch of things in an initializer function and then enters a more restricted main loop, the static analyzer should be able to catch that too.

          I can't see how this approach could hurt, though of course it won't catch everything.

          • So what can you say about programs using glibc? What if innocent functions like fopen(3) call setuid(2)? What if they do it only after an update of glibc?
      • How does this thing deal with plug-in/add-on based systems like Firefox or Eclipse, where new capabilities get added to the executable through dlls (or java classes, I guess, in the case of Eclipse? - Although, with regards to Java, I wonder if this system would work at all, since I think the kernel never exactly 'sees' Java programs or classes as executables, but only the JRE, which already has all the system calls built into it?)

        • by Jerry Smith ( 806480 ) on Monday September 29, 2008 @03:39AM (#25191657) Homepage Journal

          How does this thing deal with plug-in/add-on based systems like Firefox or Eclipse, where new capabilities get added to the executable through dlls (or java classes, I guess, in the case of Eclipse? - Although, with regards to Java, I wonder if this system would work at all, since I think the kernel never exactly 'sees' Java programs or classes as executables, but only the JRE, which already has all the system calls built into it?)

          It's about servers here, I personally think one should really think thrice before installing plug-ins and add-ons on a server, and rather go browsing on a desktop machine. Regarding Java, I can see your point.

    • Re:selinux (Score:5, Informative)

      by debatem1 ( 1087307 ) on Sunday September 28, 2008 @02:42PM (#25186489)
      This is actually quite different from selinux, although they both hinge on controlling what syscalls a program can make. The major difference here is that this system automatically builds an equivalent to the selinux rules at compile time, and therefore avoids a lot of the problems caused by poorly written selinux rules. An associated advantage is the ability to track whether a chain of syscalls is legitimate. Such context analysis could be very powerful if used properly.

      However, you've probably already spotted the major flaws with this approach: the first is that it only works on compiled programs, which strikes me as a serious problem when you're talking about webservers. The second is that it doesn't work on certain classes of programs whose execution pattern is extremely difficult to predict: self-modifying code, highly dynamic code (longjmp is not allowed), etc. Another limitation is that it only works on statically linked libraries. Finally, it is totally dependent on GCC and friends, which could be a problem for it moving forward, and in groups where the intel compiler is preferred.

      As for false positives, the entire point of this is that inside of these admittedly limited confines, it has no possibility for false positives. This system is not statistical in nature. It depends entirely upon the program itself to determine correct syscall behavior.

      All in all, while it is a long way from a practical security model, it does offer the promise of powerful, accurate protection from certain classes of attacks. When combined with selinux and pcap on a system with a slim attack profile it could help to narrow the gap between being a zero-day compromise and having full protection.
      • On the other hand, it's strong where selinux is strong(the applcations etc.. are well known... and the context restricted. While I had hope for an approach that required a kernel mod to work, to actually be able to secure that open moat of computing ... the shared hosting server...

        Seems all the work is going in applications server, where the hardware is dedicated and the resources are already plenty... And almost no work is going into securing the already at risk segments... (Think the resold cpanel serv

        • Re: (Score:3, Informative)

          by debatem1 ( 1087307 )
          If you're looking into securing a shared hosting solution, you might look into libpcap. I mentioned it before, but it gets far less attention than it deserves, especially among admins. It has the capability to forbid forming new chroots, making modifications to your networking properties, the insertion of kernel modules, even escalations to root. Between libpcap, something like this, a well-constructed jail, a good vserver solution, and a very carefully secured network, you're going to be as secure as just
      • Edit: I also screwed it up here. The correct library, as pointed out below, is not libpcap, but rather libcap. My bad.
  • I could be wrong but this sounds like the heuristic scanning features that has been in Norton Antivirus and other A/V utilities for almost a decade now, where it searches for out of the norm items and reports or blocks them, such as a program deciding to write to the MBR, or a program using raw disk I/O to write to the hard disk.

    • by ThinkingInBinary ( 899485 ) <[thinkinginbinary] [at] [gmail.com]> on Sunday September 28, 2008 @01:19PM (#25185967) Homepage

      this sounds like the heuristic scanning features that has been in Norton Antivirus and other A/V utilities for almost a decade now, where it searches for out of the norm items and reports or blocks them, such as a program deciding to write to the MBR, or a program using raw disk I/O to write to the hard disk.

      Wow, those "heuristics" sound like a simple blacklist of "virus-like" activities.

      No, what this does is cleverer. It creates (at compile time) an automaton representing the system call activity of the program, and if the program tries to make a syscall that does not have a matching edge in the automaton, it kills it. Basically, if there is not a code path that should lead to execution of a certain syscall, the program gets killed.

      • It creates (at compile time) an automaton representing the system call activity of the program

        At compile time of the program? So in addition to a modified kernel you need a modified gcc and to compile everything from source or have a specialised distro? It doesn't surprise me that the summary should be lacking such details, but it would be nice if for once it gave a decent overview.

        • by causality ( 777677 ) on Sunday September 28, 2008 @03:04PM (#25186673)

          It creates (at compile time) an automaton representing the system call activity of the program

          At compile time of the program? So in addition to a modified kernel you need a modified gcc and to compile everything from source or have a specialised distro? It doesn't surprise me that the summary should be lacking such details, but it would be nice if for once it gave a decent overview.

          I agree that this was a poor summary but instead of complaining about the summary you could always do something crazy like read the article.

        • by Rich0 ( 548339 )

          Well, if something like this took off programs could come with execution fingerprint files or whatever containing this information. However, that just means that instead of downloading a virus-infected executable you'll just end up downloading the virus-infected executable and its infected fingerprint.

          The issue with any scanner like this is that you need to start from a known-good state. If you take all the time to maintain it a system like tripwire is virtually impenetrable - even if there is a break-in

          • by pjt33 ( 739471 )

            Well, if something like this took off programs could come with execution fingerprint files or whatever containing this information.

            That's what I meant by a specialised distro - unless by "take off" you mean that Linus copies it to trunk.

            The issue with any scanner like this is that you need to start from a known-good state.

            I could be wrong - I haven't RTFA, just some of the comments on this thread - but my understanding is that it's not anti-virus but anti-buffer-overflow. In other words, the instructions which it's stopping aren't in the executable at all. I'm not sure* why this can't be fixed more easily by making the kernel memory management allocate non-adjacent sections for code and data such that a buffer overflow i

            • by Rich0 ( 548339 ) on Sunday September 28, 2008 @08:34PM (#25189365) Homepage

              I wonder if a fix for the buffer overflow (besides languages that make it harder) would be to separate the stacks used for local variables and return addresses.

              The problem is that when a call is made to a function the compiler pushes the return address onto the stack. Then the function allocates space for its own variables on top of the same stack. If one of those variables overflows it can hit the return address. That essentially is a mixing of code and data. If you had two stacks then the processor could trigger an exception if anything writes to one of them except via a call or return. You could probably accomplish this via changes to the compiler without a processor change - the processor will always use the regular stack but a compiler could be designed to maintain a separate stack for local variables. You wouldn't have that read-only protection on the regular stack, but the two would be in different segments making an overflow impossible.

              Other tricks that are used are things like canarys - values written onto the stack and then checked before a return - if there was an overflow the canary would not be intact. GCC has an option to do this which works most of the time.

      • Re: (Score:2, Funny)

        by liquiddark ( 719647 )
        So basically it shuts down malware and buggy software. Holy fuck, somebody kill this thing - we're all out of a job if this catches on.
      • by azgard ( 461476 )

        What about threads? They will show different signature each time.

        You have two threads; one of them dies.

  • Oh great. (Score:5, Funny)

    by bigtallmofo ( 695287 ) * on Sunday September 28, 2008 @01:15PM (#25185949)
    They recently unveiled a unique new program called the "Korset" to stop malware on Linux...and once it reaches its full potential it could put anti-virus software companies out of business.

    Doesn't our economy have enough problems? Do we really need to put Linux anti-virus vendors out of business? Next we'll probably drive the ice vendors in Alaska to bankruptcy!
    • by fuzzyfuzzyfungus ( 1223518 ) on Sunday September 28, 2008 @01:30PM (#25186031) Journal
      Oh, don't worry. Things are just warming up for the ice vendors...
    • by morcego ( 260031 )

      Joking aside, there are plenty of anti-virus companies with Linux products. AVG and F-Prot are 2 I use regularly (on servers, to protect the Windows machines connected to them).

      In a particular client of mine, about 40% of the yearly anti-virus license payments are related to Linux server licenses (the other 60% is, of course, related to the workstations/desktops).

      So yeah, while the home market for Linux anti-virus software might be close to nill, on the corporate segment it is fairly significant.

      And yes, I

      • Question: why don't you go the F/OSS route and use ClamAV?

        • by morcego ( 260031 )

          Because ClamAV is SLOW.

          I have tested Samba servers running both Clamav and F-Prot. The access times on files, when running f-prot.so, was pretty much the same. However, when using clamav.so, it became so slow (relatively) that some programs started having problems.

          I still use clamav on non speed critical environments (like e-mail servers). But for file servers, it is simply not an option.

    • >Next we'll probably drive the ice vendors in Alaska to bankruptcy!

      Naww, there's always a demand for governors lying in their tanning beds sipping iced tea while keeping an eye on those pesky russians.

  • How it works (Score:4, Interesting)

    by Animats ( 122034 ) on Sunday September 28, 2008 @01:20PM (#25185973) Homepage

    From the papter: "The resulting model is an automaton that represents the legitimate order of system calls that an application may issue. This automaton is then enforced by Korset's monitoring agent, which is built into the Linux kernel, by simulating every emitted system call."

    This is not likely to work for scriptable applications (Apache, Java-based servers, etc.) The order of calls is determined by the script, not the underlying executable.

    • From the paper: "The resulting model is an automaton that represents the legitimate order of system calls that an application may issue. This automaton is then enforced by Korset's monitoring agent, which is built into the Linux kernel, by simulating every emitted system call."

      Why couldn't malware makers then just insure their programs emulate this profile?

      • Why couldn't malware makers then just insure their programs emulate this profile?

        No, because the whole point of malware is getting a program to do something other than what it's supposed to do, and the profile describes, well, what the program's supposed to do.

    • It will work to a degree: the scripts can be perverted at the script level - in theory java could be caused to run arbitrary java. But this would still protect against lower level exploitation via scripting languages. Arbitrary script but no arbitrary code (unless it can be achieved through legal script).

      Also, it would bock in response to anything scripting language that would allow constructing lower level calls.

  • If I stop surfing pr0n will it detect that anomaly and halt my browser?

    Will that crash my gnome desktop too?

    Oh NO!

    • Re: (Score:1, Funny)

      by Anonymous Coward

      If I stop surfing pr0n ...

      Why deal with hypotheticals that we know will never occur in real life?

  • Ummmm..... (Score:3, Informative)

    by Hasai ( 131313 ) on Sunday September 28, 2008 @01:27PM (#25186011)

    ....I thought that was the philosophy behind AppArmor (http://en.opensuse.org/Apparmor).

    It's been deployed in SuSE products for years.

    • by Lennie ( 16154 )

      Also the BSD's have something similair I've heared (and forgot the same)

    • Re:Ummmm..... (Score:4, Informative)

      by causality ( 777677 ) on Sunday September 28, 2008 @02:40PM (#25186473)

      ....I thought that was the philosophy behind AppArmor (http://en.opensuse.org/Apparmor).

      It's been deployed in SuSE products for years.

      Apparmor seems to be a relatively sophisticated least-privilege system, i.e. the idea that if a BIND DNS server should never need to (for example) modify the routing table, then it also should not be able to modify the routing table. That way, if an attacker compromises said DNS server, he won't be able to do very much with it that isn't directly related to serving DNS requests (this is why I would personally refer to such a system as damage control, useful for containing/limiting an attacker who has already compromised something). The system discussed in the article is different in that it seems to be less concerned with what specific tasks a program should or should not be doing and more concerned with whether the code that is executed and the way that it is executed is what you would expect from the program's source. That way, if someone exploits i.e. a buffer overflow and inserts their own shellcode, it would deviate from the pattern that you would have expected from the exploited program and this deviation would be detected.

      Both can be compared to systems like PaX [grsecurity.net] (kernel) and SSP [ibm.com] (userspace) which are intended to make sure that an attacker will fail to exploit an existing vulnerability, such as an unpatched buffer overflow, in the first place.

  • by fuzzyfuzzyfungus ( 1223518 ) on Sunday September 28, 2008 @01:29PM (#25186023) Journal
    But this looks a lot like SElinux or AppArmor, except that the application profiles are constructed by static analysis of program code, rather than by hand, or by observing the app during a "training" period. The linked paper indicates that it is still in a rather rough state; but it looks quite promising.
  • Linux?? (Score:2, Informative)

    by fxkr ( 1343139 )

    I really don't think Linux has problems with malware. I think there is an other operating system having more trouble.

    As far as I know virus scanners are used on servers mostly to check data that goes through it (example: email server); this data will however not be executed on the server.

    • I really don't think Linux has problems with malware. I think there is an other operating system having more trouble.

      Maybe, but we still need to work hard to ensure that that is the case; why do you think that SELinux and stack randomisation have been developed ? Remember: pride becomes before a fall!

    • by jimicus ( 737525 )

      I really don't think Linux has problems with malware.

      Yet.

      Not a lot of /. readers seem to know this but (whispers) most modern Windows malware doesn't depend on the user having administrative privileges.

      IOW, a program which, when executes, deletes all your documents then emails itself to all your friends can exist just as easily on Linux as it can on Windows. About the only thing preventing that right now is that nobody's got around to it and it would still require some effort on the users part because AFAIK no Linux mail client will perform file(1) on attach

  • So they are comparing the program behavior and match it with a stripped version of the source code or the object file. Great! But what are they protecting themselve against exactly? If some virus tampered with the content of a binary or a shared object, whouldn't be more effective to implement a (trivial) checksum-based integrity mechanism? And if a black hat managed to feed a shell code through a buffer overflow, how will this tool distinguish between a legitimate fwrite in the software logfile against an
    • by Lennie ( 16154 )

      I think they want to prevent running programs that have had a some kind of overflow and there 'code rewritten' to be able to do things they were never intended to do. And by using source-code analysis this might be an easier way to construct a lot of a program is allowed to do.

  • OK, what this is doing is watching for code injection attacks (buffer overflows, stack smashing, etcetera) by building a model of how each specific application is going to operate, and blocking system calls that the model of the application would never make. It seems like an interesting approach, though it may not be as useful on Windows where there's not such a formal distinction between system calls and other kinds of calls.

    It won't do anything about interpreter code injection (eg, SQL injection or shell code injection) or script privilege escalation attacks (eg, ActiveX and other "cross zone" attacks in Internet Explorer), or attacks that involve complete executable code drops.

    Still, this is useful and not nearly as dodgy as the article made it sound.

  • Not sure how this is better than what grsec [grsecurity.net] and selinux does... They might be better suited to writing selinux modules than trying to reinvent the wheel here with what basically sounds like role based access control (RBAC) found in selinux
  • I'll try to run famous :(){ :|:& };: shell example
    • Yes, it would still work. The method discussed here only checks whether a program is doing what it should, not whether what the program is doing is dangerous. If you compiled an application whose purpose was malicious, this wouldn't stop it (so you still need to download from known-good repositories and check MD5 hashes). It just stops code modification and code-injection attacks in compiled software.

      It's actually completely useless against a shell script, because if you're running a valid shell script
  • by FudRucker ( 866063 ) on Sunday September 28, 2008 @02:34PM (#25186437)
    When & if Linus Torvalds (or whoever the benevolent dictator of the kernel is nowadays) includes it in to the main kernel source tree...

    Sounds like a good idea to me, I just want to see what the Linux kernel pros think of it...
    • Re: (Score:3, Interesting)

      It seems too specialized to go in the main kernel tree. Additionally, I can only imagine that it hurts performance more than some users would like. Additionally, it requires a fundamental change to the system of distributing linux apps. Maybe a distro will include it in their kernel and modify their repository to include pre-built maps, but I can't see it becoming fully mainstream.
      • Not too specialized, since running servers is a very common use of Linux. Also, all the overhead goes away if it is activated by a flag at compile time, like lots of other Linux functionalities.

        Its biggest roadblocks seem to be the usual ones: very recent code that may have bugs, no maintence history (the Linux developers may want to wait a bit more to see if they won't get a bomb), politics...

  • by TheRealSlimShady ( 253441 ) on Sunday September 28, 2008 @03:01PM (#25186637)

    Sounds from the summary at least (hey, it's slashdot, I haven't read the article) that it's similar in some ways to the service profiling in Vista. The service profiling means that the dev looked at what the service needed to do to be able to run and gave it only those permissions, restricting the damage it could do if it were compromised. This seems to extend that to give the kernel the intelligence to baseline the services itself, and then restrict activity when the baseline activity changes.

    • Re: (Score:2, Interesting)

      by Delkster ( 820935 )

      These guys make a point of avoiding the labour involved in manually building the profile. (FWIW, I don't know about anything service profiling in Vista -- in fact, I had never heard about it -- but your description also sounds somewhat reminiscent of AppArmor.)

  • This actually isn't new. Systrace [umich.edu] has been doing this for years. And it runs on more than just Linux.

  • Tron (Score:3, Interesting)

    by nsayer ( 86181 ) * <nsayer@kfu.cELIOTom minus poet> on Sunday September 28, 2008 @04:42PM (#25187441) Homepage

    Somehow, this technique reminds me of the (obviously rather simplistic) description of the functionality of the Tron program from the movie of the same name. From the script [imsdb.com]:

                        DILLINGER
      [...]
                                            What's the thing you're working on?

                                                                    ALAN
                                            It's called Tron. It's a security
                                            program itself, actually. Monitors
                                            all the contacts between our system
                                            and other systems... If it finds
                                            anything going on that's not scheduled,
                                            it shuts it down. I sent you a memo
                                            on it.

                                                                  DILLINGER
                                            Mmm. Part of the Master Control Program?

                                                                  ALAN
                                            No, it'll run independently.
                                            It can watchdog the MCP as well.

  • As I understand it (Score:3, Insightful)

    by slimjim8094 ( 941042 ) on Sunday September 28, 2008 @05:05PM (#25187613)

    this isn't anything specifically to do with malware.

    As far as I can see, this verifies that the binary currently running is the same binary that was compiled from a (trusted) source.

    When you compile it, it knows (from the source) what the program will and won't do. If the program deviates from that, it dies (as it's been replaced by malware, presumably)

    If I'm wrong, please correct me...

  • Maybe this sounds stupid, but in a weird way this reminds me of this little project here [slashdot.org], and I think it is the wrong approach, no matter the subject. It might work better on a computer system because a lot can be predicted, complexity is simpler but i can see the same kind of false positives occuring with this system as well.

    The consequences of course have a different quality of impact, this isn't dealing with human lives, but there still might be a lot at stake.
    • by Eskarel ( 565631 )
      As has been stated before, false positives would be very unlikely in this scenario, if the program does something that doesn't match the execution pattern in its source code then its done something wrong.

      False negatives would be a much bigger problem, but it's as good an automated technique as anything I've seen before. If the profiles can be distributed with binaries it might make it mainstream.

Computer programmers do it byte by byte.

Working...