r/programming • • May 18 '18

The most sophisticated piece of software/code ever written

https://www.quora.com/What-is-the-most-sophisticated-piece-of-software-code-ever-written/answer/John-Byrd-2
9.7k Upvotes

840 comments sorted by

2.7k

u/DonManuel May 18 '18

The most detailed description of stuxnet I read so far, without explicitly researching the topic.

230

u/youlleatitandlikeit May 18 '18

How would you even test this software? The setup would be just insane.

286

u/NighthawkFoo May 18 '18

Supposedly the NSA partnered with Siemens to get the exact model of centrifuges and SCADA controllers to test with.

98

u/[deleted] May 18 '18

I believe they got some of the centrifuges from Libya when their program stopped.

→ More replies (4)
→ More replies (12)

33

u/DonManuel May 18 '18

It highly reduces possible authors though.

12

u/dramboxf May 19 '18

Mossad and NSA is my guess.

→ More replies (1)

543

u/buddahbrot May 18 '18

If you want to learn more about the exploits in Stuxnet, there is a great talk by Bruce Dang at 27C3: https://youtu.be/rOwMW6agpTI?t=413

→ More replies (13)

166

u/realityChemist May 18 '18

If you're interested, I enjoyed Countdown to Zero Day, by Kim Zetter. Here's a ZDNet review

It's got quite a lot of detail about the security aspects of Stuxnet and its predecessors, as well as a primer on uranium enrichment so you get a bit of background in what they were trying to break. Zetter also does a good job painting the big picture and taking about the security and geopolitical ramifications.

→ More replies (8)

101

u/[deleted] May 18 '18

The only thing that's really off is there's no need to have access to anyone private keys.. All you need to do is just own their build server and modify it's compilation tasks to inject your malicious code.. if you drop a few USB sticks on their campus and own a developers' box you can have remote access to their build server and then own it and you can modify their legitimate driver packages with malicious code that THEY then sign. Other than that, it's a pretty well written article.

51

u/[deleted] May 18 '18

So... you think it would have been easier to somehow permanently modify realtek's build system to include the virus in the drivers they deploy and hope that the iran facility updates to the latest version and realtek never finds out? No way.

If you're in their build system, just take their private key and you're done. You can sign whatever you want with it and the compromised machines will happily trust the authority.

Taking the key is way easier, 100% less error prone and future proof.

→ More replies (2)
→ More replies (25)

5

u/pounded_raisu May 18 '18

And the pacing of its explanations kept me on the edge of my seat. Damn.

2

u/StuffMaster Aug 30 '18 edited Aug 30 '18

I didn't know it had its own signed drivers.

→ More replies (5)

1.3k

u/geek_on_two_wheels May 18 '18

When I read the bit about the 21 second loop of good data all I could picture was the looped video footage from Speed.

I knew about stuxnet before but I still love reading about it, every time. Such a beautiful piece of work. Makes me wonder how many of my machines are currently infected.

443

u/lovethebacon May 18 '18

We also don't know how many viruses humans are infected with. If they don't cause a problem, they usually aren't discovered.

62

u/Garestinian May 18 '18

There is a human counterpart, sort of. It's not a virus, though: https://en.wikipedia.org/wiki/Toxoplasma_gondii#Behavioral_differences_of_infected_hosts

It changes human behaviour just so slightly... and it is believed up to half of the population is infected by it.

13

u/northrupthebandgeek May 19 '18

Assuming Chicago Med's depiction of it is accurate, that explains horrifyingly well why people are so infatuated with cat videos.

→ More replies (3)

11

u/thinsteel May 19 '18

So it's basically like stuxnet, but developed by cats to make it easier to catch rats?

→ More replies (2)

144

u/geek_on_two_wheels May 18 '18

That's a good point, and is exactly why I'm curious, but not worried. It's actually probably one of my favourite things about stuxnet: such an incredibly focused goal, with (AFAIK) no adverse effects on the PCs it used to get to the centrifuge.

187

u/DrQuint May 18 '18

Really, the incredible amounts of effort they put onto the dissemination is borderline fiction, it sounds so amazing. But they probably needed to do this, for the sake of ensuring they could get to their goal. With no knowledge of the site the centrifuges would be in or what networks it has, they needed something that would get through, at any single opportunity available. A single USB, a single new printer, a single new computer brought from a different unknown QA site that was infected, anything with no knowledge. They infected the entire goddamned internet and beyond just looking for this, and there's probably not a single living human who know what was the exact method that managed to pass through.

The fact thy disguised the worm's sites as football related site is the best. That's such a common thing to look for, few sysadmins would question it on a network activity, and should someone realize that the computer was infected, they'd just assume it was generic malware trying to push adware on you.

→ More replies (7)

38

u/Mark_at_work May 18 '18

I think I remember my biology teacher saying something about millions of harmless and sometimes even beneficial bacteria living in our bodies.

55

u/geek_on_two_wheels May 18 '18

Look up "biological dark matter." There's stuff in our guts we still know pretty much nothing about and have never seen anywhere else.

→ More replies (1)
→ More replies (5)

209

u/[deleted] May 18 '18

According to the wikipedia page the worm was designed to destroy itself in 2012.

173

u/pxan May 18 '18

Yeah, THAT worm. What about the rest?

→ More replies (4)

56

u/zman0900 May 18 '18

Hmm... Maybe that was what the Mayans predicted.

11

u/tricKsterKen May 19 '18

So this was made by the Mayans. That explains why it's so sophisticated.

→ More replies (3)

58

u/thiseye May 18 '18

I thought of Ocean's Eleven (mostly because I watched it again recently)

7

u/rabidcow May 18 '18

It's Friday, you weren't doing anything productive anyway: http://tvtropes.org/pmwiki/pmwiki.php/Main/CameraSpoofing

→ More replies (1)

107

u/BlueShellOP May 18 '18

The more I read about NetSec, and Stuxnet in particular, the more I am tempted to take all my computers out back and set them on fire and chuck my phone in with them. There's some truly scary things that are going on nowadays and people found out a few years ago and just shrugged and moved on with their lives. At least Europe is trying to crack down on it with GDPR, but it's only a start. It's still the Wild West out here in the US.

→ More replies (24)

28

u/Mnwhlp May 18 '18

Does it count as infected if it ships with the hardware?

96

u/PacketPuncher May 18 '18

Would you consider an AIDS baby infected?

11

u/Johnny_Dangerously May 19 '18

I logged in just to upvote this.

→ More replies (1)
→ More replies (1)

2

u/matholio May 18 '18

My understanding of it, is that it sent a loop of machine telemetry to the monitoring systems, not altered the displays on the computers.

→ More replies (1)

2

u/myringotomy May 19 '18

It really bugs me that the brightest minds in the USA and Israel are working to harm humanity and spy on us.

→ More replies (2)
→ More replies (6)

1.9k

u/youcanteatbullets May 18 '18 edited May 18 '18

At this point, the worm makes copies of itself to any other USB sticks you happen to plug in. It does this by installing a carefully designed but fake disk driver. This driver was digitally signed by Realtek, which means that the authors of the worm were somehow able to break into the most secure location in a huge Taiwanese company, and steal the most secret key that this company owns, without Realtek finding out about it.

Stuxnet was almost certainly written by US or Israeli intelligence. Meaning they bribed, blackmailed, or threatened the right people. Other parts of this worm are technologically sophisticated, this part is espionage.

833

u/lolzfeminism May 18 '18

Another possibility is that they physically broke into Realtek and JMicron. The two companies are in the same industrial park in Taiwan.

670

u/NikkoTheGreeko May 18 '18

Another possibility is that they physically broke into Realtek and JMicron

Or, with the resources this team had, it's also possible they sent in a highly skilled, high value engineer or executive to apply for a position that would allow them into a department in these companies that would allow them access to the key. I don't know how many people have access to the key, but I'd imagine anybody involved in the build process could obtain it.

264

u/JBworkAccount May 18 '18

Not necessarily. For something like a signing key, it might go through an automated process where you have to upload your file, people approve it, then it gets signed and returned to you. This means the key isn't distributed to anyone, it's just on a single build server.

→ More replies (29)
→ More replies (15)
→ More replies (22)

134

u/Cartossin May 18 '18

The idea that the facilities were broken into was suggested by Symantec's whitepaper right when the stuxnet story broke. They said this because the 2 facilities were physically located close to each other. It's just speculation.

16

u/stackcrash May 18 '18

My understanding is it's all but confirmed to be a collaboration of Israel and NSA. Through the years I have read some good write ups about it.

→ More replies (1)

14

u/autoposting_system May 18 '18

Come on, I've seen WarGames. They just went into the lobby and waited for the secretary to go get coffee and then pulled out that little desk extender and read the password off the note taped there.

23

u/TomBombadildozer May 18 '18

Meaning they bribed, blackmailed, or threatened the right people. Other parts of this worm are technologically sophisticated, this part is espionage.

Espionage, perhaps. All the other suggestions? Unlikely.

Humans are careless and easily fooled. It's much more likely (and a much simpler scenario) that some goober at Realtek mis-handled the signing key where an informant could easily retrieve it, or fell victim to a phishing attack that divulged enough information to allow the attackers to retrieve the key themselves through known vulnerabilities.

I think the suggestions of threats, undetected physical break-ins, sophisticated espionage, and so on are just fanciful musing. The overwhelming majority of infosec failures just aren't that glamorous.

80

u/JoseJimeniz May 18 '18

Richard Clark, the US counter-intelligence chief, was telling the story of how Obama was livid when Stuxnet got out there. Because Stuxnet, which was designed to thwart Iran's enrichment program did the exact opposite.

The Israelis were insisting that Stuxnet be more malicious and take more risks to get its job done. US was more cautious, and wanted it to be conservative and stealthy - making absolutely sure it hit only the intended targets.

Stuxnet accidentally disrupted other systems, and its presence became known. When the world realized that it existed, and what it was designed to do (attack Iran), Iran did exactly what you would expect them to do:

  • Iran closed off their networks

  • and re-doubled their efforts

  • having now a larger enrichment program

  • with no way to get at it

Stuxnet had the exact opposite effect than it intended. In every measure it made things worse.

Obama was livid at the Stuxnet team:

You told me they wouldn't find out about it - they did.
You told me it would decimate their nuclear enrichment program - it didn't.

tl;dr: Israel sucks

→ More replies (6)

57

u/Kollektiv May 18 '18

And people keep pushing TLS as the be-all end-all of web security when it's based on the private keys of a few root signing registrars.

39

u/dabombnl May 18 '18

TLS, as designed, does not AT ALL require you to base trust on a few root signing registers or on anyone in particular at all. This is not a requirement of TLS.

Our current public key infrastructure (PKI) DOES REQUIRE that, and that sucks. There are a number of solutions but you have to trust somebody. Certificate Transparency is an effort to at least make it as transparent of a process as possible.

→ More replies (2)

63

u/shady_mcgee May 18 '18

Got a better solution?

210

u/SrbijaJeRusija May 18 '18

IP over armed bike courier

→ More replies (5)
→ More replies (16)
→ More replies (2)

89

u/Kyrthis May 18 '18

Yup, this is exactly what made the hair on my neck rise. To compromise one company’s sanctum sanctorum is theoretically possible for an organized crime syndicate. To do it twice requires government actors.

Also, did you mean espionage 401 as a keypad typo (4->1), or as the HTTP 401 error. Because that would have been hilarious.

81

u/greenlaser3 May 18 '18

I thought the bigger giveaway was the target. It's easy to imagine why a government might want to spend the resources to sabotage uranium processing in another country like this. It's harder to imagine why a private group would go to such lengths to do that.

→ More replies (9)

98

u/wastapunk May 18 '18

Why would you think that once could be done but twice requires government? That seems like a wild statement that is inheritely untrue based on the first part of the statement.

90

u/Mildcorma May 18 '18 edited May 18 '18

Thankfully one of the first guys who found this virus, Kapersky langner, did state in a TED talk on Stuxnet that there was no way this level of complexity could be reached without a nation being involved directly.

I'm more entrusting of the guy who figured this all out, than I am of some random on the internet.

→ More replies (9)
→ More replies (10)

17

u/diamond May 18 '18

Yup, this is exactly what made the hair on my neck rise. To compromise one company’s sanctum sanctorum is theoretically possible for an organized crime syndicate. To do it twice requires government actors.

This takes a very generous view of corporate security. It's just as likely that they had SSH servers open on the default port with root access and a password of "password".

→ More replies (3)
→ More replies (21)

335

u/SomeRandomBuddy May 18 '18 edited May 08 '23

sdvlikmsvd

530

u/davideo71 May 18 '18

And somehow there are few questioning the integrity of the voting boxes that bring us surprising election results.

274

u/BlueShellOP May 18 '18

If you truly believe there's fuckery going in in your local elections, volunteer with your local election authority to count paper ballots.

I agree that electronic voting absolutely should not be trusted, but the onus is on us as citizens to double check elections are fairly run.

45

u/lomeon May 18 '18

...unless you live in a state that doesn't have any paper ballots, or any paper trail whatsoever to audit. For example: Louisiana, Georgia, South Carolina, New Jersey, and Delaware.

→ More replies (1)

27

u/Minnesota_Winter May 18 '18

Then why exactly the FUCK are they getting rid of paper ballots?

43

u/BlueShellOP May 18 '18

Less paper trail.

I think the coming argument on open source software needs to come to a head on voting machines. If there's no public audit, they simply cannot be trusted.

→ More replies (12)

5

u/[deleted] May 18 '18

volunteer

wtf they don't pay you? They pay us $13/hr to do that in Canada

→ More replies (1)

0

u/[deleted] May 18 '18

[deleted]

→ More replies (2)

24

u/[deleted] May 18 '18

the only way to make voting boxes safe is to make them totally offline and have 2 guys with guns on both sides making sure you only touch the glass. and when you're done you throw the voting box into the sea because it's impossible to tally the numbers without being hacked :).

26

u/jfb1337 May 18 '18

Hmm a totally offline voting system... also known as "paper"?

→ More replies (2)
→ More replies (9)

714

u/MasterDex May 18 '18

I always thought that the Fast Inverse Square Root, while being just a tiny algorithm, had a certain sophistication to it.

540

u/L0d0vic0_Settembr1n1 May 18 '18

Fast Inverse Square Root

Ah, you mean the "What the fuck?" algorithm.

326

u/AaroniusH May 18 '18

I love that they kept the comment in there that shares the exact same sentiment. According to the code sample of it on wikipedia:

float Q_rsqrt( float number )
{
	long i;
	float x2, y;
	const float threehalfs = 1.5F;

	x2 = number * 0.5F;
	y  = number;
	i  = * ( long * ) &y;                       // evil floating point bit level hacking
	i  = 0x5f3759df - ( i >> 1 );               // what the fuck? 
	y  = * ( float * ) &i;
	y  = y * ( threehalfs - ( x2 * y * y ) );   // 1st iteration
//	y  = y * ( threehalfs - ( x2 * y * y ) );   // 2nd iteration, this can be removed

	return y;
}

238

u/robisodd May 18 '18

For those who are curious about this, there was a reddit post a few years ago linking to an article written about how this actually works.

If you're into math and low-level computer science, it's pretty interesting.

119

u/srcLegend May 18 '18

The fuck am I looking at lol

→ More replies (25)

75

u/[deleted] May 18 '18

This is godlike level logic. Either the guy who invented this piece of code was an unsung genius or was totally insane. Probably both.

→ More replies (3)
→ More replies (3)
→ More replies (1)

148

u/rk06 May 18 '18

The post is about most sophisticated software, not most "black magic fuckery" software

78

u/MRSantos May 18 '18

The author of that beauty is apparently also unknown. Coincidence? :)

34

u/TomBombadildozer May 18 '18

It's not unknown. It was traced back to two researchers at Berkeley and another programmer who was a student at Berkeley in the 60s.

https://en.wikipedia.org/wiki/Fast_inverse_square_root#History_and_investigation

→ More replies (1)

206

u/nemec May 18 '18

You heard it here first, folks. Quake III was written by U.S. and Israeli Intelligence!

25

u/MaltersWandler May 18 '18

I know you're joking, but the algorithm has been around since before Quake III

→ More replies (2)
→ More replies (3)

56

u/Toast42 May 18 '18 edited Jul 05 '23

So long and thanks for all the fish

41

u/[deleted] May 18 '18

Ideally with something more helpful than "what the fuck?"

56

u/no_ragrats May 18 '18

I think that's pretty helpful tbh. It tells me not to spend my time trying to figure out why, just move on.

→ More replies (4)
→ More replies (2)

0

u/[deleted] May 18 '18

[deleted]

→ More replies (1)

51

u/HelperBot_ May 18 '18

Non-Mobile link: https://en.wikipedia.org/wiki/Fast_inverse_square_root


HelperBot v1.1 /r/HelperBot_ I am a bot. Please message /u/swim1929 with any feedback and/or hate. Counter: 183866

3

u/oilyholmes May 18 '18

Sophistication and elegance are two entirely different things.

3

u/nitsuj May 19 '18

I came across a book years ago that was chock full of float and double bit hacks. For the life of me can't remember what it's called but a bit of Google digging should bring it up.

5

u/Mnwhlp May 18 '18

Agreed. How small it is just makes it more beautiful imo

→ More replies (4)

87

u/brelkor May 18 '18

My take away is that humans tend to be really good at making weapons, which is what stuxnet is. A code weapon.

5

u/modern_glitch May 19 '18

Humans are really good at making and doing a lot of things. One of those things is the weapon-making.

→ More replies (1)

41

u/itstommygun May 18 '18

This is both scary and awe-inspiring.

73

u/horoblast May 18 '18

How did it not get caught but is detected now? Did people just find it? Is this the pinnacle of virusses/worms or are there possibly others, better, new ones, even more sophisticated that we might not know about?

119

u/[deleted] May 18 '18

An error was overlooked when pushing an update to the worm which in short, made it very obvious something was wrong.

51

u/jfb1337 May 18 '18

Now imagine how many worms of a similar scale exist that haven't been discovered by this sort of error

43

u/[deleted] May 19 '18

honestly probably only a few, the amount it costs to make one of these is probably into the billions of dollars when you consider all the previously acquired zero days needed. Also, zero days can be found from unrelated sources, so when you do make something like this attack, you are very limited in the amount of time you have to use it, as you are dependent on at least a few dozen zero days staying open and undetected. plus, if you want to just create mayhem, usually there is an easier way to do it like wannacry.

→ More replies (8)
→ More replies (3)

56

u/Frizkie May 18 '18

If I remember correctly, it's suspected that this was a joint effort between the NSA and Israeli cyber defense groups. The Israelis were a bit too heavy handed with changes they made and it ended up being found in the wild.

26

u/Imperion_GoG May 18 '18

Yep. It was tailor-made to infect and spread within 2 or 3 Iranian facilities. The change that caused it to spread was probably an attempt to have it detect the existence of other possible enrichment facilities.

4

u/[deleted] May 18 '18

There's another comment somewhere around here saying that the controllers accidentally crashed it causing windows boot loops, alerting people to its presence

247

u/vaQ-AllStar May 18 '18

This explains what it did not how it did it. i bet you there are more sophisticated viruses out there yet to be discovered

60

u/CraigslistAxeKiller May 18 '18

There’s one floating around that can install itself onto the inaccessible driver sector of hard drives. This is a special part of the HDD that’s completely inaccessible to the OS. It stores that code that makes the HDD run properly. In order to gain access to it, you need to run a program directly on the CPU IO controller with very specific commands that are only available at the factory that created the HDD. Someone managed to get those special commands for almost every major HDD company so their virus is impossible to purge. If you delete it from the OS, it just reloads itself from the hidden driver sector

It can also write itself onto the network controller. That’s so it can redownload itself without anyone noticing. The code on the HDD driver is really only a link to a website where the virus can be downloaded again. If anyone ever figures that out, they can just block that address so that the computers can’t access it. However, the portion of the virus running directly on the NIC can bypass all of the security restrictions in place to make sure that the virus is downloaded again. It’s damn near impossible to get rid of

Kaspersky was one of the first companies to notice it. They suspect that it was living on their machines for years before anyone even noticed that it was there

0

u/[deleted] May 18 '18

[deleted]

22

u/CraigslistAxeKiller May 18 '18

It sounds scary, but there’s no proof that it’s real. Looks like most researchers think it’s a hoax

17

u/irqlnotdispatchlevel May 18 '18

Are you familiar with the term APT? Here is just a random link https://www.kaspersky.com/about/press-releases/2015_the-great-bank-robbery-carbanak-cybergang-steals--1bn-from-100-financial-institutions-worldwide

These are specially crafted attacks, for certain selected targets. Large organizations (like governments) can sponser them, a lot of time can be invested in just researching the targets, etc etc.

12

u/Cartossin May 18 '18

I heard FLAME has a lot more code in it. Since Stuxnet was the first widely known government malware/cyberwarfare, it gets more attention.

7

u/30thnight May 18 '18

I’m still of opinion that most pirated goods, especially Adobe products are bundled with a little doom.

→ More replies (1)

0

u/[deleted] May 18 '18

[deleted]

87

u/danr2c2 May 18 '18

So I'm reading the article on Gauss and they are talking about the efforts to crack it's encryption back in 2013. It's been 5 years now and I can't find any article newer than 2013 on Gauss. Does anyone know the current status?

75

u/ohshawty May 18 '18

It hasn't been cracked yet. There might be a determined few still working on it, but most have given up.

10

u/rant_casey May 18 '18

Yeah and while I'm not too worried about the logic controllers on my personal uranium centrifuge, Flame is the type of shadowy government spyware you see in movies.

47

u/cryo May 18 '18

Yeah but Gauss is just encrypted. Doesn’t mean it’s more or less sophisticated. Encryption isn’t that sophisticated.

0

u/[deleted] May 18 '18

[deleted]

→ More replies (4)

0

u/[deleted] May 18 '18

[deleted]

108

u/dasbush May 18 '18

Given that this was almost certainly the US government or, maybe, Israeli, they likely used the heavy wrench approach for that part.

0

u/[deleted] May 18 '18

[deleted]

→ More replies (1)

0

u/[deleted] May 18 '18

[deleted]

→ More replies (3)
→ More replies (1)

351

u/Xygen8 May 18 '18 edited May 18 '18

I'd argue the software in the Apollo Guidance System is the most sophisticated piece of software ever written, considering the kind of hardware it ran on. It took humans to the Moon using a 2 MHz processor and 2 kilowords (4 kilobytes) of RAM. For comparison, a TI-82 graphing calculator (designed in 1993) costs $10 (used) and has a 6MHz processor and 32 kilobytes of RAM.

Edit: $10 for a used TI-82

89

u/meltingdiamond May 18 '18

TI will sell a graphing calculator for that cheap now?

→ More replies (7)

29

u/bravenone May 18 '18

But you're going into detail about its limits and how it can't be very sophisticated

More sophistication would have meant that it wouldn't have to have been controlled and maintained in Houston on the ground

→ More replies (3)

59

u/cryo May 18 '18

Yes, but the software itself was relatively simple. A modern 4K intro is much more advanced.

→ More replies (1)

128

u/icannotfly May 18 '18

not to mention that it was programmed by physically weaving wire between magnets https://en.wikipedia.org/wiki/Core_rope_memory

→ More replies (19)

30

u/endorxmr May 18 '18

This comparison always bugs me a little inside: while the processing power of the TI-82 is most likely superior, what people always fail to account is the hardware's physical resistance of the chips in question.

That TI-82 would probably turn into mush if it were subjected to the forces (and vibrations) of any rocket, big or small (even small amateur rockets can be too much for most modern chips).

And then it would get nuked by all kinds of high energy radiation when in space, randomly flipping bits in the memory and inside the cpu, so even if the circuit were still intact it would start throwing errors left and right, rendering its computations completely useless (which is a very, very dangerous situation when it comes to guidance software).

The onboard computers of rockets and satellites have been (and will be) always lagging behind modern hardware due to the insanely harsh conditions they have to endure during launch, reentry, and space travel.

9

u/Periapse655 May 18 '18

This. Same for combat aircraft, especially now that hacking is such an issue. You can bet that if it were as simple as just building a fast machine the military would be running on high end gaming PCs, upgraded every year.

→ More replies (2)

10

u/LuminousElement May 18 '18

I made a spacesuit costume decked out in LEDs, with a "wrist computer" to house the controller. Had a Teensy 3.2 microcontroller running everything from the fan to the OLED on the wrist. Running at 96MHz and with 64KiB of memory, it far surpassed the capabilities of the Apollo guidance computer.

The Teensy cost like $25.

→ More replies (5)

247

u/Conpen May 18 '18

While impressive, I think compilers or operating systems easily take the cake for being most sophisticated.

0

u/[deleted] May 18 '18

[deleted]

47

u/yespunintended May 18 '18

Someone else has said that the virus could be written by US or Israel. If so, those “previously unknown security breaches” could be intentional, and well known by the authors.

→ More replies (1)

36

u/[deleted] May 18 '18

The more complicated the OS, the more potential security holes there are. An OS with no security holes would be the most sophisticated, but that will never exist as long as humans are involved.

23

u/[deleted] May 19 '18

Prepare to have your mind blown.

→ More replies (2)
→ More replies (1)

15

u/Relinies May 18 '18

