Tuesday, August 14, 2012

Troll Tricks #1

"Hey steve, what services are running on our server"
"Let me see here, wait...what the fuck? we are running LOLCATS and LOLDONGS and ftp?"
* suppressed childish giggle*


In our first installment of troll tricks, I shall teach you how to modify the port descriptions in linux. Typically when you run a command like "netstat -tlp" or "ss", it will give you the actual name of the port that the number is associated with. 22=ssh, 23=telnet, 25=smtp, and so on. What a bunch of people dont realize is that you can change the text of the reported port, so that 22=LOLCATS, 23=LOLDONGS, and whatever else you'd like. The best part is the changes take place immediately and have no real impact on the server whatsoever.

The secret key to the whole troll is a certain file:
/etc/services

This is the file that holds all the corresponding associations. Simply run:
sudo vi /etc/services

and modify whatever entries you'd like. Now, the next time someone runs a command that interprets port number to port name, it will give the new port name.

It's just that simple. Change back when you are done and everything is back to normal.

No comments:

Post a Comment