WEBVTT

00:06.680 --> 00:10.460
Hello, guys, and welcome to another video
on this chapter

00:10.490 --> 00:16.160
in this video, we are going to learn how
to decrypt a SSL and TLS traffic using

00:16.190 --> 00:20.420
Wireshark before we go
ahead and demonstrate this.

00:20.450 --> 00:24.980
So let's go through some
history regarding TLS protocol.

00:25.010 --> 00:30.400
So the primary goal of the tosspot layer
security protocol is to provide privacy

00:30.420 --> 00:34.860
and data integrity between two
communicating applications.

00:34.890 --> 00:40.280
And this is being ensured
by encrypting the data so that no one as a

00:40.310 --> 00:45.940
third party will be able to
intercept the communication.

00:45.970 --> 00:53.280
It Authentication appears to verify their
identity by providing a secure channel of

00:53.310 --> 00:58.360
communication between allows
TLS protocol protects the integrity of the

00:58.390 --> 01:02.180
message and ensures it
has not been tampered.

01:02.210 --> 01:04.410
TLS are used interchangeably.

01:04.440 --> 01:07.360
TLS evolved from a SSL protocol that is no

01:07.390 --> 01:12.490
longer question secure
vulnerabilities such as the poodle Attack

01:12.520 --> 01:18.130
has demonstrated this
TLS has gone through iterations

01:18.160 --> 01:24.280
TLS one point one TLS one point two
with the latest update TLS one point

01:24.310 --> 01:30.420
three. So TLS lies in between the
application and the transport layer.

01:30.440 --> 01:32.080
It is designed to work on top of a

01:32.110 --> 01:41.380
reliable transport protocol such as TCP,
and is divided into mainly two suppliers.

01:41.410 --> 01:45.160
So the TCP protocol layer.

01:45.200 --> 01:50.520
You can see here,
this is the lower layer, which lies on top

01:50.550 --> 01:56.340
of the TCP layer, and it's usually
responsible for

01:56.370 --> 02:04.660
encrypt decrypt in the Hash data,
compressing, decompressing the outgoing

02:04.690 --> 02:11.980
or incoming data, fragmenting the message
to be transmitted into multiple blocks.

02:12.010 --> 02:15.170
It is responsible also for applying the

02:15.200 --> 02:20.580
message Authentication code
Hash to maintain the data integrity.

02:20.610 --> 02:26.540
And also it is transmitting the data from
the upper application layer to the low.

02:26.570 --> 02:31.160
To the lower transport
layer and vice versa.

02:31.400 --> 02:37.980
To the the higher so the higher layer.

02:38.010 --> 02:39.700
You can see here

02:39.730 --> 02:46.940
these consist of the following
protocol as the graph indicates alert.

02:46.970 --> 02:48.520
This is a sub

02:49.280 --> 02:54.280
protocol that defines the alert levels and
provides a description of the

02:54.310 --> 03:00.540
alerts. It is used to notify the peer of
any error condition that has occurred.

03:00.570 --> 03:02.200
So the changecypherspec.

03:03.200 --> 03:06.380
It defines changes in the cypher

03:06.410 --> 03:12.440
strategies, the changecypherspec methods
transmitted by both the client and the

03:12.470 --> 03:19.200
Server defined to the renegotiated cypher
spec and keys that would be used for all

03:19.230 --> 03:25.540
the messages exchanged henceforth
the application data.

03:25.570 --> 03:28.200
This protocol ensures that messages are

03:28.230 --> 03:34.400
fragmented, compressed, encrypted and
transmitted in a very secure manner.

03:34.520 --> 03:41.000
Handshake the to communicate over a secure
channel to peers must agree on the

03:41.030 --> 03:45.940
cryptography, keys and encryption
algorithms for that session.

03:45.970 --> 03:48.160
TLS protocol describes the steps to

03:48.190 --> 03:53.860
authenticate the peers set up a secure
connection with defined parameters.

03:53.890 --> 03:58.980
The entire sequence, which involves
setting up the station identifier TLS

03:59.010 --> 04:03.780
protocol, virtual
negotiating, the cipher shoot

04:03.810 --> 04:07.440
certificate authentication of
the peers and cryptography.

04:07.470 --> 04:11.980
Key change between peers
is called a TLS handshake.

04:12.010 --> 04:15.240
One way of decrypting SSL TLS sessions is

04:15.270 --> 04:19.820
to use the private key from the server
that's being connected to by the client

04:19.840 --> 04:22.400
using master secret key must have
secret key to the group necessarily.

04:22.420 --> 04:24.460
Where is the recommended method.

04:24.480 --> 04:29.680
A ping master security
is generated by the client and used by the

04:29.710 --> 04:35.220
Server to derive a master key
that encrypts decision traffic.

04:35.240 --> 04:37.200
It's the current standard in cryptography,

04:37.220 --> 04:42.560
and it's usually implemented
via defeat Hellman.

04:43.320 --> 04:45.440
You are not always going to have access to

04:45.470 --> 04:50.340
the servers private key in this case,
there is another option for

04:50.360 --> 04:56.520
easily viewing Browser, SSL, TLS
traffic from your local system.

04:56.640 --> 05:02.340
So Firefox or Chrome allowed to choose
in a specific environment Firewall.

05:02.360 --> 05:05.780
Then the individual SSL TLS symmetric

05:05.800 --> 05:12.180
easily log to file that got
that Wireshark can read.

05:12.210 --> 05:14.680
With a case Wireshark can show you the

05:14.710 --> 05:19.520
session fully decrypted,
so let us go and configure first the

05:19.540 --> 05:27.700
environment variables and we are going to
take these firstly in the Windows machine.

05:27.730 --> 05:29.980
So once you go to your Windows machine,

05:30.010 --> 05:36.180
you have to go to this PC,
right click properties.

05:36.210 --> 05:39.400
And then you may want to go to advanced

05:39.420 --> 05:43.840
system settings,
environment variables, and here in this

05:43.860 --> 05:49.460
section, you have
to configure the environment variables.

05:49.480 --> 05:54.760
So in this, as you can see,
I've already set it up.

05:55.360 --> 06:00.420
So the way to do that is by pressing New,

06:00.450 --> 06:06.960
you set the variable name
by writing a SSL.

06:07.120 --> 06:09.040
Keylogger.

06:09.560 --> 06:14.040
File in the variable value,

06:14.520 --> 06:21.660
you can browse the directory that
you have created, the SSLKeylogfile.

06:21.690 --> 06:28.800
So before you browse that file, you can
just go ahead to a folder or Directory of

06:28.830 --> 06:35.600
your choice and create a file
called SSL Keylogger file dot log.

06:36.240 --> 06:40.160
Then you can
come back here to variable value section

06:40.760 --> 06:45.880
and you can just go ahead and browse the
file, as you can see, it provided me

06:45.910 --> 06:50.100
straight away to the path
because I've already set it up.

06:50.130 --> 06:52.020
You just select it.

06:52.040 --> 06:55.800
You can put any kind of
name if you want to.

06:55.830 --> 06:59.700
The log on the it has to be that name.

06:59.730 --> 07:05.380
You select it open and now you're ready to
press ok and configure this environment,

07:05.410 --> 07:13.920
but now you're ready to configure this
environment variable for Windows system.

07:14.360 --> 07:21.140
So let's see now how you can configure
the environment variable in Linux.

07:21.170 --> 07:27.420
And Mark, so you can just go ahead and
sudo the command or just sign in with

07:27.450 --> 07:34.500
route and just type export space,

07:34.530 --> 07:39.000
the same name as SSL Keylogfile.

07:40.680 --> 07:44.160
Equals and then you.

07:44.600 --> 07:53.680
Can type the path to SSL, Keylog file
that you have previously created.

08:10.400 --> 08:13.200
Hit enter and then you can.

08:14.000 --> 08:18.320
Go ahead and continue with the rest.

08:27.480 --> 08:29.600
So now that we have configured the

08:29.630 --> 08:36.560
environment, variable, we need
to configure Wireshark as well.

08:36.680 --> 08:40.520
So from the
before you start capturing anything from

08:40.550 --> 08:48.920
the drop down menu, you have to
go and select edit preferences.

08:51.760 --> 08:57.560
Then you have to go to protocols and then
you can scroll all the way down until you

08:57.580 --> 09:00.540
reach the SSL section

09:00.560 --> 09:21.280
and you are going to find a SSL.

09:21.760 --> 09:24.140
And then you are going to

09:24.170 --> 09:29.120
then you are going to have to
go to pre master secret log file.

09:29.640 --> 09:35.320
So here you have to
browse to the log file that you placed in

09:35.350 --> 09:40.380
your environment variable
like we described before.

09:40.410 --> 09:44.980
And then we are ready to start capturing
on our local system so you can hit browse

09:45.010 --> 09:50.960
and then you can navigate to the
location path that you have created this

09:50.990 --> 09:55.780
SSL Keylog file
and just select it and open.

09:55.810 --> 09:57.400
So remember hit, okay.

09:57.430 --> 10:00.040
And now you are ready.

10:00.800 --> 10:07.080
So before we start browsing
and HTTPs a site with our Browser,

10:07.400 --> 10:13.300
we have to start capturing,
you will see that after you have browsed

10:13.320 --> 10:20.260
one or many HTTPs sites, the log file that
you created will start to increase in size

10:20.290 --> 10:25.600
because it logs the symmetric
session keys.

10:27.120 --> 10:30.740
So before we go to the Browser lets just
hit,

10:30.770 --> 10:34.060
start capturing, select the network
interface first

10:34.080 --> 10:39.160
that you would like to capture the traffic
from and start capturing the packets.

10:41.600 --> 10:47.960
So in our Browser now let us go
ahead and navigate ourselves.

10:48.600 --> 10:50.520
So let's go ahead and use the Browser and

10:50.550 --> 10:55.840
navigate ourselves to one
or more HTTP Website.

10:56.800 --> 11:02.720
So we can navigate to our website
just to create more traffic.

11:03.600 --> 11:11.000
Once we are done with that or we
would like to visit some other HTTPS.

11:11.360 --> 11:15.960
Website, we can just go ahead and do so.

11:16.520 --> 11:24.620
And once we are finished, we can just go
to back to Wireshark again and start.

11:24.650 --> 11:27.680
And stop the capture.

11:27.880 --> 11:31.420
So now that we stop the capture,

11:31.450 --> 11:41.480
we may want to go and apply a display
filter since we want to decrypt the.

11:42.120 --> 11:51.400
SSL traffic, so let's go ahead and type
TCP hit enter so we can see all the.

11:54.240 --> 11:59.400
So we can see all the TCP traffic.

12:00.200 --> 12:03.380
So when you look at the packets.

12:03.410 --> 12:06.540
You need to check for Server key exchange

12:06.570 --> 12:14.900
packet apparently Wireshark
cannot decrypt deficient encrypted data.

12:14.930 --> 12:19.720
So the reason that we use the display
filter is that Wireshark captures traffic

12:19.750 --> 12:24.800
from all sorts of programs
and Software that we have in our system.

12:24.830 --> 12:31.320
So we like to focus on our session
with the Browser.

13:03.520 --> 13:13.900
So as you have gone through every line and
found the Server client communication.

13:13.930 --> 13:16.000
You will see that.

13:17.400 --> 13:23.320
In the client key exchange,
you will see the decrypted SSL.

13:23.560 --> 13:25.520
Tab, which.

13:26.560 --> 13:31.960
You can hit and you can see
everything decrypted in Plaintext.

13:36.120 --> 13:38.360
So the change cipher spec

13:38.400 --> 13:40.440
decrypted SSL, so you can see

13:40.470 --> 13:52.800
that everything is a plaintext.

14:08.840 --> 14:16.920
Again, here in this encrypted station, you
hear decrypted the SSL top down under.

14:16.950 --> 14:20.520
And you can see that everything is.

14:20.560 --> 14:24.880
Pretty much in a Plaintext format.

14:27.720 --> 14:32.680
And you have all the
information that you will need.

14:36.440 --> 14:39.040
Another way to view the session is to use

14:39.070 --> 14:45.800
the analyze, drop down and follow the
stream so you can just go and select the

14:45.830 --> 14:50.880
desired line that you would
like to follow, analyze.

14:50.960 --> 14:52.640
Follow SSL stream.

15:21.560 --> 15:23.360
One thing that I would like to also

15:23.390 --> 15:31.200
mention is that you should use caution
when liking these keys and pcaps someone

15:31.230 --> 15:36.160
with access to the Keylog file and your
pcap might very well find your Password

15:36.190 --> 15:40.640
and Authentication quickies
within the pcap.

15:40.960 --> 15:42.640
So that was it for today.

15:42.670 --> 15:49.000
And now you can go ahead and click on the
next video named Converting PCAP XML.

