📜 ⬆️ ⬇️

A brief introduction to trust, or why you can not run blindly without checking scripts from the Internet

How the trust chain works





In a recent article, “VPN to every home,” it is proposed to do a tremendous folly, namely, go to your VPS and enter this:
')
curl -sS https://sockeye.cc/instavpn.sh | sudo bash 


As I wrote in the commentary to that article, this is a very big folly. You blindly run the code from the Internet, which you have not even seen, and even then it does not matter from under sudo or not.

The main reasons are as follows:


To understand, consider the correct way to install programs, first in general:



Again. Absolutely all security is built on your trust in certain people or companies, be it Linus Torvalds, the Ubuntu Security Team, or the author of a small useful utility. You need to make sure that 1. the author is trustworthy, and 2. you run what the author has posted.

Now consider the application of the above method for example, installing Ubuntu Desktop 14.04.01. Absolutely the same method is used when installing everything else, only you do not download a disk image, but, for example, an archive.



Now let's look at how the batch manager works with the example of apt-get:



As you can see, verification happens at all levels. There is no unsigned executable code in your system. In cases similar to those described in a recent article, all these checks are not performed. You have no reason to trust such a code. Therefore, the rule is:

Never run incomprehensible code from the Internet! Either independently make sure that it is safe, or make sure that the author can be trusted, and this is his code. If you do not have enough knowledge to check the code yourself, use only official repositories, there is a special team of specialists who try (and usually she is good at it) to do it for you.

Addition. The only correct way to open access to samopisnymi control panels from the Internet


In a web application, many elements may be vulnerable, the most vulnerable of which is, of course, the code of the application itself. To minimize risks, use http basic authentication with https . This way you shift vulnerability concerns onto the powerful shoulders of the web server.

Understandably, this only works if it’s an internal site; end users need more convenient ways to log in. But samopisnye control panels and other tools are usually designed for internal use and intended.

Offtop. The problem.


Attention! Do not do it on your working machine or server, it will break!
The problem is simply formulated, I assume you have a 64-bit system:
 chmod -x /lib64/ld-linux-x86-64.so.2 

There are several solutions; in the most difficult case, you have no loopholes. I will not specify not to help with the decision.

UPD: The problem is solved in the comments by the person with the login kay , I do not give a solution in case you want to break the brain yourself.

UPD2: As amarao correctly noted, if you don’t understand exactly what you are doing, use only official repositories.

Source: https://habr.com/ru/post/244991/


All Articles