WEBVTT - This file was automatically generated by VIMEO

0
00:00:07.500 --> 00:00:10.300
Hello everyone in this lesson. I will show you how to

1
00:00:10.300 --> 00:00:12.300
 decrypt https traffic.

2
00:00:16.400 --> 00:00:19.800
As you know to be able to analyze https traffic

3
00:00:19.800 --> 00:00:22.400
 and analyst must know how

4
00:00:22.400 --> 00:00:25.900
 to decrypt that traffic the type of traffic. First

5
00:00:25.900 --> 00:00:28.800
 of all, you need to obtain and store

6
00:00:28.800 --> 00:00:31.200
 the TLs session key pairs of

7
00:00:31.200 --> 00:00:35.200
 the traffic you are capturing and decrypting

8
00:00:34.200 --> 00:00:37.600
 https. Traffic is very easy. Once

9
00:00:37.600 --> 00:00:40.900
 you have the session key values

10
00:00:40.900 --> 00:00:44.000
 and I have captured a

11
00:00:43.400 --> 00:00:46.700
 sample https traffic before and recorded

12
00:00:46.700 --> 00:00:50.200
 and stored the session key

13
00:00:49.200 --> 00:00:52.100
 values used in

14
00:00:52.100 --> 00:00:55.200
 that traffic as a log file on

15
00:00:55.200 --> 00:00:58.400
 my computer. And so now

16
00:00:58.400 --> 00:01:01.400
 I have an https traffic in here

17
00:01:01.400 --> 00:01:05.200
 as a peak file and the associated

18
00:01:04.200 --> 00:01:07.700
 session key lock file as well.

19
00:01:07.700 --> 00:01:11.600
 I will be showing you the description process

20
00:01:10.600 --> 00:01:13.200
 with these files.

21
00:01:13.900 --> 00:01:16.200
Later, and so if you want to

22
00:01:16.200 --> 00:01:19.500
 save if you want to store the

23
00:01:19.500 --> 00:01:23.100
 session key values in a log file while capturing

24
00:01:22.100 --> 00:01:26.200
 https traffic with Wireshark,

25
00:01:25.200 --> 00:01:28.300
 let's talk about how you can

26
00:01:28.300 --> 00:01:28.900
 do this.

27
00:01:29.600 --> 00:01:33.200
If you want to capture key values online site,

28
00:01:32.200 --> 00:01:36.300
 you need to change environment variables

29
00:01:35.300 --> 00:01:39.000
 inclined operating system.

30
00:01:39.900 --> 00:01:42.000
So, I mean that you need to

31
00:01:42.300 --> 00:01:45.600
 change the OS the operating system

32
00:01:45.600 --> 00:01:47.700
 environment variables.

33
00:01:48.700 --> 00:01:52.500
And here the client will be our

34
00:01:51.500 --> 00:01:54.900
 web browser. And therefore I

35
00:01:54.900 --> 00:01:58.000
 have to make the necessary adjustments necessary

36
00:01:57.500 --> 00:02:01.300
 change in the Windows operating system

37
00:02:01.300 --> 00:02:05.000
 environment variables to save the session Keys

38
00:02:04.800 --> 00:02:07.700
 first, we will see how

39
00:02:07.700 --> 00:02:11.300
 you can do this how you can change your

40
00:02:10.300 --> 00:02:13.700
 environment variables in

41
00:02:13.700 --> 00:02:14.300
 order to

42
00:02:15.600 --> 00:02:18.700
store the session key players values

43
00:02:19.300 --> 00:02:22.400
now firstly let's open the

44
00:02:22.400 --> 00:02:25.700
 environment variables in our operating system.

45
00:02:25.700 --> 00:02:28.600
 So as you can see I'm using

46
00:02:28.600 --> 00:02:32.500
 the Windows operating system and you

47
00:02:31.500 --> 00:02:34.200
 can easily go to the

48
00:02:34.200 --> 00:02:36.400
 environment variables window.

49
00:02:37.400 --> 00:02:39.900
using the search Tab and

50
00:02:41.300 --> 00:02:45.500
when you type the environment variable to

51
00:02:44.500 --> 00:02:47.300
 the search field, you can

52
00:02:47.300 --> 00:02:51.500
 easily go to the environment variable window and

53
00:02:52.400 --> 00:02:55.700
now I am opening the environment variable

54
00:02:55.700 --> 00:02:57.200
 window in here.

55
00:02:58.100 --> 00:03:00.100
And you will see as well.

56
00:03:06.300 --> 00:03:06.700
So

57
00:03:07.800 --> 00:03:11.100
you can go to this system properties

58
00:03:10.100 --> 00:03:13.200
 window as well to

59
00:03:13.200 --> 00:03:17.400
 reach the environment variables in here. And when

60
00:03:16.400 --> 00:03:20.000
 we open this window, you

61
00:03:19.300 --> 00:03:22.600
 can go to the environment variables.

62
00:03:23.400 --> 00:03:26.300
and when you click on the environment variables you

63
00:03:26.300 --> 00:03:29.600
 have this window in here

64
00:03:29.600 --> 00:03:30.400
 and

65
00:03:32.300 --> 00:03:34.000
in the environment variables window

66
00:03:35.900 --> 00:03:38.900
we will use the user variables

67
00:03:38.900 --> 00:03:39.200
 for

68
00:03:40.700 --> 00:03:44.200
admin in here in my computer maybe in

69
00:03:43.200 --> 00:03:46.700
 your computer. This field is

70
00:03:46.700 --> 00:03:49.500
 called as user variables

71
00:03:49.500 --> 00:03:49.600
 for

72
00:03:51.400 --> 00:03:52.100
any user

73
00:03:52.700 --> 00:03:55.700
User variables for John or

74
00:03:55.700 --> 00:03:58.400
 any other name it

75
00:03:58.400 --> 00:04:02.000
 isn't a matter for us and we will

76
00:04:01.200 --> 00:04:02.800
 use this.

77
00:04:03.900 --> 00:04:06.200
Part in here and we will

78
00:04:06.200 --> 00:04:10.000
 create a new variable in here and

79
00:04:09.500 --> 00:04:12.200
 nothing system variables. They will

80
00:04:12.200 --> 00:04:16.000
 create a user variable a new variable

81
00:04:15.100 --> 00:04:18.100
 in here and click on

82
00:04:18.100 --> 00:04:19.400
 the new button.

83
00:04:20.300 --> 00:04:20.500
and

84
00:04:21.600 --> 00:04:24.800
in this field, we will Define a new

85
00:04:24.800 --> 00:04:27.200
 variable and they will give a

86
00:04:27.200 --> 00:04:28.200
 name to it.

87
00:04:29.100 --> 00:04:33.000
And in here I will give the name to

88
00:04:32.300 --> 00:04:35.700
 my variable as key

89
00:04:35.700 --> 00:04:36.300
 lock.

90
00:04:38.200 --> 00:04:38.600
file

91
00:04:41.200 --> 00:04:43.700
and in the variable value

92
00:04:44.800 --> 00:04:47.700
perimeter, you can enter you

93
00:04:47.700 --> 00:04:51.300
 can type the file pad where you

94
00:04:51.300 --> 00:04:54.600
 want to save your log file. So, for example, I will

95
00:04:54.600 --> 00:04:57.600
 type this pet in here.

96
00:04:58.500 --> 00:05:01.800
or you can you can choose your

97
00:05:01.800 --> 00:05:04.800
 file pad using this browse

98
00:05:04.800 --> 00:05:07.500
 file or browse directly

99
00:05:07.500 --> 00:05:10.800
 options, or you can directly type your file

100
00:05:10.800 --> 00:05:13.300
 pad in here and I want

101
00:05:13.300 --> 00:05:16.800
 to type my pad as the

102
00:05:18.400 --> 00:05:19.800
desktop and

103
00:05:21.800 --> 00:05:24.700
now I will give a name to my

104
00:05:24.700 --> 00:05:27.900
 log file which I

105
00:05:27.900 --> 00:05:31.000
 will save the session key

106
00:05:30.000 --> 00:05:31.500
 values.

107
00:05:32.900 --> 00:05:35.300
And in here I want

108
00:05:35.300 --> 00:05:38.700
 to give a name as key lock.

109
00:05:39.900 --> 00:05:40.400
file

110
00:05:41.900 --> 00:05:44.700
that look so you

111
00:05:44.700 --> 00:05:47.400
 can name your file like this.

112
00:05:48.900 --> 00:05:51.300
And is key log

113
00:05:51.300 --> 00:05:54.200
 file I have typed is key lock

114
00:05:54.200 --> 00:05:57.900
 file and you can specify its extension

115
00:05:57.900 --> 00:05:59.900
 as that look.

116
00:06:01.300 --> 00:06:01.500
and

117
00:06:02.600 --> 00:06:06.600
then just click the OK button and

118
00:06:05.600 --> 00:06:08.900
 confirm the chains of

119
00:06:08.900 --> 00:06:09.400
 this.

120
00:06:10.800 --> 00:06:11.300
process

121
00:06:12.800 --> 00:06:15.600
I will not complete this process in here

122
00:06:15.600 --> 00:06:19.600
 now because I have done it before so because

123
00:06:18.600 --> 00:06:21.900
 and now I will click

124
00:06:21.900 --> 00:06:22.800
 on the cancel.

125
00:06:25.600 --> 00:06:27.400
In this way and cancel again.

126
00:06:28.100 --> 00:06:29.400
And to cancel again.

127
00:06:31.800 --> 00:06:34.500
After defining the necessary environment

128
00:06:34.500 --> 00:06:38.000
 variable you will see that your log file

129
00:06:37.200 --> 00:06:40.300
 is created once you launch your

130
00:06:40.300 --> 00:06:41.300
 web browser.

131
00:06:41.900 --> 00:06:44.500
Namely once we activate

132
00:06:44.500 --> 00:06:47.300
 it the environment variable the client will start

133
00:06:47.300 --> 00:06:50.500
 to store the temporary session Keys

134
00:06:50.500 --> 00:06:53.500
 locally in the log file you have defined.

135
00:06:54.300 --> 00:06:58.000
And now we can give that session log

136
00:06:57.200 --> 00:06:59.400
 file to Wireshark.

137
00:07:01.300 --> 00:07:04.700
And thus it will decrypt the traffic

138
00:07:04.700 --> 00:07:07.400
 for us using this session keys.

139
00:07:07.400 --> 00:07:11.600
 So now let's talk about

140
00:07:11.600 --> 00:07:14.600
 the decrypting https traffic

141
00:07:14.600 --> 00:07:15.500
 in Wireshark.

142
00:07:16.200 --> 00:07:19.800
Earlier, I have captured the https traffic as

143
00:07:19.800 --> 00:07:23.400
 I told you before I have captured the https

144
00:07:22.400 --> 00:07:25.500
 traffic happening happening. As

145
00:07:25.500 --> 00:07:31.100
 soon as I visited the www.wire shirt.org

146
00:07:30.100 --> 00:07:33.800
 website and this PK file

147
00:07:33.800 --> 00:07:36.900
 contains that traffic to

148
00:07:36.900 --> 00:07:40.100
 see only the relevant TLS traffic.

149
00:07:40.600 --> 00:07:41.600
as in here

150
00:07:42.300 --> 00:07:43.500
just like in here.

151
00:07:44.700 --> 00:07:47.600
I fetch the packets following the

152
00:07:47.600 --> 00:07:50.600
 TCP stream from the packet

153
00:07:50.600 --> 00:07:53.600
 in which the TLs handshake started.

154
00:07:54.400 --> 00:07:55.800
in here and

155
00:07:57.200 --> 00:08:00.400
with this filter with using

156
00:08:00.400 --> 00:08:03.300
 this filter experience and I have

157
00:08:03.300 --> 00:08:06.500
 already showed this filter in the previous in

158
00:08:06.500 --> 00:08:09.700
 the previous lesson. So and now

159
00:08:09.700 --> 00:08:13.000
 as you can see no HTTP

160
00:08:12.700 --> 00:08:15.100
 packets appear in

161
00:08:16.300 --> 00:08:17.900
Here there is no.

162
00:08:19.500 --> 00:08:22.700
There's no HTTP packet. Just

163
00:08:22.700 --> 00:08:27.000
 we can see the TLs packets

164
00:08:25.200 --> 00:08:28.500
 in here because the

165
00:08:28.500 --> 00:08:31.400
 all packets in the traffic.

166
00:08:32.200 --> 00:08:35.600
Have been encrypted with the TLs

167
00:08:35.600 --> 00:08:38.900
 version 1.3 protocol.

168
00:08:39.700 --> 00:08:39.900
and

169
00:08:41.100 --> 00:08:41.700
in addition

170
00:08:43.200 --> 00:08:45.200
Only client hello.

171
00:08:45.900 --> 00:08:46.700
is in here

172
00:08:47.500 --> 00:08:51.100
only client hello and server. Hello

173
00:08:50.100 --> 00:08:54.200
 packets are clearly visible from TLS

174
00:08:53.200 --> 00:08:56.600
 handshake packets because from

175
00:08:56.600 --> 00:08:57.700
 this point on

176
00:09:00.200 --> 00:09:03.800
The traffic is encrypted and all

177
00:09:03.800 --> 00:09:07.700
 packets are in the form of application data.

178
00:09:09.400 --> 00:09:09.900
as you can see

179
00:09:11.100 --> 00:09:12.700
in addition, there is only

180
00:09:14.200 --> 00:09:17.700
TLS as a protocol, so now

181
00:09:17.700 --> 00:09:20.400
 let's make decryption on the

182
00:09:20.400 --> 00:09:21.500
 turf now.

183
00:09:23.800 --> 00:09:27.800
Let me show you how you can decrypt the

184
00:09:26.800 --> 00:09:29.700
 packets in Russia.

185
00:09:30.800 --> 00:09:34.000
So to do this, we will go to the edit

186
00:09:33.500 --> 00:09:37.600
 menu and the preferences menu

187
00:09:37.600 --> 00:09:41.000
 under the edit. Now, let's

188
00:09:40.600 --> 00:09:44.100
 go to the protocols and expand

189
00:09:43.100 --> 00:09:45.500
 the protocols.

190
00:09:46.700 --> 00:09:49.600
And we will go to the TLs.

191
00:09:50.200 --> 00:09:50.900
protocol

192
00:09:51.600 --> 00:09:52.300
as in here

193
00:09:53.600 --> 00:09:57.200
in this window the transport layer

194
00:09:56.200 --> 00:09:58.700
 security protocol window.

195
00:10:02.600 --> 00:10:05.300
We will address the we will

196
00:10:05.300 --> 00:10:09.200
 assign the session key payers

197
00:10:08.200 --> 00:10:12.600
 values file log file key session

198
00:10:11.600 --> 00:10:14.100
 key log file to the

199
00:10:14.100 --> 00:10:16.300
 Wireshark. We will give the

200
00:10:17.100 --> 00:10:21.400
Are session key values to Wireshark

201
00:10:20.400 --> 00:10:23.600
 in order to decrypt our

202
00:10:23.600 --> 00:10:26.400
 traffic and in here,

203
00:10:26.400 --> 00:10:29.300
 we have a fair Master secret

204
00:10:29.300 --> 00:10:33.600
 log file name and we will show we

205
00:10:32.600 --> 00:10:35.700
 will browse our key

206
00:10:35.700 --> 00:10:38.800
 logs file is in here. I have a

207
00:10:38.800 --> 00:10:42.400
 key logs file in here associated with

208
00:10:42.400 --> 00:10:45.900
 this traffic PF File and with

209
00:10:45.900 --> 00:10:48.600
 https traffic and choose.

210
00:10:49.700 --> 00:10:52.400
The keys log file key lock

211
00:10:52.400 --> 00:10:56.300
 file your key lock file then click

212
00:10:55.300 --> 00:10:57.100
 on the open.

213
00:10:57.800 --> 00:10:58.400
and now

214
00:11:00.800 --> 00:11:02.700
you can click on the ok.

215
00:11:03.500 --> 00:11:04.000
Of course.

216
00:11:07.900 --> 00:11:09.400
and click on OK

217
00:11:13.200 --> 00:11:16.200
Here it is. As you can see haircuts that

218
00:11:16.200 --> 00:11:20.000
 were previously encrypted are now clearly

219
00:11:19.000 --> 00:11:21.100
 visible.

220
00:11:21.900 --> 00:11:25.200
Now we can see the HTTP packets

221
00:11:24.200 --> 00:11:25.600
 in here.

222
00:11:26.500 --> 00:11:27.000
and

223
00:11:28.700 --> 00:11:31.900
Other handshake packets are also

224
00:11:31.900 --> 00:11:34.400
 visible now as you

225
00:11:34.400 --> 00:11:35.100
 can see in here.

226
00:11:36.200 --> 00:11:40.800
These handshake packets were were

227
00:11:39.800 --> 00:11:42.300
 in the form of

228
00:11:42.300 --> 00:11:45.400
 application data, but now we can see

229
00:11:45.400 --> 00:11:47.000
 clearly there.

230
00:11:48.800 --> 00:11:49.100
some

231
00:11:49.800 --> 00:11:53.400
They have some encrypted extensions compressed

232
00:11:52.400 --> 00:11:55.400
 shortcut and the other

233
00:11:55.400 --> 00:11:58.700
 sort of could verify the data and the

234
00:11:58.700 --> 00:12:01.800
 finished message in this packet.

235
00:12:01.800 --> 00:12:05.700
 But before the decryption process

236
00:12:05.700 --> 00:12:09.400
 we couldn't see the these details

237
00:12:09.400 --> 00:12:13.600
 associated with this handshake packet,

238
00:12:13.600 --> 00:12:16.500
 but now we can see all the

239
00:12:16.500 --> 00:12:19.600
 details about the packets about

240
00:12:19.600 --> 00:12:22.500
 the handshake packets and other

241
00:12:23.700 --> 00:12:26.800
encrypted packets and now

242
00:12:26.800 --> 00:12:29.600
 we can see a HTTP version

243
00:12:29.600 --> 00:12:32.700
 2 file in here clearly and the

244
00:12:32.700 --> 00:12:34.300
 other HTTP file.

245
00:12:35.100 --> 00:12:39.100
And now if you type the filter expression to

246
00:12:38.100 --> 00:12:41.900
 the display filter field as

247
00:12:41.900 --> 00:12:45.700
 HTTP to you

248
00:12:44.700 --> 00:12:48.400
 can fetch the packets

249
00:12:47.400 --> 00:12:50.500
 associated with this protocol with

250
00:12:50.500 --> 00:12:53.500
 the http/2 protocol, but before

251
00:12:53.500 --> 00:12:54.900
 the decryption process

252
00:12:56.500 --> 00:13:00.300
Even you have typed the http/2

253
00:12:59.300 --> 00:13:02.700
 in here to you couldn't

254
00:13:02.700 --> 00:13:05.800
 fetch the packets with the

255
00:13:05.800 --> 00:13:08.500
 http/2 protocol. So now

256
00:13:08.500 --> 00:13:13.400
 we can clearly see the packets.

257
00:13:12.400 --> 00:13:16.200
 We can clearly see the get message

258
00:13:15.200 --> 00:13:18.800
 in here get packet is

259
00:13:18.800 --> 00:13:22.200
 sent from the client by

260
00:13:22.200 --> 00:13:25.900
 the client to the server to the HTTP server.

261
00:13:26.600 --> 00:13:28.600
To why shared servers?

262
00:13:29.300 --> 00:13:32.500
And if when you type as an is

263
00:13:32.500 --> 00:13:38.300
 a filter expression for example Wireshark in

264
00:13:36.300 --> 00:13:39.700
 here, let me

265
00:13:39.700 --> 00:13:39.800
 show you.

266
00:13:41.600 --> 00:13:43.200
I want to see the frames.

267
00:13:45.900 --> 00:13:49.000
Which contains why shark world

268
00:13:48.200 --> 00:13:51.600
 or why shark data? Why should

269
00:13:51.600 --> 00:13:55.900
 text and you can type frame

270
00:13:54.900 --> 00:13:57.100
 matches?

271
00:13:59.200 --> 00:14:00.400
Why shark?

272
00:14:03.900 --> 00:14:04.800
so now

273
00:14:05.600 --> 00:14:09.600
you can see all the packets.

274
00:14:11.500 --> 00:14:15.000
That have this word. This text is

275
00:14:14.300 --> 00:14:17.800
 very sharp, and you can fetch the

276
00:14:18.900 --> 00:14:21.900
Packets associated with it as you

277
00:14:21.900 --> 00:14:24.300
 can see but we have

278
00:14:24.300 --> 00:14:27.700
 only declined Hello Message In

279
00:14:27.700 --> 00:14:28.600
 This terrific.

280
00:14:29.400 --> 00:14:33.600
So let's turn back to the our stream again.

281
00:14:35.600 --> 00:14:38.500
using TCP stream equal to

