Professional Webmasters Community
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Some April Fools Day pranks for Linux users

Go down

Some April Fools Day pranks for Linux users Empty Some April Fools Day pranks for Linux users

Post  andry Wed Aug 04, 2010 4:39 am

Each year, my friends and I always play lots computer-related pranks on each other. I mostly target Linux users for these because that’s where my expertise lies. Linux also makes it really easy to get creative if you can get access to someone else’s computer.


/etc/rc.local scripts.
/etc/rc.local is a script that is run whenever the computer is started, which makes it the perfect place to wreak some havoc if you have physical access to your victims computer while he’s away.

For starters, anything you put in /etc/rc.local should always be inside this conditional:

if [ "`date +%d%m`" == "0104" ]; then
[some code here...]
fi

This has three purposes:

It allows you to put the script there before April 1st and let it activate on the big day.
If your victim can’t figure out how to fix it, it will hit him again next year
If your vicrim can’t figure out how to fix it, he won’t be stuck with it all year
Also, BE VERY VERY CAREFUL HERE. Anything in this file will be run as root, so make sure you don’t do anything that might mess up your friend’s computer.

So what can you do here? You are only limited by your imagination.

For example, if the machine has mplayer installed, it will play almost any sound file you throw at it:

mplayer /home/victim/fartsounds.mp3 & > /dev/null

There’s also the eject command. Let’s put it in a loop with a random sleep time:

(while true; eject; eject -t; sleep $(( $RANDOM%120 + 60)); done ) &

This will cause the first CD drive to eject and then close every 1-3 minutes. You can adjust the time range by modifying the 120 and 60 above. The 120 specifies the range of time in

seconds during which the drive may open and 60 is the minimum amount of time in seconds before the drive opens. In general, $(( $RANDOM%X + Y )) will give you a random number

in range from Y to Y+X.

You can also adjust this command based on the computer you’re working with. For example, if this is a laptop computer where the CD cannot close itself, you can leave out the “eject

-t;”

If this computer has multiple CD drives, you can specify which one to open. This command will open the first two CD drives, then close both:

(while true; eject /dev/sr0; eject /dev/sr1; eject -t /dev/sr0; eject -t /dev/sr1; sleep $(( $RANDOM%120 + 60)); done ) &;

A more annoying loop to put in rc.local might be something like…

(while true; chvt $(( $RANDOM%6+1 )); sleep $(( $RANDOM%1800))

which will switch the screen to a random virtual terminal at least twice per hour. (0-30 minutes apart). Just don’t do this one to a newbie; they might not know how to get back to a graphical interface.

Graphical Pranks
Even if you don’t manage to get access to your victim’s system in advance, you can still run most of the above scripts if they’re foolish enough to leave their desktop up while away. Just open a terminal and run a command with “& disown; exit” at the end. You might also add a long sleep at the begining so that no one suspects that its you who did it. ( Just make sure that the sleep is part of the command that gets disowned:

(sleep 30m; [something annoying]) & disown; exit

There are a couple advantages of this over the rc.local scripts. First, it’s safer. Second, since it would usually be run from inside a graphical environment, you can use commands like this:

sleep 30m; (while true; do fortune | xmessage -file -; sleep $(( $RANDOM%5m )); done) & disown; exit

Or…

(while true; do netcat -lp 12345 | xmessage -file -; done) & disown; exit

The latter will let you send messages to port 12345 on your victims computer if you are on the same network. Just go to your own shell on your own computer and run

netcat victim-laptop.local 12345 << EOF

Where victim-laptop.local is your victims IP or hostname. Then type your message and type “EOF” on a line by itself to end the message. Once someone presses “OK”, you will be able to send another message the same way.

Assuming there are speakers attached to this computer, you can also use espeak:

sleep 30m; (while true; espeak `fortune`; sleep $(( $RANDOM%5m )); done) & disown; exit

Or…

(while true; do espeak `netcat -lp 12345`; done) & disown; exit

And then, there’s a classic Gnome Panel easter egg. On any Gnome desktop, press Alt+F2 and type “Free the Fish”. A small orage fish will swim across the screen and reappear every few minutes. This one will keep a newbie guessing for a while (until they decided to Google it, at least). The great thing about Freeing the Fish is that you can just tell someone to try it and they won’t know how to get rid of it (hint: run “killall gnome-panel” to do so)

Whatever you do, just make sure that you help your victim fix their computer afterwards. April Fools Day jokes are fun, but only to a certain extent.
andry
andry
Moderator
Moderator

Posts : 467
Join date : 2010-05-07

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum