How to Scan Your Linux Computer for Viruses and Rootkits

12 comments

  1. dragonmouth

    ClamAv scan of the entire system takes at least couple of hours.

    “If you have a rootkit, back up your files and format that drive.”
    If you backup your files, wouldn’t you also be backing up the rootkit making the backup useless?

    1. John

      > If you backup your files, wouldn’t you also be backing up the rootkit making the backup useless?

      It would just be the data on a non-bootable drive. Unless I’m missing something here. Maybe for added protection, the external drive is fat32 or ntfs – vs – the system’s ext3/4 or other.

    2. Malcul

      Backing up your personal files means that nothing of any great importance will be lost – if you have to reinstall completely. Of course you may well have separated your personal files already, that would be the better solution.
      Backing up to an NTFS partition would avoid the ‘permissions’ problems if the worst came to the worst where you had to reinstall and restore files to your new ‘home’ directory.

      1. dragonmouth

        You are making a big assumption that the rootkit is isolated only to the ‘/’ partition or ‘root’ id. How do you know that a copy of the malware has not been stored somewhere among your personal files, regardless of whether you use a separate ‘/home’ partition or not? If such is the case, doing the distro install from scratch and then restoring ‘/home’ from a backup is pointless because the rootkit will re-install itself as soon as the restore is finished. The way I see it, the rootkit must be thoroughly removed from the storage device before even thinking of doing any kind of backup. After all, you would not do a backup if you suspected that there were viruses among the files, would you?

        1. Malcul

          Of course you are right. Truly the only way is to scrap the storage media along with the system and start afresh. Forget about protection, just scrap the lot and start afresh. Why didn’t I think of that?

        2. Andy Prough

          Back up personal files to an external USB-connected drive. Then mount as read-only on an uninfected system, and run your malware scanners on the files.

    3. Nick Congleton

      It really all depends on which rootkit it is and what’s actually affected. Most rootkits don’t care about your documents, pictures, music collection or anything along those lines.

      Attackers are looking for known predictable targets. It’s the only way they can be certain that their malware will function properly. Plus, those kind of files don’t really do much for an attacker in most situations. They’re looking to escalate privileges, gain root, and control the machine for whatever nefarious purpose. Infecting some memo you wrote won’t exactly achieve that.

      So, I suggested backing up files(meaning files of that sort) because the chances of them being the target of a rootkit are slim. However, you should always research the results that a malware scan gives you, and if that research suggests that those files are compromised, you’re only option is to lose them or back them up to an external medium and scan it with a live distro.

      I hope that clarifies things.

  2. kiwaski

    i thought they mainly affected securityvulnerable things that could be exploited to gain root such as vim or useradd maybe(im really just guessing but u get the idea) like making copys of these programs with modified code or something and hiding the binarys and what not or is that something else? i have used linux for a long time, tons of gentoo experience but i never really considered actually learning the shit that would actually land me a job working with linux idk any suggestions? ive been thinking of doing just that, i mean kernel patch? np.. netgear wifi routers in 2017 still dont understand that theres more to life than windows aparently, and i do a lot of compiling even on debian from source just so i learn things occasionally by breaking things, im completely self taught, bash proficient and pretty good knowledge of how the system is composed since ive compiled prolly a couple hundred of them but also i want to learn the security stuff, not just using kali in fact i would never, anyone can run a pre made program id rather learn the systems and write my own could use some advice where the best source of knowledge is, oh and hosting a site using apache too and a mail server all cmd line manually done if possible, the only real way imo is the cmd line

  3. Rocky

    Hello,
    Just started using Linux (Lubuntu 17.1) . Installed chkrootkit and id a full system scan which took over two hours. I am trying to get some insight as to what these results mean. I just read above that the ‘tcpd’ may be a false positive. What of the suspicious files and directories?
    scan results:

    Checking `tcpd’… INFECTED

    Searching for suspicious files and dirs, it may take a while… The
    following suspicious files and directories were found:
    /lib/modules/4.13.0-21-generic/vdso/.build-id
    /lib/modules/4.13.0-38-generic/vdso/.build-id
    /lib/modules/4.13.0-21-generic/vdso/.build-id
    /lib/modules/4.13.0-38-generic/vdso/.build-id

    I have no clue what these are and before I go further, I am hoping someone can give me a heads up as to any potential problems and solutions, should these results indicate same.
    Thank you in advance for any feedback.
    Sincerely,Rocky

Comments are closed.