282
00:14:38.500 --> 00:14:41.800
 and click on enter so

283
00:14:43.200 --> 00:14:44.100
Now we can.

284
00:14:45.300 --> 00:14:48.600
look at the HTTP get message and

285
00:14:48.600 --> 00:14:51.700
 the post also post messages we

286
00:14:51.700 --> 00:14:53.000
 can see and

287
00:14:53.900 --> 00:14:56.500
on the other hand now we

288
00:14:56.500 --> 00:15:00.000
 can export a clear Text data or

289
00:14:59.700 --> 00:15:02.300
 image or similar data in

290
00:15:02.300 --> 00:15:03.800
 our traffic if any

291
00:15:04.400 --> 00:15:08.000
so we can easily do content analysis

292
00:15:07.200 --> 00:15:10.900
 exporting such these files.

293
00:15:12.500 --> 00:15:16.300
So let me show you and now we can export objects

294
00:15:15.300 --> 00:15:18.100
 and the I want to

295
00:15:18.100 --> 00:15:21.800
 export the HTTP objects. For

296
00:15:21.800 --> 00:15:22.000
 example.

297
00:15:23.400 --> 00:15:25.900
If I have any objects in here.

298
00:15:27.100 --> 00:15:31.000
In our traffic we can export it.

299
00:15:32.200 --> 00:15:34.700
But now we can have any other.

300
00:15:35.700 --> 00:15:38.200
object in the http

301
00:15:38.800 --> 00:15:40.100
but you can see

302
00:15:41.100 --> 00:15:42.100
you can see your

303
00:15:43.200 --> 00:15:44.200
http

304
00:15:45.900 --> 00:15:46.700
packets

305
00:15:48.400 --> 00:15:51.200
as HTTP 2 in here

306
00:15:52.100 --> 00:15:55.600
and there are some data packets.

307
00:15:56.600 --> 00:15:57.600
also, you can see

308
00:15:59.100 --> 00:16:02.400
and haters as you can see in here.

309
00:16:05.100 --> 00:16:07.500
So let me show you in here here.

310
00:16:08.600 --> 00:16:10.900
hypertext transfer protocol

311
00:16:11.700 --> 00:16:12.000
and

312
00:16:13.600 --> 00:16:13.900
as you can see

313
00:16:17.200 --> 00:16:21.000
we can observe clearly the HTTP

314
00:16:20.600 --> 00:16:23.500
 headers information in here

315
00:16:23.500 --> 00:16:27.400
 after the decryption process. So

316
00:16:26.400 --> 00:16:30.200
 in order to see some HTTP

317
00:16:29.200 --> 00:16:32.500
 text Data you can

318
00:16:32.500 --> 00:16:36.200
 type this filter in the display

319
00:16:35.200 --> 00:16:40.300
 filter field and type HTTP

320
00:16:39.300 --> 00:16:40.400
 to

321
00:16:42.500 --> 00:16:43.300
Point data

322
00:16:44.700 --> 00:16:45.800
point data

323
00:16:46.900 --> 00:16:50.300
so you can access the some HTTP

324
00:16:49.300 --> 00:16:51.400
 data.

325
00:16:52.200 --> 00:16:56.200
easily using this filter expression and

326
00:16:55.200 --> 00:16:58.800
 click on the enter as you

327
00:16:58.800 --> 00:17:01.400
 can see now we have

328
00:17:01.400 --> 00:17:05.700
 the sum HTTP to data packets

329
00:17:04.700 --> 00:17:07.600
 in here and you can also

330
00:17:07.600 --> 00:17:09.400
 investigate some

331
00:17:10.900 --> 00:17:13.700
html text files in

332
00:17:13.700 --> 00:17:13.800
 here.

333
00:17:16.900 --> 00:17:20.000
You can click on the right button The

334
00:17:19.600 --> 00:17:22.900
 uncompressed Entity body.

335
00:17:22.900 --> 00:17:26.500
 And when you click on this option,

336
00:17:25.500 --> 00:17:29.200
 you can see the clearly a

337
00:17:28.200 --> 00:17:30.200
 HTML.

338
00:17:31.100 --> 00:17:34.000
page structure as in here

339
00:17:36.300 --> 00:17:39.000
So that's all for now. See you on the

340
00:17:39.200 --> 00:17:39.500
 next video.
