all right everybody i just wanted to talk to you a little bit about the client hello as a part of the
tls handshake now in previous videos we've showed you how tcp first will establish a handshake with
a server and then after that handshake gets established well then tls can begin to do
its thing now during that handshake there's a whole lot going on so i'm going to do my best
to break it down simply for you and we're going to start in this video by taking a look at the
client hello but before we start digging into the weeds let's get just a bit of a brief description
of what's really happening during that handshake so here i just went out to cloudflare and here i
think they just have a really nice graphic for us and also a very good description of what happens
during a tls handshake here we can see a client and server and they're communicating but basically
it tells us that during that tls handshake the two communicating sides exchange messages
to acknowledge each other verify each other establish the encryption algorithms they will use
and then agree on session keys okay so the very first step of that is the client hello that's
we're going to look at today but enough talking about definitions let's go ahead and get into
the packets and have some fun now you can follow along with me by clicking in the link down in the
description down below to download this pcap and follow along or you can go ahead and capture your
own just fire up wireshark hit a server out there on the internet stop wireshark and take a look at
the client hello that you're sending from your machine okay back into the packets so here we
can see we have our send syntax there's our tcp part of the conversation that's tcp kicking off
then right after that we have this client hello so let's go ahead and take a closer look at
what's happening in here if i come down here so after tcp so there's my connection establishment
at the transport layer then we throw security on top of that so right away i can see that this is a
handshake so if the content type is ever handshake then that's going to be the total handshake part
of that tls conversation now on another one of my profiles i'm actually going to flip over now on
another one of my profiles i've actually colored those if i come back to tcplane you can actually
see that the handshake messages i just made more of an aqua color i did that by setting the content
type to handshake of 22 so you can do the same if you want so you can come up here you just
grab this go up to the top and then you can take this and copy it and put it into a coloring rule
okay so up to you let me go ahead and remove that okay so one of the first things that the
client hello wants to do is negotiate the version of tls now there's a lot of different versions
of tls going back to ssl we had ssl 3.0 and somewhat recent history tls 1.0 1.1 1.2 and then
very recently we have tls 1.3 becoming a standard so both a client and a server have to use the same
version in order to communicate you can't have a client using 1.1 and the server using 1.3 so
in that client hello the client will inform the server of the versions that it supports so let's
actually see how that works in the packets okay so if we just take a look within this client hello
all right so we're going to pass tcp come down to transport alert security as we can see this first
field is called a tls record so a record is how data is exchanged within tls endpoints so this is
the very beginning of the tls handshake so we can see here that this is the content type handshake
well next we have version now this is where it really depends on the version that the client is
using if it's using an older version of tls this version field is basically telling the server this
is the lowest version of tls that i can support the highest version of tls that it can support
will be down here in the handshake protocol down here in the version field so if this was a tls 1.2
client that was trying to establish that version communication it would be hey i can go as low as
0.1 but i can also support 1.2 and likely if the server does support 1.2 as well that's going to
be the version that's selected by the server but in the case of tls 1.3 it's different and let's
see how and as we can see here in this packet in this client hello we have tls version 1.3
but you might be thinking okay chris why does it say 1.3 when we have first of all
tls1.o and tls 1.2 here well what's different about tls 1.3 is that we have something new
something unique to version 1.3 and that is a supported versions extension way down here at
the bottom of the of the data okay so hopefully you can see that okay i'm just going to make sure
i'm just going to resize this just a little bit so you can see it okay
all right so just coming down here so this is unique to tls version 1.3 so the very fact that
we have supported versions down here means that this client can support tls 1.3 in fact if we
expand that we can see that the client is saying hey server i can support tls 1.2 i can do tls 1.3
so coming up here why do we see these two versions well first one this one is just our record version
and this is our handshake version that we're using to negotiate so in tls version 1.3 this value here
is always going to be tls 1.0 and we're going to take a brief look at the standard to see why
so in here i'm just on the 8446 standard the rfc and this specifies tls 1.3 if we come down here
to page 79 we can see that in this document we're talking about tls 1.3 which uses this
version of three zero four that's the version four 1.3 but it specifies in order to maximize
backward compatibility a record containing an initial client hello should have version zero
three zero one reflecting tls 1.0 and a record containing a second client hello or server hello
must have version 0303 so what does this all mean well basically the standard is specifying
just leave this version at tls 1.0 for backward compatibility some servers if they didn't see 1.0
coming in it would break them so let's just keep everybody happy and use version tls 1.0 so what's
the takeaway if you're using tls 1.3 you don't really use this field now coming down here version
tls 1.2 why would we advertise 1.2 if we're really tls 1.3 well this is where middle boxes
maybe they aren't yet up to date on version 1.3 so it's possible you still see tls 1.2 here and
that's just to bypass those boxes in the middle so they don't end up dropping it because it's a
version they don't yet support or understand the real version is going to be negotiated because
we have a supported versions field down here and that's where we advertise that to the server
so let's flip over the server hello let's come down to the server hello and the server
comes back and notice what it's doing it says okay version tls 1.2 1.2 great wonderful kicks
that back but the supported version is tls 1.3 so this server does support version 1.3 so we
go ahead and use that going forward and that's our version for this communication now there's a
lot more that can be said here about versions and that negotiation process in fact comment below if
that's something that you'd like me to demonstrate for you maybe we can find some peak caps of some
broken tls conversations or handshakes that were due to incorrect version compatibility all right
but let's keep going all right next in our client hello let's take a look at the cipher suites so if
we come down here i'm in the client hello cypher suites here this client is offering 16 suites to
the server now what is a cipher suite basically it's a collection of algorithms it's like a recipe
hey server i want to use sugar flour eggs honey and in that order and the server says hey do i
have that same recipe okay let's go ahead and go with that recipe but what's actually contained in
that recipe for real so if we come down here and expand this here we can see that we have these
different cipher suites that are supported by the client and again this is basically different
algorithms for encryption and also for data integrity so we tell the server i want to use this
language if you will to derive bulk transfer keys and also to validate that the data is
what it should be once it's received on the other side there's a lot to unpack with this
piece but what i'd like you to take away from this is all of these are possible recipes that the
client supports okay and they're not necessarily in order of priority or the most secure up on top
it's just a list that it supplies to the server now the server on the other side let's see which
ones it offers now if i come down here i can see in the server hello i'm just going to look
at the cipher suite notice the cipher suite coming back from the server is just one so the server is
going to be selecting the suite that will be used and that will define the encryption between the
two endpoints and also the data integrity more on that in another video in fact go ahead and
comment below if you'd like to see more about that all right coming back to the client hello
so after that piece if we come down here okay we got the cipher suites there's a couple other
things that we can focus on in the client hello one that often grabs my attention is coming down
here to server name here i'm identifying which server i would like to talk to well for now with
cls 1.3 this is still unencrypted we can still see this so the nice thing is we can still filter on
that so if i go up to the top for example i can just say i'll just say tcp contains wireshark
so this filter is going to show me any tcp packets that have the clear text string of wireshark in
them so this is still for now open we can still see it with a tls handshake it's one of the few
things left with tls 1.3 that we can still read in clear text however yes there's plans to make
that go away but we'll go ahead and handle that another day now also another thing that's going
to catch my attention in the client hello if i come down here just go down a little bit further
i can see application layered protocol negotiation alpn and this is where the client says hey server
this is the application that i want to use http 2 or http 1.1 what do you got on your side so this
is where the server will come back and actually select the application that will be in use
many cases again modern browser using tls 1.3 most of the time today we're going to be using
http 2. now there's a handful of other extensions that we see here kind of beyond what we're going
to be talking about with this video but again this is helping us to establish that encrypted
connection between the client server absolutely something i peek at supported versions tls 1.3 1.2
and then we can see some other finishing uh things down there in the client hello so this is how that
client will initiate that client hello to the server so for now we'll go and leave it at that
in a future video we'll take a look at the server hello and dig a bit deeper into how tls works