0

I been experimenting with Ubuntu for a while now and have been installing and running all types of commands in my terminal which some have been giving to me from other people so I can install certain software or just add stuff to my PC. My questions are:

  • Is it possible that people give you commands that can harm my PC or gain access to my PC for malicious reasons, like messing up root or take control of my pc or view what's on my pc or cause privacy issues, etc.?
  • Is it possible by entering commands giving to me by others, I'm actually giving them permission to do harm or unwanted things to my PC?
  • Is there a way I can see if I am in full control of my PC like Root or super user and no one else is messing with anything?
2
  • Adding to the answers below, avoid running blindly any eval command containing strange strings / any command containing strange strings in general. See what happened to this guy.
    – kos
    Oct 20, 2015 at 17:30
  • It is preferred if you can post separate questions instead of combining your questions into one. That way, it helps the people answering your question and also others hunting for atleast one of your questions. Thanks!
    – guntbert
    Oct 22, 2015 at 19:47

2 Answers 2

1

Is it possible that people give you commands that can harm my PC or gain access to my PC for malicious reasons, like messing up root or take control of my pc or view what's on my pc or cause privacy issues, etc.?

Yes. (Unlikely, but possible.)

Is it possible by entering commands giving to me by others, I'm actually giving them permission to do harm or unwanted things to my PC?

Yes. (Unlikely, but possible.)

Is there a way I can see if I am in full control of my PC like Root or super user and no one else is messing with anything?

You can check if you have full sudo privileges:

$ sudo -l
User muru may run the following commands on muru-arch:
    (ALL) ALL

But you can't really say for sure if nobody is messing with your PC unless you know what commands you ran.

0
0

The basic answer is "Yes" to all of your questions.

It's quite possible that when someone gives you code, it could be malicious, and it's quite possible those people will try to obfuscate the intent.

For example, do you know what printf "\150\145\154\154\157\n" ? It's just a bunch of numbers and slashes, for all you know it could be some form of malicious code. What about this ? :(){ :|:& };: In the first case, that only prints "hello", but second one is what's known as fork bomb.

The point is, don't run what you don't understand; ask people from the community who have at least some experience to explain the code, if you're not sure what it does.

Now, to check if you are in the "full control", you can check

  • /var/log/auth.log for any suspicious activity ( any record for authentication with sudo goes there )
  • last command that shows when and who logged in into computer
  • netstat -tulpan command for unknown outgoing connections or programs or ports

What can you do to protect yourself ?

  • change password from time to time
  • check your system for weird connections from time to time with netstat or for open ports using nmap
  • check list of users in /etc/passwd; you can ignore the system user nobody, read more about that here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .