Just because it made me giggle so much, I thought I’d write up a classic shell prank: pumping messages into someone else’s shell terminal.
If you can ssh into the computer, then you can write messages to other user’s terminal with
However, that’s making it far too easy for the target. The message itself gives the game away! Also, you’ll need an account on the target computer, which means you’ll have to get sudo access. People might leave their computers unlocked but it’s unlikely they’ll have root (at least, without you knowing their password).
One of my favorite linux utilities is
netcat allows you to listen on a port (
-l). When a data is received on that port, it will write that data to the standard output. It would normally send responses using its own standard input, but that can be disabled (
-d). You can also prevent it from closing when the input stream contains an
-k). Because of these features,
netcat is a core component of some backdoors. We’re also using it as a backdoor, but our purposes are fun, so it’s ok.
If your target has a habit of leaving their computer unlocked but you can’t get sudo access, the approach I take for launching this prank is to add this line to
Then, whenever I see the target hacking away in the shell I connect from my own:
And this, folks, is why you shouldn’t leave your computer unlocked (although please do, I can get alot more devious).