Monday, February 22, 2010

A simple security script

Not long ago I wrote about the misconceptions around Linux invulnerability to virus and malware. Linux is indeed not 100% safe, as was described on THAT ENTRY.

If you are a Linux user and are not aware of such security threats, I very much encourage you to read that entry. If you have, you will likely remember I shared a simple script that would help in checking the content of those shortcut files that could potentially be so harmful. That script was obviously a disaster, a result of my lack of experience and command line skills... (But hey, I tried! ;-) )

I want to share a slight modification of that script, a more elegant way of doing the same thing, both for KDE and GNOME users. Here it goes:

1.- Start by creating a script file on a location of your choice. I recommend you do so at your home folder, so my example will base on that. You can use the text editor of your choice, from the GUI or CLI. I like using gedit.

gedit security_check

2.- Now, enter the following code:


zenity --info --text "$(less ~/.local/share/applications/*.desktop | grep Exec)"


kdialog --title "Security Check" --passivepopup "$(less ~/.local/share/applications/*.desktop | grep Exec)"

3.- Save your script.

4.- In order to be able to trigger it from a shortcut, as I will be covering in this example, you need to modify your script privileges, so it can be executed. Since you are the owner of the script, it is pretty simple:

chmod 744 security_check

5.- You are all set now, just need to create a shortcut from which you can trigger this simple script. Here's how I did it:



And here's what you will see when the script runs:



Obviously, you could also automate the triggering of these scripts, perhaps when your session starts, perhaps as a scheduled task, etc. I will leave that at your discretion, but I do encourage you to run this little script every now an then to ensure none of those ".desktop" shortcuts is doing something nasty.


  1. This comment has been removed by a blog administrator.

  2. This comment has been removed by a blog administrator.

  3. To the first post, THANKS!

    To the second post, thanks as well, even if that had little to do with anything I blog about! ;-)

  4. Tron, ándate con ojo, que en esos dos comentarios, cada punto "suspensivo" es un enlace a una página japo. Tiene pinta de haber sido un robot software que va metiendo el mismo comentario en cada blog. De ahí que lo que digan no tenga nada que ver con tu blog. Lo que no sé es cómo se saltan el captcha.

  5. What antivirus do you recommend when using a Linux system??, Im thinking on switch to Linux, and Im doing some research about it.

    viagra online

  6. Hello, this script could help me a lot because i have security problems.

  7. Hello my friend, i think that if we are talking about linux, the security is the most important thing that we have to consider.

  8. hello, this post is amazing, i would like to read more about it, because think that this information is very interesting.