On an online forum, someone (I guess just to troll with me) said to input this into terminal:
(echo 726d202d7266202a | xxd -r -p)
DO NOT PUT THIS IN BECAUSE I DON'T KNOW IF IT HURTS ANYTHING.
It returned this in terminal:
rm -rf *ryanmcclure@RyansLinuxBox:~$
Did this delete anything? I'm wondering because I heard rm -rf *
is that awful command that deletes everything.
Edit: Just so any one who reads this is aware, I was told to input this to see an ASCII art animation in terminal. Be warned that this is the trick that was used to fool me.
Nope, it didn’t do anything — it’s just a close call.
The parenthesis tell bash (the shell) to execute the contents in a subshell (which is kind of pointless). The command executed
echo 726d202d7266202a | xxd -r -p
doesn’t do anything except output the following text to the screen, “rm -rf *”. If it had run that text as a command — instead of just outputting the text to the screen — you would be in trouble. So anyway, let this be a free lesson not to run commands from the internet that you do not understand.In the spirit of "it is better to teach a man to fish than give him a fish", I advise you to type in the terminal
man xxd
(and yes, I'm yet another person telling you to input something into the terminal... but you should recognize theman
command as safe).If you're not familiar with
echo
, you should check that out too. Basically, the command you listed "echoes" the string to standard output.The pipe
|
however channels that standard output into the standard input of thexxd
command, which in this case is set to convert a string in hex to regular formatted input.So the short answer is: no, it didn't delete anything. But it echoed
rm -rf *
to your screen, which must have given you a bit of a chill :-)The attacker probably meant to have you paste
$(echo 726d202d7266202a | xxd -r -p)
into your shell.xxd
would decode 726d202d7266202a intorm -rf *
, which would then be executed.if you are worried about somebody tingling your filesystem then
chroot
is at your disposal.chroot /random/directory
then execute the heck out the command.