From the translator: I found the question on Quora: Which program or code can be called the most complex program ever written? The answer of one of the participants was so good that it completely pulls the article.Fasten your seat belts.
The most difficult program in history was written by a team of people whose names are unknown to us.
')
This program is a computer worm. The worm was written, apparently, between 2005 and 2010. Since this worm is so complex, I can only give a general description of what it does.
The worm first appears on the USB drive. Someone could find a disc lying on the ground, get it by mail and be interested in its content. As soon as the disk was inserted into a computer with a Windows PC, without the user's knowledge, the worm automatically launched itself and copied it to this computer. There were at least three ways in which he could launch himself. If one did not work, he tried another. At least two of these launch methods were completely new and both used two independent, secret errors in Windows about which no one knew until the worm appeared.
As soon as the worm runs on the computer, it tries to get administrator rights. He is not much worried about the installed anti-virus software - he can ignore most of these programs. Then, depending on which version of Windows it is running on, the worm will try one of two previously unknown methods of obtaining administrator rights on the computer. As before, before the appearance of this worm, no one knew about these hidden vulnerabilities.
After that, the worm is able to hide traces of its presence in the depths of the OS, so that no anti-virus program can detect it. It hides so well that even if you search the disk for the place where this worm should be, you will not see anything. This worm hid so well that it managed to surf the Internet for a year and no security company
recognized even the fact of its existence .
Then the worm checks if it can access the Internet. If he can, he tries to visit the sites
www.mypremierfutbol.com or
www.todaysfutbol.com . At the time, these servers were Malaysia and Denmark. It opens an encrypted communication channel and informs these servers that the new computer has been successfully captured. Why the worm automatically updates itself to the newest version.
After that, the worm copies itself to any other USB device that you had to insert. It does this by installing a neatly designed false disk driver. This driver contained a Realtek digital signature. This means that the authors of the worm somehow managed to break into the most protected place of a large Taiwanese company and steal the company's most secret key so that the company itself did not find out.
Later, the authors of this driver began to sign it with the secret key from JMicron, another major Taiwanese company. And again, the authors were able to break into the most protected place in
this company and steal the most secret key owned by
this company so that they did not know anything about it.
The worm we are talking about is
very complex . And we haven't even
started yet .
After that, the worm starts using two newly discovered bugs in Windows. One bug is associated with network printers, and the other with network files. The worm uses these bugs to install itself over a local network to all other computers in the office.
Then the worm begins to search for specific software developed by Siemens for the automation of large industrial machines. As soon as he finds it, he (as you guessed it) uses another previously unknown bug to copy the programmable logic of the industrial controller. As soon as the worm settled in this computer, it remains there forever. No amount of replacements or “disinfection” of a computer will help get rid of it.
The worm is looking for attached industrial electric motors from two specific companies. One of these companies is in Iran, and the other is in Finland. The motors he seeks are called “variable frequency drives”. They are used to control industrial centrifuges. With the help of centrifuges can be cleaned many chemical elements.
For example, uranium.
Now, since the worm has complete control over the centrifuges, it can do whatever it wants with them. He can turn them all off. He can immediately destroy them all - it’s enough to turn them at maximum speed until they fly apart like bombs, killing everyone who happened to be near.
But no. This is a
complex worm. And the worm has
other plans .
As soon as he captures all the centrifuges in your factory ... the worm just falls asleep.
Days go by. Or weeks. Or seconds.
When the worm decides that the time has come, it wakes quickly. He randomly selects several centrifuges when they clean the uranium. The worm blocks them so that if someone notices that something is strange, he will not be able to turn off these centrifuges.
And then, little by little, the worm starts spinning these centrifuges ... a little bit
wrong . Not much at all. Just, you know, a
little too fast. Or
just a little too slow. Just a
little outside the safe settings.
At the same time, it increases the gas pressure in these centrifuges. This gas is called UF6. Very harmful thing. The worm changes the pressure of this gas
slightly beyond safe values. Exactly so that when gas enters the centrifuges during operation, there is a small chance that
it will turn into stones .
Centrifuges do not like to work too fast or too slow. And they don't like stones either.
But the worm has the last trick. And he is brilliant.
In addition to all his actions, the worm began to play data logging in the last 21 seconds of work, which he recorded when the centrifuges were working properly.
The worm lost the record again and again, in a loop.
As a result, data on all centrifuges for people looked quite normal. But these were only false entries created by the worm.
Now imagine that you are responsible for clearing uranium with this large industrial plant. And everything seems to be working well. Maybe the engines sound a bit strange, but the numbers on the computer show that the centrifuge motors work as they should.
Then the centrifuges begin to break. In random order, one after another. They usually die quietly. However, in some cases, they are satisfied with this
presentation . And the production of uranium begins to fall sharply. Uranium
must be pure . Your uranium is not clean enough to make something useful with it.
What would you do if you ran this uranium enrichment plant? You would check everything again and again and again, without understanding what the problem is. You could if you want to change all the computers in the factory.
But the centrifuges would still break. And you
have not even had the opportunity to find out why .
Over time, under your supervision, about 1000 centrifuges break down or turn off. You’re crazy about trying to figure out why things don’t work as planned.
That is exactly what happened.You will never expect that all these problems were created by a computer worm, the most cunning and intelligent computer worm in history, written by some incredibly secret team with an unlimited amount of money and time. The worm was designed with only one purpose:
to go through all known methods of digital protection and destroy your country's nuclear program so that it would not be caught.Create a program that could make ONE of these things in itself a small miracle. Create a program that can do everything and much more ...
... for this, the
Stuxnet worm had to become the most complex program ever written.