I'd say yes, it is impressive, though it doesn't make the worm more sophisticated than the operating system. Just more clever.

→ More replies (7)

38

u/PointyOintment May 18 '18

EDIT: this article you just read is awesome. Share it, people.

ಠ_ಠ

46

u/[deleted] May 18 '18

He keeps saying nobody knows who made it and never speculates on that.

In order to break into two premier Taiwanese companies like that you'd probably need some intelligence operation with huge resources. The fact that this worm used extremely sophisticated methods to conceal itself (methods associated with the NSA's secretive Equation Group) and exploited four day-zero bugs (ie previously unknown bugs) suggests the creators had profound cyber warfare resources. And who was the target? The report linked in the article shows that several nuclear powers had breaches, but the overwhelming majority of them were in.... Iran. And then, Kaspersky Labs (a Russian company with ties to the Kremlin) is the group that caught the bug.

This screams US/Israeli intelligence operation.

21

u/no_more_kulaks May 18 '18

The other option is that the Taiwanese government worked together with the attackers. Which is not unlikely considering Taiwan is an ally of the USA and Israel.

9

u/[deleted] May 19 '18

The other option is that the Taiwanese government worked together with the attackers. Which is not unlikely considering Taiwan is an ally of the USA and Israel.

I doubt they willingly gave those keys, they'd be shooting their hardware industry in the foot.

2

u/greengo May 19 '18

Occam’s Razor. There doesn’t need to be a mission-impossible style raid here. Isn’t it completely possible they just got some disgruntled developer drunk, doing a favor for a friend, hot girl, etc etc and were handed a usb with the source code.

13

u/hate_picking_names May 19 '18

In case anyone is wondering, a variable frequency drive (or VFD) is not a motor. It is a device that can control an AC motor. It takes an input ac source (in the case of a centrifuge in Iran, probably 400 V 50 Hz 3-phase) and can vary the frequency and voltage. These are very useful when you need to run things with a lot of mass and/or inertia, need to control acceleration/deceleration, or need to run at different speeds (among other things, I'm sure) and they are pretty efficient.

I work for an automation company and hearing about a plc virus was interesting (though we use AB, not Siemens) but don't really connect them to the internet. We usually even keep them on production-specific vlans to separate them further.

→ More replies (2)

88

u/r3tard3r May 18 '18

No one asking this question. How can I download it

64

u/[deleted] May 18 '18

[removed] — view removed comment

26

u/r3tard3r May 18 '18

Thanks man. I don't care about downvotes maybe it's realtek employee or mossad.

5

u/RigidBuddy May 18 '18

Was it written in assembly?

34

u/[deleted] May 18 '18 edited May 18 '18

I'd vote for the Russian space shuttle Buran, which was written in prolog. Because prolog.

Edit: prolog was used to create an AI expert system that could automatically detect problems and apparently land the spacecraft.

→ More replies (4)

23

u/[deleted] May 18 '18

The best viruses are the ones never detected.

20

u/ender1200 May 18 '18

STUXNET isn't even the most sophisticated malware by equation group. Look up grayfish rootkit for something even crazier.

12

u/Blacks__4__Trump May 18 '18

Even FLAME blows Stuxnet out of the water

9

u/jcy May 18 '18

What was that trojan/virus that spoofed Windows Update servers by using MD5 collision hashes in Microsoft issued cert's to compromise computers?

2

u/icannotfly May 18 '18

duqu?

8

u/jcy May 18 '18

it turned out to be Flame

https://www.theregister.co.uk/2014/11/05/md5_hash_collision/

It was a chosen prefix collision attack similar to this that was used to produce a counterfeit SSL certificate used to sign the Flame malware as Microsoft and pass itself off as a Windows update.

76

u/kiwidog May 18 '18

This driver was digitally signed by Realtek, which means that the authors of the worm were somehow able to break into the most secure location in a huge Taiwanese company, and steal the most secret key that this company owns, without Realtek finding out about it.

Uhhhh, have they seen how shit and bug filled realteks audio drivers are? Does not surprise me 1 bit, and to not have a secure signing server :/

→ More replies (2)

7

u/redditor1983 May 18 '18

As amazing of a story as the stuxnet story is... it really makes you wonder what’s out there that we don’t know about.

There could be other operations that are as sophisticated (or more). But there could also be operations that were almost as good but didn’t quite make it. Both are probably amazing.

78

u/thehumblecode May 18 '18

If it's trying to stop nuclear power without any damage, is considered good or evil?

188

u/PeteTodd May 18 '18

It didn't stop nuclear power, it stopped the creation of enriched uranium.

115

u/down_the_goatse_hole May 18 '18

weapons grade uranium.

The sheer number of the centrifuges targeted showed the scale was above and beyond use for either energy and scientific research.

→ More replies (2)

92

u/Minsc_and_Boo_ May 18 '18

If it was created by Iran and had infected the US, France and Israel, would it have been good or evil? And would it have been considered an act of war?

10

u/tetroxid May 19 '18

Ah no you see it's only evil if brown people do it

→ More replies (3)

34

u/jrhoffa May 18 '18

Evil, because it's still maliciously destructive.

33

u/burnmp3s May 18 '18

TIL every D&D player character is Evil (except maybe Bards)

54

u/Baaljagg May 18 '18

Destroying the narrative still counts ;)

