The Shellshock Bug In About Four Minutes

Поділитися
Вставка
  • Опубліковано 24 вер 2014
  • Remember Heartbleed? Well, this is probably worse. Here's a (somewhat simplified) explanation of what Shellshock actually is. Don't worry: I haven't included instructions on how to actually exploit it. The moral of the story is: keep your security patches up to date!

КОМЕНТАРІ • 1,3 тис.

  • @mfx1
    @mfx1 4 роки тому +6117

    Tom Scott is now even recording videos while at a job interview.

    • @mgplays8698
      @mgplays8698 3 роки тому +52

      Now that’s funny

    • @fakeflake5925
      @fakeflake5925 3 роки тому +10

      Jiiiiiiiiiiiiiiiiii

    • @fakeflake5925
      @fakeflake5925 3 роки тому +2

      Iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiuiiiiiiijiiiiiijii j it is

    • @igorino1767
      @igorino1767 3 роки тому +25

      r/ihadastroke

    • @fakeflake5925
      @fakeflake5925 3 роки тому +56

      @@igorino1767 i honestly dont remember watching this video or commenting at all

  • @Freakcent
    @Freakcent 9 років тому +5443

    The shellshock bug can even make red shirts disappear.

    • @thescreemregular5168
      @thescreemregular5168 4 роки тому +67

      No IMPOSSIBLE IT CANT BE

    • @maruftim
      @maruftim 3 роки тому +33

      the only possible explanation

    • @Ithirahad
      @Ithirahad 3 роки тому +45

      I mean, if you've watched Star Trek this isn't surprising; nearly anything can make redshirts vaporize...

    • @redwastaken3363
      @redwastaken3363 3 роки тому +6

      @@Ithirahad thats what i was thinking

    • @VoidKing666
      @VoidKing666 3 роки тому

      Wowwowwowwow

  • @maidbloke
    @maidbloke 9 років тому +4609

    I got distracted by the nice busses.

    • @marajin
      @marajin 9 років тому +172

      They're so lovely and red!

    • @TheSupremeNugget
      @TheSupremeNugget 5 років тому +300

      @@marajin unlike what Tom's wearing

    • @marajin
      @marajin 5 років тому +93

      @@TheSupremeNugget I wasn't expecting a reply after 3 years.. but you have a good point sir

    • @yougo2254
      @yougo2254 5 років тому +11

      @@marajin How old are you now?

    • @marajin
      @marajin 5 років тому +47

      @@yougo2254 much too old. Practically a dinosaur!

  • @IoEstasCedonta
    @IoEstasCedonta 7 років тому +4660

    "The command line is... like having a text message conversation with your computer."
    ...well, I'm officially a thousand years old.

    • @nahyanrajee198
      @nahyanrajee198 6 років тому +39

      Could u explain the joke

    • @nahyanrajee198
      @nahyanrajee198 6 років тому +41

      K thanks

    • @rachels6403
      @rachels6403 6 років тому +169

      It’s still a thing, especially if you use Linux.

    • @jek__
      @jek__ 6 років тому +279

      I laughed out loud at that part
      Also, anyone who is adept at using computers still uses the command line, even young people. That explanation specifically targets young computer novices, as to have a comprehensive explanation, he covers the weakest link

    • @StarLink149
      @StarLink149 6 років тому +97

      Yes, it is still a thing. But in the past there was *only* the command line, which is the difference. Today there are Graphical User Interfaces, GUIs, which make it easier for non-computer adepts to navigate and use a computer. In the past there was no such thing; you had to do everything from the command line. With the arrival of GUIs, the command line has become a thing of the past for regular computer users.

  • @KangasniemiJerri
    @KangasniemiJerri 9 років тому +9831

    Fake Tom Scott.
    No red t-shirt.
    I refuse to accept Tom Scott can possibly wear anything else.

    • @calvinjonesyoutube
      @calvinjonesyoutube 8 років тому +225

      +Jerri Kangasniemi Good call. I think we can deduce that this is some sort of elaborate scam.

    • @dominicbarr5591
      @dominicbarr5591 7 років тому +120

      Ahem, grey hoodie, ahem

    • @Halo3machenima
      @Halo3machenima 7 років тому +60

      I think he was just worried that he would suddenly die. Remember Star Trek: Red Shirts always die.

    • @serglian8558
      @serglian8558 6 років тому +57

      It's hidden, but he's wearing it.

    • @nicholastrombone9899
      @nicholastrombone9899 6 років тому +13

      R.I.P. hoodie :(

  • @lyadmilo
    @lyadmilo 9 років тому +3339

    I really appreciate how, in your more techy videos, you don't talk down to people who can't code.

    • @74oshua
      @74oshua 9 років тому +347

      If you can't explain it to a five year old, you don't understand it yourself.

    • @lyadmilo
      @lyadmilo 9 років тому +273

      I agree but that's not what I meant. Not using jargon is important, but he's also very kind when he says "for those who can't code..." Not like "if you somehow don't know anything in this day..." which unfortunately a lot of educated people do.

    • @OtakuNoShitpost
      @OtakuNoShitpost 8 років тому +69

      +Joshua the Coder Or just don't understand the specific limits of 5 year olds, some of whom may not know the meaning of the word "sabotage".

    • @wfmg7235
      @wfmg7235 8 років тому +18

      I can code, but that forsn't mean I understand this code.

    • @talhatariqyuluqatdis
      @talhatariqyuluqatdis 8 років тому +1

      yus

  • @rhysgregson2750
    @rhysgregson2750 2 роки тому +505

    I never understood how a set of characters like this could do so much... I've recently been learning bash and now I understand.

    • @rentisme
      @rentisme Рік тому +4

      alright Rhys Gregson

    • @klink_75
      @klink_75 Рік тому +3

      you should learn Powershell... now! x3

  • @DefrankedChannel
    @DefrankedChannel 7 років тому +449

    3:45 Gru from Despicable Me wanders in to frame in the bottom left

  • @wow-roblox8370
    @wow-roblox8370 3 роки тому +318

    “In the beginning there was the command line and the computer” is this a new religion?

    • @aladanor
      @aladanor 3 роки тому +7

      I would say it's new for a religion but it's a not new as it's been around for a few decades

    • @jebsie861
      @jebsie861 3 роки тому +17

      You could make a religion out of this

    • @VHCosta
      @VHCosta 3 роки тому +11

      @@jebsie861 completely expected Bill Wurtz

    • @nephihenry4328
      @nephihenry4328 3 роки тому +3

      praise the Omnisaiah! for the machine is immortal

    • @rc_woshimao957
      @rc_woshimao957 2 роки тому +1

      the tom scott shrine

  • @CaledonianCamel
    @CaledonianCamel 8 років тому +1919

    Me watching this video: Bus, bus, bus, bus, bus, bus, bus, bus, bus, bus, bus, bus, bus, bus

  • @erictaylor5462
    @erictaylor5462 8 років тому +2313

    I liked the last line but it presents us with a paradox. A guy on you tube has advised us not to take our security advise from some guy on you tube.

    • @PrivatePaul
      @PrivatePaul 8 років тому +75

      +Eric Taylor thanks captain

    • @johnandaway
      @johnandaway 8 років тому +57

      +Eric Taylor That's the point.

    • @nokizorque
      @nokizorque 8 років тому +40

      +Eric Taylor And what about what he said before hand. "If you write code that's close to the metal". He's talking to low-level developers, not the general public.

    • @erictaylor5462
      @erictaylor5462 8 років тому +47

      nokizorque
      Doesn't matter. He advised viewers not to take advice from people on UA-cam.
      Following his advice would mean disregarding his advice.

    • @johnandaway
      @johnandaway 8 років тому +56

      Eric Taylor Again, that's the point. He's saying, you shouldn't take security advice from him primarily - instead, you should actually read up on it yourself, to be sure.

  • @emeraldfox2949
    @emeraldfox2949 4 роки тому +154

    Thank you UA-cam, for telling me about a bug relevant 6 years ago, I'm still going to enjoy informal Tom Scott, but still

    • @hazgebu
      @hazgebu 4 роки тому +6

      I thought it was a shellshock live bug

    • @camarada1996
      @camarada1996 3 роки тому +7

      It might still be found in unupdated systems

  • @SeanOGrady-miralize
    @SeanOGrady-miralize 9 років тому +4535

    No red t-shirt? You somehow lose credibility without it :P
    I'm obviously kidding.. but it is jarring

    • @BrokebackBob
      @BrokebackBob 8 років тому +268

      Yeah, his clothes match his intellect for a change.

    • @mattmorrisson9607
      @mattmorrisson9607 8 років тому +42

      +Sean O'Grady Scrolled down to the comments to say just this very thing. Of course the interwebs beat me to it. Oh well.

    • @henningerhenningstone691
      @henningerhenningstone691 7 років тому +13

      Heh I just destroyed 666 on the like counter :P

    • @Alex-gv2jc
      @Alex-gv2jc 6 років тому +13

      i didn't notice until now and its actually jarring now that i see it

    • @itchykami
      @itchykami 4 роки тому +194

      Tom Scott is the only person that can look less professional by switching to business formal.

  • @AllDayBikes
    @AllDayBikes 3 роки тому +47

    Tom speaks in two languages simultaneously.
    English, and hands.

  • @PeacoqPrincess
    @PeacoqPrincess 2 роки тому +6

    Funny that this gets reccomended to me the weekend after the Log4j security issue

  • @stevesmith1810
    @stevesmith1810 8 років тому +772

    what's this, a suit? Not a red t-shirt with jeans? this isn't Tom, it's an imposter!

  • @sjwimmel
    @sjwimmel 9 років тому +775

    Who comes up with these genius names like Heartbleed and Shellshock?

    • @lexibigcheese
      @lexibigcheese 5 років тому +158

      some nerd in their mother's basement.

    • @itsCh4rl1e
      @itsCh4rl1e 5 років тому +42

      But that's not true is it Alex

    • @fakename287
      @fakename287 4 роки тому +18

      @@itsCh4rl1e nah it's entirely true lmao

    • @jabster286
      @jabster286 4 роки тому +76

      ch4rl1e97 can confirm, am programmer, do live in mother’s basement

    • @evol-yu4mu
      @evol-yu4mu 4 роки тому +8

      Cisco

  • @devhonk1722
    @devhonk1722 3 роки тому +45

    "Hope you are not taking security tips from some guy on UA-cam"
    **confused liveoverflow watcher noises**

  • @Lampe2020
    @Lampe2020 Рік тому +49

    that syntax looks very similar to the smallest BASH forkbomb, which creates a function called : that just starts another instance of itself and pipes its output to a third instance of itself. And because every instance does this you get exponentially many instances that eventually overload the computer.

    • @SkyyySi
      @SkyyySi Рік тому +3

      It looks similar if you don't know what it actually says. Part of that is that fork bombs are intentionally written to be cryptic, making it easier to troll people with inputting it accidentally. But does
      function fork_bomb() { fork_bomb & fork_bomb; }; fork_bomb
      Really look that similar to shellshock still?

    • @J3wbaumb41
      @J3wbaumb41 Рік тому

      @@SkyyySi you're a real g

  • @baylinkdashyt
    @baylinkdashyt 6 років тому +41

    "In the Beginning was the Command Line".
    My favorite Neal Stephenson composition.

    • @verity3616
      @verity3616 Рік тому +1

      Thank you! I couldn't figure out why that exact sentence felt familiar.

  • @arimago
    @arimago 8 років тому +413

    That's a hell of a lot of busses back there.

    • @timgehrsitz3267
      @timgehrsitz3267 7 років тому +6

      I've been to London, and that's about what some of the tourist spots looked like

    • @Sonicbolt456
      @Sonicbolt456 7 років тому +6

      I live in London and that area in London has a lot of tourism so it needs a ton of busses

    • @leungchoihung2465
      @leungchoihung2465 7 років тому

      Hong Kong has even more

    • @acat4701
      @acat4701 5 років тому +10

      It took me a second to realise that this was an actual comment about the background, not a linux joke

    • @hansisbrucker813
      @hansisbrucker813 4 роки тому +2

      It is a serial bus 😋

  • @Boxsteam
    @Boxsteam 5 років тому +101

    Computers are like old testament gods
    Lots of rules... and no mercy

    • @pranavlimaye
      @pranavlimaye 4 роки тому +13

      Nah fam, computers are real

    • @zokalyx
      @zokalyx 4 роки тому +3

      @@pranavlimaye get rekt justinnn

  • @et_aliae
    @et_aliae 8 років тому +182

    On the subject of "rm -rf /"
    Most systems make you add "--no-preserve-root" to the end, making it harder to accidentally do it.

    • @KingHalbatorix
      @KingHalbatorix 4 роки тому +7

      The quintessential /g/ failure

    • @KnakuanaRka
      @KnakuanaRka 3 роки тому +27

      Also probably a “sudo” at the start to make it run as admin IIRC.

    • @waiitwhaat
      @waiitwhaat 3 роки тому +14

      / directory is actually protected and you have to be in sudo to make any changes to it, which in turn requires you to input the password. still a major bug since it can do literally anything else outside of it.

    • @walksanator
      @walksanator 2 роки тому +4

      @@waiitwhaat you can pipe password into sudo if it has the -s (or is it -S ) flag which takes the password from stdin
      I did this to auto reboot. 0 security though

    • @ananttiwari1337
      @ananttiwari1337 2 роки тому +10

      @@walksanator that saves your password in your bash history though. may not be a great idea

  • @BartRamakers
    @BartRamakers 9 років тому +65

    Hi Tom, please never stop posting videos like this. They're really informative, and you always make me laugh :)

  • @puffdaddy4537
    @puffdaddy4537 2 роки тому +60

    Tom and Michael Reeves are the two UA-camrs who really inspired me to learn programming. After seeing and listening to them talk about what’s possible, it sparked something in me. I now have a hobby that I love, and have access to endless free resources to progress further. UA-cam is a blessing to the independent learner, and I’m thankful there are educational channels like toms around to expose people to subjects they’d otherwise never consider

    • @mayabartolabac
      @mayabartolabac 2 роки тому +4

      ah yes, michael reeves and tom reeves. my favorite programming youtubers.

  • @stellie3553
    @stellie3553 5 років тому +49

    This must be really serious.
    Even the red shirt server isn't accepting requests!

  • @trinarybit2
    @trinarybit2 3 роки тому +14

    "In the beginning, was the command line."
    And it was good.

  • @CoryTheCoder
    @CoryTheCoder Рік тому +4

    wow i'd expect that with this having happened 7 years prior, the log4j thing wouldn't have happened, these two seem very similar to me

  • @RnO7579n7578
    @RnO7579n7578 8 років тому +68

    Shellshock Live 2 Confirmed

    • @phaseloli6668
      @phaseloli6668 8 років тому

      That was already a thing and still is

  • @Tibromatic
    @Tibromatic 4 роки тому +8

    I'm not sure why UA-cam has decided to necro this video but I'm happy it did. As a Linux teacher it amazes me how simply you can present this topic in 4 minutes.

  • @meddiefrercury828
    @meddiefrercury828 9 років тому +3

    Great video! Clear, concise and to the point as always. Keep it up Tom!

  • @0xABADCAFE
    @0xABADCAFE 2 роки тому +4

    I love that UA-cam shows me this 7 years later.

  • @sigilvii
    @sigilvii 2 роки тому +6

    Last time there was a glitch caused by such an obscure string of characters, Dexter Douglas was zapped into cyberspace and turned into the Freakazoid.

  • @darkfafi
    @darkfafi 4 роки тому +471

    Very complicated to explain.
    Explanation:
    "SQL injection but then in bash"

    • @xCorvus7x
      @xCorvus7x 4 роки тому +37

      Cue the follow up question: what is an SQL injection?
      (Thanks to this video and the footnote at 1:51, I have _some_ sort of clue, but I doubt you can expect most people to know what it is.)

    • @zachsilva6201
      @zachsilva6201 4 роки тому +58

      Right and the average reader is supposed to know what a sql injection is or even how databases work? lmfao

    • @Schoko4craft
      @Schoko4craft 4 роки тому +9

      @@zachsilva6201 his point is that a sql injection isn't really complicated and hard to explain.
      But what error leads to the bug might be harder to explain.

    • @Schoko4craft
      @Schoko4craft 4 роки тому +50

      @@xCorvus7x basically sql injection works this way:
      -On a webpage PHP uses SQL commands to get exess to the database
      -PHP communicates with SQL via strings (simplified: "give me that data, store that data, delete that data")
      -Now the webpage maybe wants to give the visitor the abillity to search for a product. So just append the user search to the SQL communication string right?
      - "searching for product with the name = STOP COMMAND AND DELETE ALL DATA TABLES"
      -Hmmmm fuk

    • @seriousbismuth2173
      @seriousbismuth2173 4 роки тому +9

      @@Schoko4craft EXACTly.
      _Some_ may need a *"SQL"* to your comment.😏

  • @DatMilu2K
    @DatMilu2K 7 років тому

    Your last sentence is so true. Yet I'd take your advise! Grat videos, happy to have found your channel recently :)

  • @InservioLetum
    @InservioLetum 2 роки тому +3

    Dear Some Guy, I'm still impressed you managed to make this as digestible as you have, for digitally illiterate users. I may not get my security advice from you (as per your instructions) but I will absolutely be directing my clients to you for this kind of thing. Thank you.

  • @FurryEskimo
    @FurryEskimo 2 роки тому +4

    Being recommended this video ~7 years after it was released.
    Hopefully this was fixed. XD

  • @jeim376
    @jeim376 5 років тому +6

    2:21 the street is being invaded by double-decker buses

  • @brighty79
    @brighty79 9 років тому

    Excellently put together Scott.

  • @cassie4824
    @cassie4824 9 років тому +1

    Thanks for this explanation. You're probably the few who can give people a better understanding of what this really is.

  • @smartydix
    @smartydix 9 років тому +436

    Well, an example where Linux is more vulnerable than Windows, what a time to live in...

    • @mperritoz
      @mperritoz 9 років тому +10

      ***** However, in the case of this bug they would be right in saying that Linux is more vulnerable than Windows.

    • @nightdragonNFS
      @nightdragonNFS 9 років тому +50

      But the chances are this will be fixed reasonably quickly, and unlike windows we won't have to wait for months to get the fix included.

    • @LukasFrimerTholander
      @LukasFrimerTholander 9 років тому +1

      Also Mac

    • @JacobManson
      @JacobManson 9 років тому +37

      nightdragonNFS Microsoft usually patches stuff pretty fast now. They have gotten pretty serious about their security, and it does show. Notice how there are not really any more huge scale worms?
      While this problem is probably easy to fix, I think people also fail to remember how servers are run in the real world. There are servers out there that have been running continuously for the past 10-15 years and have never been updated or even rebooted once. There are servers even older that have never even been updated or are simply forgotten about or unaccounted for.
      Overall, this isn't a huge huge deal because most sane people would never use bash to do anything related to random users, but it is still a very good idea to make sure this is patched on your system.

    • @alcesmir
      @alcesmir 9 років тому +9

      nightdragonNFS
      Pretty much this. The debian servers I run got their updates earlier today, so now everything seems to be fine. That's one of the great things with these OSes, if something sketchy is found it is patched very quickly.

  • @unfa00
    @unfa00 6 років тому +192

    Actaully "rm -rf /" doesn't work any more. You need to add " --no-preserve-root" switch to make rm work on the root of the directory tree. Also, you need to add sudo before that whole command to run that with highest privileges - and type your password in - otherwise it'll fail.

    • @Hans-gb4mv
      @Hans-gb4mv 4 роки тому +38

      'rm -rf /*' there, that's a whole lot shorter. And even as less privileged user, it still will do a lot of damage.

    • @annie3606
      @annie3606 4 роки тому +33

      You only need sudo if you aren't logged in as root user, and since its mainly about servers that isn't too unlikely. And also you only need that flag if you are using the bloated GNU utils, if you instead use the plan9-unix variants the flag is obsolote

    • @Hans-gb4mv
      @Hans-gb4mv 4 роки тому +25

      @@annie3606 Best practice these days has you never ever log in as root but always as a less privileged user. I don't even think there's a single distribution out there that still allows the root user to ssh into the machine by default. And if you have an rm implementation that does allow 'rm -rf /' I suggest to switch it for something that doesn't allow it for those edge cases where things might go wrong.

    • @annie3606
      @annie3606 4 роки тому +5

      @@Hans-gb4mv Well I don't have a server rn but I definitly would never remove the plan 9 utils even on a server once i installed them, since they are faster and i highly prefer them over the GNU bloatware implementations xD

    • @keineangabe4434
      @keineangabe4434 4 роки тому +10

      ​@@Hans-gb4mv True but you still can (and sometimes sadly even have to in a few but still existing cases) go the "sudo su" route.
      A lot of young admins (or guys who stuck with admin duty because it is a small company) see a problem like "my user is not allowed within the log folder" and go "well time to make myself root for a minute".
      And then they forget. And then they keep on being root because they use tmux or something and the thing just keeps him logged in for weeks.
      And then they try something out they just copied from the internet.
      P.S. if you do not know what I am talking about, usually the problem is that people want to "cd" into a folder they do not have permission for. They do not want to give themselves permission because they know that usually the do not need that. They just need it for a minute. So they try "sudo cd" which obviously does not work. So they make themselves root "just for a minute".
      TLDR; why isn't "sudo cd" just a thing? Would save me so much hazel.

  • @videoman413
    @videoman413 9 років тому +1

    Thanks Tom. This was a good primer for the masses, and even some power users like me who understood just enough to see how dangerous it is. Here is hoping Tim and company get this fixed before 10.10. Mr. Cook, are you out there listening?

  • @SeanFictional
    @SeanFictional 9 років тому +2

    Wow, for a bug to go unnoticed that long, kind of amazing.
    Also, on a completely different note: you look great in a suit! XD

  • @GreenCinco12Official
    @GreenCinco12Official 5 років тому +9

    2:12 Smart (or Zoopla?) really knows where to make ads.

  • @sarahlong5886
    @sarahlong5886 9 років тому +267

    Tom, just wondering if there's a reason behind the 2 camera angles when you only look towards the main camera? Haven't seen any other UA-camr do it and I'm wondering if it's like a technical trick to keep people focused or...? :)

    • @TomScottGo
      @TomScottGo  9 років тому +520

      Sarah Long Two reasons: first, it keeps people interested, and second, it means I can cover mistakes and retakes by cutting between the two angles!

    • @peNdantry
      @peNdantry 3 роки тому +18

      @@TomScottGo I much prefer your one-take videos, far more impressive! :)

    • @CurtisJensenGames
      @CurtisJensenGames 2 роки тому +10

      @@TomScottGo hahahaha, I feel that second reason

  • @0ZIR0
    @0ZIR0 5 років тому

    Great way of explaining it to people who no very little or nothing about code or programming. Great video!

  • @robertomaldonado613
    @robertomaldonado613 4 роки тому +1

    Loved the explanation with humble jokes, without any cringey stuff from most youtubers

  • @alcesmir
    @alcesmir 9 років тому +50

    0:58 Most implementations of rm (read _at least the GNU one_) will not accept _rm -rf /_ as is because of a security check. You would have to do _rm -rf --no-preserve-root /_. Although I think _rm -rf /_*_*_* works as well.

    • @Markus9705
      @Markus9705 9 років тому +1

      In most programming languages you have functions to handle command hand argument passing to the shell. It's always good to remember you should use these functions instead of exec() (or whatever it might be called).

    • @ogr3d
      @ogr3d 9 років тому +13

      rm -rf /* will work because bash is going to expand it out to rm -rf /tmp /dev /sys /home ... etc, so the only thing rm knows is that it was passed all the files in that glob in its execv arguments. Here's output of strace of ls * in a bash shell. It first cloned the bash shell, then execve'd it in the child:
      execve("/bin/ls", ["ls", "--color=auto", "app.trc", "boot_sde.sh", "dependencies.sh", "efi-pcnet.rom", "enable_network.py", "kernel-qemu", "raspbian_16gb.img", "raspbian_16gb.img.bak"], [/* 49 vars */]) = 0
      Heh, now I'm going to run rm -rf /* in a virtualmachine I copied into that .img.bak file.
      # ls /
      bin dev home lost+found...
      # rm -rf /*
      # ls /
      bash: /bin/ls: no such file or directory
      :}
      Fun thing, try this:
      $ touch ./-la # dash then letters l a, the list long all arguments
      $ ls *
      You'll notice ls picks up -la like it was passed in as flags. There's no way for the binary to know it was passed in *. This can be used maliciously with rsync to execute a shell script.

    • @trissylegs
      @trissylegs 9 років тому +4

      rm -rf /*
      works because bash changes it to
      rm -rf /bin /boot /dev /etc /home /lib /media /mnt /opt /proc /root /run /sbin /srv /tmp /usr /var
      Before executing it.

    • @baileyharrison1030
      @baileyharrison1030 6 років тому

      Chrysippus apart from windows because Microsoft is different and uses cmd with commands like del and dir

    • @DaVince21
      @DaVince21 6 років тому

      Bailey Harrison Chrysippus means they expected it to be a built in command of bash itself rather than some binary called 'rm' sitting on the hard drive somewhere.

  • @andersevenrud
    @andersevenrud 9 років тому +6

    Time to have a look at my active projects then

  • @hyscript7
    @hyscript7 4 роки тому

    Thanks for explaining! I could not find any other good explanations.

  • @Jianju69
    @Jianju69 9 років тому

    Clear & concise, what a treat!

  • @satan2k
    @satan2k 2 роки тому +4

    Why did UA-cam put me here 7 years after this video went out? UA-cam, go home, you're drunk!

  • @wyro.
    @wyro. 4 роки тому +6

    i have a class in 4 mins, this is perfect

  • @Mattio_
    @Mattio_ 9 років тому +2

    You can check in your terminal if you're vulnerable with;
    env x='() { :;}; echo vulnerable' bash -c "echo did it work?"
    If you get back the word "vulnerable" then it's not patched on your system, but if you get a bash warning without the word vulnerable then you're ok, for now at least.
    I believe they only did a quick fix for now so it's likely we're not still entirely secure, but at least a quick fix will give them time to work on a full fix.
    Nice one on explaining it properly Tom!

  • @CunnyRape
    @CunnyRape 11 місяців тому

    nice subtitles in this video, tom. looks great!

  • @jonahsoldier9736
    @jonahsoldier9736 2 роки тому +4

    Could we get another video like this for the log4j exploit that showed up over the weekend?

  • @CM_CM_
    @CM_CM_ 8 років тому +4

    Shirt looks super good :D

  • @VioletRosesmith
    @VioletRosesmith 9 років тому

    Loving the suit! Looking classy Mr Scott

  • @BramblinTheGnome
    @BramblinTheGnome 9 років тому +1

    The biggest thing I got from this video was watching out the back window. There were bikes, buses, pedestrians and cars all sharing the same street at practically the same time and I didn't see one person try to run down a bicyclist or flip off a pedestrian. Would be lovely to live in a place like that.

  • @AtlasNL
    @AtlasNL 4 роки тому +4

    While we don’t have the red shirt, we do have the red buses

  • @redandpigradioshows
    @redandpigradioshows 4 роки тому +5

    4:16 says the guy who will later have a password manager sponsorship.

    • @privateger
      @privateger 4 роки тому

      Well, a password manager is always a good idea. Although I would never trust a closed-source one.

  • @leonantoniou6192
    @leonantoniou6192 Рік тому +1

    I probably understood 10% of what Scott was talking about but 100% enjoyed it 😊

  • @Bianchi77
    @Bianchi77 Рік тому

    Nice information, thank you for sharing it, keep the video up :)

  • @darleschickens7106
    @darleschickens7106 4 роки тому +3

    "In the beginning...there was the command line." The secret opening line of Genesis.

  • @stereoman23
    @stereoman23 4 роки тому +15

    Is that Gru from Despicable Me walking down the road in the background at 3:46?

  • @ChickpeaBlues
    @ChickpeaBlues 3 роки тому +1

    Looking sharp there Tom

  • @Ealsante
    @Ealsante 2 роки тому +1

    "... t-thanks, Tom, but I'm here for the dishwasher position. Is, uh, am I in the wrong room?"

  • @Mokinng
    @Mokinng 9 років тому +161

    I still don't understand how that command "() { :;};" can make anything after a command.. Like in code injection, if you use ', it ends the string, I get that, but what does this chunk of code mean ? Can anyone explain that ?

    • @TomScottGo
      @TomScottGo  9 років тому +262

      Mokinng It was a bit much for the video, but: it's meant to define a function, which is passed over instead of just a string. That final semi-colon should mean "it's all over", but for some reason it glitches and starts processing commands again instead!

    • @matthewjameskeen
      @matthewjameskeen 8 років тому +19

      Except it's not a bug. It's order of operations, and works properly as defined.

    • @tonystroemsnaes554
      @tonystroemsnaes554 7 років тому +152

      what do you think a bug is? If i make a game where you are supposed to be able to move in all directions, but when testing, you can only move right, isn't that a bug? The coding behind it does what it says, and that makes sense. It's a bug because you have an unintended result, not because of witchery

    • @tonystroemsnaes554
      @tonystroemsnaes554 7 років тому +2

      +Matthew Keen

    • @francescoesco123
      @francescoesco123 7 років тому +10

      No IMHO it's not a bug. If you coded to move in the four directions, then it moves only right, then there is something wrong in your code. If you store the position in a 2 bytes variables and the position exceed 65535, then yiu have an exception and if you didn't catch it the program can crash, and that's a bug, an unexpected behaviour.

  • @sporkafife
    @sporkafife 9 років тому +6

    Wait. I'm watching a Tom Scott video where he's not wearing a red shirt and blue jeans? I didn't know he owned any other clothes :o

  • @Splarkszter
    @Splarkszter 2 роки тому +2

    7 years ago. 7years. awesome.

  • @lynnkaminari6942
    @lynnkaminari6942 4 роки тому

    Looking dapper Tom.

  • @auzzierocks
    @auzzierocks 9 років тому +15

    oh, rm -rf / needs --no-preserve-root at the end of it now and requires it to be run at a root prompt (sudo)

    • @svampebob007
      @svampebob007 9 років тому

      *****
      that one nerd that other nerds hates :)

    • @JackJack-cf7le
      @JackJack-cf7le 9 років тому

      Mitchell Theobald He's assuming that you are already running it as root

    • @kalleguld
      @kalleguld 9 років тому

      Jaxon Flaxon Waxon Root can mean two things here. It can mean the superuser/admin/the user that can do anything on the computer, or it can mean the base of the file system tree. --no-preserve-root uses the word in the second sense.

    • @JackJack-cf7le
      @JackJack-cf7le 9 років тому

      Kasper Guldmann I was referring to OP saying you had to type "sudo" before the command. But you are correct.

  • @Lambda.Function
    @Lambda.Function 4 роки тому +4

    You don't invoke subprocesses in shells typically, which is why this didn't really affect anything, and if you were passing user input into a shell, you were probably already vulnerable to something else.

    • @jahinzee
      @jahinzee 8 місяців тому

      He did say "It's really bad form, but they will [use a shell for subprocesses]." in the video.

  • @RamsFan93
    @RamsFan93 4 роки тому

    Two drums and a cymbal fall off a cliff.
    You have come so far!

  • @ducttapetuba
    @ducttapetuba 2 роки тому

    Looking good, Tom.

  • @mittfh
    @mittfh 9 років тому +7

    sudo rm -rf /* is probably the more correct way to delete everything on Linux, because command shells are usually sane enough to block deleting the root folder itself (although not its contents). Deleting everything in the current folder is rm -rf * (and if you want to annoy friends / colleagues, sing it to the tune of Camptown Races: rm -rf *, doo dah, doo dah; rm -rf *, doo doo dah day!).
    A less severe but equally perplexing command (to the uninitiated) is the fork bomb, which eats up CPU time and the process table, so eventually grinding your system to a halt in only 11 characters:
    :(){ :|:& };:
    Since : is the process identifier, a slightly more human-friendly version would be:
    bomb() { bomb | bomb & }; bomb
    Windows' command interpreter can do it in even fewer characters:
    %0|%0

    • @Sawta
      @Sawta 9 років тому

      I could be mistaken but wouldn't the "-r" part cover everything under "/", as it's recursive? I don't understand what the benifit to using "*" would be in this context.

    • @mittfh
      @mittfh 9 років тому +1

      Sawta Shells apparently prohibit deletion of the root folder itself. However, /* deletes everything _within_ the root folder, -r covers everything in every folder under root, and -f doesn't ask if you're sure you want to screw up your system.

    • @Mostlyharmless1985
      @Mostlyharmless1985 9 років тому

      Sawta / is a directory. rm by default doesn't remove directories. globbing /* would match every file on the system.

  • @MrCpowMan
    @MrCpowMan 9 років тому +3

    It's pretty scary that something like that can exist for so long unnoticed

  • @pingpong1138
    @pingpong1138 8 років тому

    I love shellshock. Always fun to play around with.

  • @jimmysgameclips
    @jimmysgameclips 9 років тому +1

    25 years, that's impressive

  • @JonasDAtlas
    @JonasDAtlas 5 років тому +33

    "[...] or being owned, probably with a zero because it's the internet"
    - Tom Scott 2014

  • @Locke99GS
    @Locke99GS 9 років тому +28

    The bug doesn't need those special characters () { :; }; that is just a minimal empty function. What the bug needs is an unnamed bash function definition; anything can be within the function. This will exploit as well:
    () { printf "yay me"; }; echo "this is bad"
    And for people going on about Windows/Linux/MacOSX, this is a bug in bash, so it affects MacOSX and virtually all Linuxes (server, embedded, desktop). There are Windows ports of bash, but it is very unlikely that your Windows computer has this. You would certainly know if it did.
    Also, this has already been patched and most popular distributions are already pushing the update.

    • @Locke99GS
      @Locke99GS 9 років тому +2

      ***** That was just the expression. Wrap it up in an environment variable or whatever to test:
      env x='() { printf "yay me"; }; echo "this is bad"' bash -c "echo blah"

    • @Locke99GS
      @Locke99GS 9 років тому +4

      ***** I was talking about the contents of the function can be anything. So many people say the bug is () { :;} which isn't necessarily true. It does not have to be an empty function, was my point.

    • @Anonymous-df8it
      @Anonymous-df8it 2 роки тому

      But wouldn't it be designed so that it doesn't follow the code but treats it as a string?

  • @cromagnon305
    @cromagnon305 3 роки тому

    good lord you guys have a lot of busses!

  • @David_Box
    @David_Box 4 роки тому +18

    "In the beghining, there was the command line"
    And then the user said: Let there be light!

    • @fuseteam
      @fuseteam 4 роки тому +3

      *the user said: "make it GUI"

    • @tiltnexus3157
      @tiltnexus3157 4 роки тому

      @@fuseteam the user said: 'startx'

    • @fuseteam
      @fuseteam 4 роки тому

      @@tiltnexus3157 the user said wayland

    • @nullreferenceexception1448
      @nullreferenceexception1448 4 роки тому

      Whom'st made the light shalt suff'r in hell, may the dark mode triumph!

    • @David_Box
      @David_Box 4 роки тому

      @@nullreferenceexception1448 AMEN

  • @GegoXaren
    @GegoXaren 9 років тому +16

    Actually if you use PHP, you should not use command-line interfaces directly, ever. At least not if you take direct input from a user via GET or POST.
    What people forget is that PHP nowadays is not PHP ten years ago. it is modern, and as secure as any other language.
    I may be more comfortable in C and GJS, but when it comes to web stuff, I still go to PHP. It is easy to understand and what not.

  • @darwinianguy
    @darwinianguy 7 років тому

    looking good in the suit.

  • @barrywink2234
    @barrywink2234 4 роки тому +1

    ad at 2:16 "smart knows where to be seen when selling"
    Genius

  • @awhahoo
    @awhahoo 4 роки тому +8

    Me, barely able to do variable print scripts with python: Haha, I understand n o t h i n g

  • @JellyMyst
    @JellyMyst 8 років тому +15

    So... Can anyone tell me what exactly is wrong with PHP (2:50)? I know, I know, I'm an idiot for not knowing this, but please bear with me.

    • @scasino9358
      @scasino9358 8 років тому +13

      +Mrluigifan102 it's probably the most hated language among programmers. it's also quite easy, so there are many beginners likely to make mistakes coding in php. it's responsible for lots of vulnerabilities and glitches.

    • @JellyMyst
      @JellyMyst 8 років тому +2

      s casino All right, then. Well, I'm probably gonna avoid doing things with it in future, then.

    • @scasino9358
      @scasino9358 8 років тому +16

      Mrluigifan102 nah, it's fine if you use it properly. it does get mocked a lot, though. But then again, programmers love to bash competing languages ( java and c++/c# always mock each other, for example ).

    • @JellyMyst
      @JellyMyst 8 років тому +2

      s casino Yeah, I guess that makes sense. Hope I manage to learn how to write good code at some point.

    • @scasino9358
      @scasino9358 8 років тому +4

      Mrluigifan102 you will, i'm sure of it.

  • @Brok3nC4rrot
    @Brok3nC4rrot 9 років тому

    Welp. Updating Bash right now. thanks, Tom.

  • @benjaminmiddaugh2729
    @benjaminmiddaugh2729 6 років тому

    Nice nod to Neal Stephenson, Tom! I'm surprised that no one else caught the book title reference.

  • @Kram1032
    @Kram1032 9 років тому +20

    why does this particular set of characters act that way? What is it supposed to do? What is so special about "() { :;};" ?
    As far as I can tell, that would be some empty function and then a code block with what ever a colon would do and then a full stop, ending that code block with another full stop? I never used Bash so I wouldn't really know.

    • @Scribblersys
      @Scribblersys 9 років тому

      ***** No, that is the actual code.
      Edit: you edited your reply :|

    • @Kram1032
      @Kram1032 9 років тому +5

      The Great Steve that's one method. Another is to systematically look through the code and try to find attacks that way.
      And yet another is dumb luck. And then it's a matter of who the person is who discovered it. Will they report it as they should or will they exploit it and never tell anybody in order to hopefully keep this exploit in as long as possible.
      One last variant, though hopefully a rare one, is that programmers might deliberately put in loop-holes which they then can exploit later down the line. That's harder to do with Open Source but given a large enough project and a convoluted enough bug, it might go unnoticed by others even there.

    • @FeepingCreature
      @FeepingCreature 9 років тому +19

      The exact thing that happens here is that Bash uses environment variables to pass function definitions to sub-shells. It uses environment variables with the same name as the function, containing the function definition in the form of '(args){code;}'. Bash's subshell then looks for environment variables that look like that, and "loads" the function by simply evaluating it. This evaluation pays no attention to the fact the variable might have been filled by something that's not another Bash shell, or there might be more than a function in there. So the string '(){:;};some_code' is equivalent to telling Bash "Hi, I'm the Bash that called you. Here's a variable containing the code for a function I want you to define." And there's more than a function in that variable. That's Shellshock.
      [edit] The current-best patch changes Bash to always pass functions in variables named stuff like FUNCTION_PASSTHROUGH_functionname, so Bash will never try to load a function from a variable called, say, QUERY_STRING or HTTP_COOKIE.

    • @Kram1032
      @Kram1032 9 років тому +2

      FeepingCreature thanks. Sounds like a really subtle issue.

    • @unvergebeneid
      @unvergebeneid 9 років тому +13

      "()" stands for function definition (which would normally be the somewhat more familiar looking "somename()" but somename in that case is the name of the environment variable), "{}" encloses the function definition itself and ":;" is just the shortest code possible. You could write anything that's legal bash code in there but why bother. It's about what comes after the function definition so you can just get it over with. A colon in bash represents something like a command that's always true. It's a kind of no-op really. The semicolon is just the command delimiter as it is in many languages.

  • @ThomasGiles
    @ThomasGiles 9 років тому +3

    Nicely done, Tom. Well explained, and loved the last line ;P
    Am I correct in thinking it would only affect servers? It has to run bash commands, which you can't really do on the client side, right?

  • @TS_Mind_Swept
    @TS_Mind_Swept 2 роки тому +1

    “Getting owned, probably with a zero, because it’s the Internet” lmb0

  • @JimCullen
    @JimCullen 9 років тому

    Oh this is very interesting. I'm about 3/4s of the way through a uni course that has a heavy component of bash/command line programming. The timing of this couldn't have been...better...for lack of a more appropriate word.

  • @chantolove
    @chantolove 4 роки тому +9

    Remember when this was the most worrying thing going on in the world?..

  • @krtirtho
    @krtirtho 3 роки тому +9

    "PHP is the most favorite language"----
    In 2020:
    my uncle: Long ago we had a great server side programming language called PHP

    • @primuszoon
      @primuszoon 3 роки тому

      Still used for 70% of all websites

  • @jdmnissan
    @jdmnissan 4 роки тому

    I love the bus in the background

  • @pilwespoisu
    @pilwespoisu 5 років тому

    Informative content, thanks.
    A small lavalier microphone gets your audio quality up :)

  • @alik250
    @alik250 3 роки тому +10

    "in the beginning, there was the commandline"
    It didn't go anywhere lmao

    • @btat16
      @btat16 3 роки тому +6

      To be fair, the heavens and the earth didn't go anywhere either.