This line of code is the Shellshock exploit
and I'm using it here to check whether my system is vulnerable to the [Shellshot] bug which some would say is even more damaging than
heartbleed
I'm using the echo command to print out some text
And I'm passing this into the [shellshock]
Exploit so that if the system is vulnerable it will print out and vulnerable to the screen and as we can see on here
It's printed out vulnerable, so this system is vulnerable so this system now
I'm logged [into] is on our local network [whereas] this one is my local laptop and has been perhaps
so if I execute the code on here
It doesn't print vulnerable because the machine isn't vulnerable shellshock is a bug in a program called bash now [for] those of us who use
Unix-like systems such as bSD osx Solaris and of course Linux
Sorry GönüL
Enix will be very familiar with this program it is what's called a shell?
Now Unix-like systems are primarily command line based in similar to those if you remember Dos on
[Pcs] before that and the command prompt that you get in windows so bash
Itself is a [gue] new reimplementation of a shell that was developed by Steven born in the late 70s
He developed and it's documented in this technical report from Bell systems the bourne shell is named after himself
which was an improvement on the original thompson shell one of the big benefits of the shells in Unix as well as enabling you to
Interpret commands for you type in you can write what are called?
Shell scripts now a shell script is just a series of commands that are placed into a text file that you can then execute to
Do useful things, so this is a script
I wrote to check my mail every time I logged in all it is is a series of Standard Unix commands that are executed in
Order and it does some postally on the output of these commands to tell me either that I have known you mail
Or how many messages I have I wrote the script when I was an undergraduate here?
And it's been running on the system's ever since
Now this script is quite useful because it shows us some of the more advanced [features] of bash
One of the examples of this is that we can set
Variables in bash one of the other things we can do is create
functions
And just like a function in a programming language is a series of things you can execute and call several times
Bash scripts allow us to Define functions that we can call several times within our bash script
do something useful [you] can also pass variables down from one program [into] any program that it calls these are referred to as
environment variables, so this example
We've got the term variable which is set to say this is a 16 color x term any
Program can look at that and see what type of terminal it's on and then generate the correct
Codes to say set the color to be red
If it's possible [you] can also create functions that can then be passed in to bash on the environment
And it's this ability to create environment functions as they're called this is being exploited in the shell shock
Exploit so for instance. We could create a function called hello, and we put in the opening and closing bracket a curly brace [now]
We can put in the commands that we want to execute in this case echo
Hello
computer file, and if we then pass that into a new instance of bash
When we type hello note the misspelling has deliberate?
It executes those like commands and in this case prints out hello computer file
What people realize with the shell [shock] book is that after that definition of the function if you put a semicolon?
after [this] function definition which to bash means
Those more commands to come and then put in some extra commands say like echo. Hello Brady
Then when we start this bash starts executing them because it's no longer as part [of] the function it just starts executing them it says
Hello, Brady, even [though] I've never told bash directly to do that
Now why is this an export? It's a bug but why is this x politically?
I could have just typed echo hello brady at the keyboard and had exactly the same effect [the] problem
Is that shell scripts are very much uses the glue on Unix systems to stick everything together so the environment variables are passed around from?
Process to child process all the time and uh normally normal things like what terminal are you running on? What's the current user?
What's the current directory if we set one up that contains our malicious code?
Eventually something will run bash and as well as running the code that's checking for our emails because bash is buggy
It'll run this extra. Bit of code of ours as well
Where this becomes a real problem is when environment variables are used to pass things into systems that perhaps we don't even have access to
So a common example of this be a web server [the] other thing we want to be careful
Is that bash is used on lots of systems for example nas boxes?
Smartphones [and] [so] on so they all should be patched as well to make sure that there's no lurking exploits on systems
You perhaps didn't think about?
so
Yeah
We'd like to thank audible.com for sponsoring this computer valve video if you go to audible.com slash computerphile
You'll find loads of books to choose [from] and there's a chance to try one out for free today. I'd like to recommend
how we got to now by Steven Johnson [it] looks at some of the things we've come to rely on in Modern life like
spectacles and fridges and
Wi-Fi for instance Hedy Lamarr the movie Star had a hand in the underlying
Technology that drives Wi-Fi and Bluetooth who knew so check out how we got to now go over to audible.com slash computerphile
Try a book out for free. Thanks once again to them for sponsoring this video
So it's a bit like panning for gold we stick our
Metaphorical sieve into the mud we pull out things and we're shaking it [around] occasionally, [or] we pull out is much just random data
We can't decipher, [but] [occasionally] pull out and we start together, and we get those gold nuggets. [so] we're interested it