(am bard)

→ More replies (6)

48

u/[deleted] May 18 '18

Sabotaging a nuclear energy program that Iran has a right to as an NPT signatory? Evil.

27

u/flarn2006 May 18 '18

They don't need to be an NPT signatory to have that right. Anyone with the resources has a right to start a program like that, simply because it's not the place of anyone else to tell them they can't.

→ More replies (4)

40

u/down_the_goatse_hole May 18 '18

“commonly known as the Non-Proliferation Treaty or NPT, is an international treaty whose objective is to prevent the spread of nuclear weapons and weapons technology,”

Iran abused the NPT to hide its weapons program. It enriched uranium way above the needed for use in generating power.

→ More replies (1)
→ More replies (60)
→ More replies (15)

4

u/danhakimi May 18 '18

It's fascinating, but I don't know if I'd say that that's more sophisticated than the kernel.

→ More replies (12)

4

u/rebolyte01 May 19 '18

Zero Days (http://www.zerodaysfilm.com) is a documentary about STUXNET that absolutely worth watching.

12

u/[deleted] May 18 '18

The article says "previously unknown bugs" ... I say "U.S. government-paid-for back doors".

9

u/[deleted] May 19 '18

There are probably double agents working for the government at Microsoft who get to put in those bugs.

Linux is worse since anyone can make contributions. NSA could submit like 500 changes all with some kind of vulnerabilities built in but hard to spot, even if 1% get in suddenly the kernel is compromised.

If that's how it works, I'm not sure.

→ More replies (1)

11

u/Color_of_Violence May 18 '18

most sophisticated piece of software/code everwritten? not by a long shot. Most sophisticated piece of malware? definitely. someone got confused with the title.

7

u/DarkTechnocrat May 18 '18

This is the correct answer.

If a similarity gifted author wrote about your average optimizing compiler it would seem similarly amazing.

3

u/LegibleToe762 May 18 '18

This was a great read, anything similar to this? Like some interesting true story but like, well written and stuff

3

u/stronghup May 18 '18

This virus was definitely a technological marvel but how does its sophistication, meaning its complexity compare qualitatively to other pieces of sophisticated software we know about? Say an operating system? Here's some numbers for comparison, although I don't know how many codelines was stuxnet.

http://www.businessinsider.com/how-many-lines-of-code-it-takes-to-run-different-software-2017-2

11

u/bushwacker May 18 '18

The only thing I have ever read on quora of value.

I usually -site:quora.com

5

u/thermidor9 May 19 '18

I love knowing that the programmers who wrote this are definitely on Reddit, very likely seeing their work hailed as "The Most Sophisticated Piece of Software/Code Ever Written"...

...and they are laughing, because they've done so many other things of which we have absolutely no idea.

→ More replies (1)

23

u/SlartibartfastAward May 18 '18

Stuxnet was incredible. Too bad Mossad got greedy and fucked it up. Don't know why we still collaborate with those morons.

3

u/Kyrthis May 18 '18

What do you mean by greedy?

40

u/SlartibartfastAward May 18 '18

It is believed that the NSA wrote the program and Israel's Mossad was primarily in charge of deploying it. It was constantly updated, as the writeup explains, but any changes by Mossad would need to be reviewed and approved by the NSA. It contains code that allows to it check its physical location so that it doesn't spread beyond the enrichment facilities that it was designed to manipulate, but these checks were disabled at some point, most likely by Mossad. Then it spread worldwide and that's how we know about it today. It was a highly, highly clandestine program and we were never supposed to know that it even existed.

→ More replies (2)

5

u/LOLingMAO May 18 '18

In this case, they probably wanted to cause more subtle damage. However, they got greedy which probably led to a bug within the worm.

→ More replies (1)

0

u/[deleted] May 18 '18

[deleted]

108

u/lolzfeminism May 18 '18

No he's right, Mossad was in charge of maintenance and they pushed an update to the worm that wasn't properly tested. It caused a triple fault during boot, basically the worst error you can have. This made infected Windows PC's enter a boot loop.

The boot loop prompted security investigations and eventual discovery. CA's revoked the stolen driver signatures, it's C&C servers were taken offline, the Iranians were alerted and the whole asset became utterly worthless.

29

u/icannotfly May 18 '18

makes me wonder what the current longest-running undetected backdoor out there is, and how many of my machines are infected with it

→ More replies (3)

4

u/YJCH0I May 18 '18

Had to double check that this wasn’t posted to /r/nosleep or /r/CreepyPasta. This is a real thing?!???

7

u/A_bottle_of_charade May 18 '18

Stuxnet isn't even that scary, check out FLAME, built by likely the same people.

Flame can spread to other systems over a local network (LAN) or via USB stick. It can record audio, screenshots, keyboard activity and network traffic.[6] The program also records Skypeconversations and can turn infected computers into Bluetooth beacons which attempt to download contact information from nearby Bluetooth-enabled devices.[7]This data, along with locally stored documents, is sent on to one of several command and control servers that are scattered around the world. The program then awaits further instructions from these servers.[6]

What's scary about flame is it is so versatile and can be used for bascially anything. Stuxnet is very specific.

11

u/mindbleach May 18 '18

This is the space pen / cosmonaut pencil thing all over again. The US (allegedly!) pulled some movie-grade hacker bullshit to bring Iran to the negotiating table for denuclearization. Russia bought ads and trolled Facebook to steal our election and overturn that deal.

See also rubber-hose cryptography.

→ More replies (6)

2

u/KoJee May 18 '18

ITT: far more sophisticated software.

2

u/notk May 18 '18

pffft. read a pmap

2

u/Hindu_Wardrobe May 18 '18

This is the kinda stuff I subscribe for. Awesome read. Thanks for sharing!

2

u/jfb1337 May 18 '18

This is my only concern about self-driving cars

2

u/ohdog May 18 '18 edited May 18 '18

Only problem is that he thinks a variable frequency drive is a motor. It's interesting though because the organization behind this were not just programmers. They understood automation and electrical engineering enough that they made the worm smart enough so that the damage could not be stopped by any safety hardware used in these systems with electric motors controlled by VFD's. They must have had experts in so many areas to pull this off.

2

u/[deleted] May 18 '18

They should make a movie about stuxnet. Maybe when more of the people involved are revealed and Hollywood stops jerking it to superheroes they’ll come up with a script for the story

2

u/beall49 May 19 '18

Sucks I found this so late, but I used to do a lot of work with PLCs. I'd say about 99% of them have no security at all. All of their data is usually broadcasted via an OPC server which is usually very easily accessible (if you know what you're doing). You wouldn't even need to know PLC code, you could in most cases just right back to the OPC server which will write back to the tags in the PLC and walla, speed (or whatever machine variable) changed.

