Today’s post comes from a thread I spotted on the Ubuntu forums about how the command line has the potential to be abused, based on the fact that some tasks need to be done via the command line. The main argument is that a “spammer” could give some command that would turn that machine into a zombie, or send personal information, or other things of that nature. While this might be able to be done, it would require a user to blindly copy and paste a pretty long command into their terminal. You can read my response (I’m Endperform on the forums :) ), but basically I answer some of the points being made with some commentary of my own, but I wanted to point out a couple of the comments and elaborate a bit on them:
But I’m counting that Ubuntu will be a major player in the OS world, and soon virus will be released that target Linux (Ubuntu) as well. And you must agree with me: it is fair EASIER to get infected by a hypotetical virus in Ubuntu from a bad CL than from downloading an executable file (just think that the user would still need to set the file executable).
This is definitely not the case. The original poster continually mentions about a bad command line ‘virus’ from a couple of commands. If anything, there are some malicious commands, but nothing that would classify as a virus. The comment above I feel is a bit untrue, if not unfair. In order to compare, cmd.exe would need to be compared against Bash, and Windows is definitely just as dangerous. One command can wipe out your system. In order for this comparison to make a bit more sense, we should compare the software installation methods on Windows and on Ubuntu.
On Windows, software installation is accomplished by downloading an installer and double-clicking on it and following some prompts. If that file happens to have a virus riding with it, and you don’t have the proper protection set up, you’ve just become a victim. For Ubuntu, there are at least three methods of installing software. First, there’s Synaptic, a GUI which allows you to select which software to install, and then install it. Then, there’s aptitude, a command-line software installation client. Finally, there’s installation via dpkg, which requires the manual download of a .deb package file. Synaptic and aptitude use software repositories to download from, and chances are very, very slim that you would catch any virus from an official repository. The third method is a bit trickier, and it has the potential for trouble.
It is true. But they still need to DOWNLOAD something to do some harm. Ubuntu, on the other way, comes pre-installed with LOADS of command line software than can do some nasty things already, you just need to type or paste one simple command and voilá - not even anti-virus software would prevent it.
Ubuntu is no more dangerous than Windows is out of the box. I can give a Windows user one command and if they type it, no more system, right out of ghe box. Also, don’t forget about VBScript and the multiple vulnerablilities right out of the box with a fresh Windows install. Also with these ’simple commands’, in order for something really bad to happen, you’d have to prefix the command with sudo, while the Windows command would not need sudo as most likely the user already has administrative rights on the box.
Please remember that Linux is secure as long as the user knows what he is doing or at least is not messing with the system. It can take just only one good written piped command to make the Linux box send lots of packets to a target every time it boots, which could contribute to a massive DoS.
I’d love to see the bash command that would do this. It would need to write a script and install itself to enable it to run on startup. While it might be possible to write a script to download a pre-made script to do such things, I don’t think there is one well-crafted command that could do this.
I didn’t mean for this post to ramble on, but it just seemed like a good topic to touch on. I do see some of what the original poster was saying, but it seems like his examples are pretty far-fetched, and are stretching it a bit. It should be noted as well that it seems more like the poster is talking about malicious commands, which I think would be the more appropriate term in this context.