Tuesday, February 23, 2010
4:38 AM

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:

GNOME USERS

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

KDE USERS

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:

GNOME



KDE



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

GNOME



KDE



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.

0 comments:

Post a Comment