2

u/Semi-Hemi-Demigod May 19 '18

This would make a really great spy thriller. Breaking into secure areas of tech companies? Exploding centrifuges? Just needs a Russian dowsed in liquid helium and it’s a Bond movie!

2

u/[deleted] May 19 '18

Certainly elegant,

but is this sophisticated or fancy? I would almost argue that its brutish.

Though its well engineered it does not do anything thoughtful.

Good article by the way, it laid out the execution steps well.

2

u/mxermadman May 19 '18

I&C Engineer here. The part where it jumps to the PLC boggles my mind.

2

u/btcftw1 May 19 '18

If it was created by Iran and had infected the US, France and Israel, would it have been good or evil? And would it have been considered an act of war?

2

u/Shapebuster May 19 '18

While reading this, a bug crawled across my screen at night. I thought it was part of this article as a joke but then realised i live in australia..

3

u/malaysianzombie May 18 '18

I'm just thankful they built the worm to disarm nuclear capabilities and not like.. yknow, spy on us or something.

3

u/[deleted] May 18 '18

Wow great story. I was literally hooked and couldn't pull my eyes away. Now if only I could find sci-fi books That could keep me interesting in reading.

3

u/seanprefect May 18 '18

I hate to be that guy, but as sophisticated as Stuxnet is... I don't think it compares to the JVM.

3

u/[deleted] May 18 '18

I really think this is the most sophisticated piece of software ever written:

https://github.com/kelseyhightower/nocode

5

u/Dexaa May 18 '18

EDIT: this article you just read is awesome. Share it, people.

Downvoted and deleted.

8

u/[deleted] May 18 '18

I think he meant the article he linked.

4

u/[deleted] May 18 '18

Bollocks.

0

u/[deleted] May 18 '18

[deleted]

63

u/[deleted] May 18 '18

Stuxnet uses WMI, a technology introduced in Windows 2000, to spread laterally. It is trivial to hide a malicious VBScript piece of code in CIMOM, a custom MS Jet database engine (where it is stored in binary format) and schedule it to run at certain intervals. There is nothing sophisticated about it but WMI has been popular among the bad kids lately because nobody else had thought of using it for malitious purposes before so AV companies weren't ready for it. (afaik the first WMI malware was called 'the Moth' presented at KiwiCon 2008).

So the solution is to disable WMI by default, which has been official policy in organizations I've worked with anyway or to use Linux because WMI is Windows only.

Other techniques described in that Quora answer may seem sophisticated to people unfamiliar with the malware underworld but they are well known to malware writers for some time. And allowing somebody to walk in a high security facility with a USB dongle is hardly sophisticated.

55

u/ilikepugs May 18 '18

This is a great response, but I think the sophistication that people are attributing to stuxnet was because of the genius of the attack plan, not the raw complexity of the specific windows vulnerabilities employed.

→ More replies (5)

34

u/AwfulAltIsAwful May 18 '18

Oh give me a fucking break. Are you really going to play the "I could have written this in my sleep" card here? Go away with that noise. Sure, one piece of the attack vector is an old school sploit but this thing did so many things flawlessly and completely under the radar. But I'm sure we're all morons because the rest of us can't see how braindead easy it is to write software that can set a hostile government's nuclear program back several months.

→ More replies (8)

2

u/OnlyReadsFirstLine May 18 '18 edited May 18 '18

Did the virus ever actually attack any countries? I figured it'd just be America/China doing it since they'd be the one with the resources and access to information.

edit: It was an attack on Iran, so yes America did it.

→ More replies (1)