WEBVTT - This file was automatically generated by VIMEO

0
00:00:21.400 --> 00:00:24.300
Hello everyone in this lesson. I will talk about how to

1
00:00:24.300 --> 00:00:26.800
 detect a port scan with nmap.

2
00:00:27.900 --> 00:00:30.500
First of all, let's talk about briefly. What

3
00:00:30.500 --> 00:00:31.500
 and map is

4
00:00:32.400 --> 00:00:36.100
so unmet which means network members.

5
00:00:36.700 --> 00:00:39.500
And it is a free and open source

6
00:00:39.500 --> 00:00:41.100
 Network scanner tool.

7
00:00:41.900 --> 00:00:44.700
And it is used to discover hosts and

8
00:00:44.700 --> 00:00:47.300
 services on a computer network to map

9
00:00:47.300 --> 00:00:50.700
 out networks and to identify the types of devices

10
00:00:50.700 --> 00:00:53.400
 and services running on a

11
00:00:53.400 --> 00:00:57.100
 network and map is available for all major operating

12
00:00:56.100 --> 00:01:00.500
 systems and including Linux

13
00:00:59.500 --> 00:01:02.500
 Macos and windows.

14
00:01:03.100 --> 00:01:07.400
And may provides several different types of scans. However,

15
00:01:06.400 --> 00:01:09.100
 in this course, we will be

16
00:01:09.100 --> 00:01:12.900
 covering the most known and use

17
00:01:12.900 --> 00:01:15.400
 it basic Port scanning methods

18
00:01:15.400 --> 00:01:18.800
 and we will start with TCP connect

19
00:01:18.800 --> 00:01:21.600
 scan first and then we

20
00:01:21.600 --> 00:01:25.000
 will examine TCP stealth or maybe you

21
00:01:24.900 --> 00:01:27.400
 know TCP scene scan and

22
00:01:27.400 --> 00:01:30.500
 then UDP scan types

23
00:01:30.500 --> 00:01:34.000
 sequentially. So by the way, I performed

24
00:01:33.400 --> 00:01:36.500
 each scanning method in and map

25
00:01:36.500 --> 00:01:39.800
 beforehand in the web environment and captured the

26
00:01:39.800 --> 00:01:42.200
 network traffic. I have captured the

27
00:01:42.200 --> 00:01:45.700
 network traffic in the moment that I have

28
00:01:45.700 --> 00:01:48.900
 performed and met scans and we

29
00:01:48.900 --> 00:01:52.000
 will see Port scans over these pickup

30
00:01:51.000 --> 00:01:52.300
 files.

31
00:01:53.300 --> 00:01:56.800
Let's talk about TCP connect scan is

32
00:01:56.800 --> 00:01:59.400
 the first type of the nmap scan.

33
00:02:00.200 --> 00:02:02.500
Maybe you have heard about it before.

34
00:02:03.600 --> 00:02:07.600
And it is based on tcp-3-way handshake.

35
00:02:08.200 --> 00:02:12.000
So this is the key point for us and it simply

36
00:02:11.800 --> 00:02:14.100
 attempts to establish a connection to

37
00:02:14.100 --> 00:02:16.200
 the Target host or hosts.

38
00:02:16.600 --> 00:02:19.200
If the connection is successful, it means

39
00:02:19.200 --> 00:02:22.400
 that the port is open. So this can

40
00:02:22.400 --> 00:02:25.600
 option is very fast, but it is also very

41
00:02:25.600 --> 00:02:26.600
 easy to detect.

42
00:02:27.600 --> 00:02:30.700
And as it creates a full connection with

43
00:02:30.700 --> 00:02:33.400
 the target host. So since it

44
00:02:33.400 --> 00:02:36.500
 creates a full connection with the target host. It is

45
00:02:36.500 --> 00:02:39.400
 very easy to detect keep in

46
00:02:39.400 --> 00:02:42.800
 mind that and well well since this type

47
00:02:42.800 --> 00:02:45.500
 of Port scanning is based on TCP three

48
00:02:45.500 --> 00:02:46.300
 way handshake.

49
00:02:47.300 --> 00:02:50.300
And if TCP can establish a connection with the

50
00:02:50.300 --> 00:02:53.700
 host by doing three-way handshake, it understands

51
00:02:53.700 --> 00:02:56.000
 that that port is open.

52
00:02:56.600 --> 00:03:00.200
So, let's see how tcp3 way let's

53
00:02:59.200 --> 00:03:02.400
 see how tcp3 very handshake is

54
00:03:02.400 --> 00:03:05.500
 on open port and close Port there are

55
00:03:05.500 --> 00:03:08.700
 two separate tcptv handshake

56
00:03:08.700 --> 00:03:11.600
 patterns for the open port and they will

57
00:03:11.600 --> 00:03:14.600
 see them in the first case. It could

58
00:03:14.600 --> 00:03:15.600
 be like this.

59
00:03:16.500 --> 00:03:17.700
Firstly we can.

60
00:03:18.800 --> 00:03:21.600
Create our sites.

61
00:03:22.400 --> 00:03:22.600
as

62
00:03:23.900 --> 00:03:24.700
aligned

63
00:03:25.600 --> 00:03:26.000
and

64
00:03:28.700 --> 00:03:31.000
client and the host

65
00:03:32.500 --> 00:03:35.300
and this pattern is for

66
00:03:37.300 --> 00:03:39.200
open port statement.

67
00:03:41.100 --> 00:03:41.400
So

68
00:03:43.100 --> 00:03:45.700
in the first case, it could be like this.

69
00:03:46.800 --> 00:03:49.500
First the client sends a scene

70
00:03:49.500 --> 00:03:49.700
 message.

71
00:03:51.600 --> 00:03:53.000
As seen message.

72
00:03:54.900 --> 00:03:57.600
And this message means a

73
00:03:57.600 --> 00:04:01.600
 connection request. So then the host sends

74
00:04:00.600 --> 00:04:03.800
 a confirmation message that it

75
00:04:03.800 --> 00:04:06.400
 has received this message if the request Port

76
00:04:06.400 --> 00:04:07.200
 is available.

77
00:04:08.100 --> 00:04:11.700
And it has received the send message. So this

78
00:04:11.700 --> 00:04:14.100
 becomes the thin egg message.

79
00:04:16.200 --> 00:04:18.000
Host will seen egg.

80
00:04:18.800 --> 00:04:20.600
Message like this.

81
00:04:22.200 --> 00:04:25.500
In response to the scene act

82
00:04:25.500 --> 00:04:29.000
 message declined sense and egg

83
00:04:28.000 --> 00:04:29.300
 message.

84
00:04:30.500 --> 00:04:34.800
In the third step client sends and egg

85
00:04:33.800 --> 00:04:35.100
 message.

86
00:04:36.200 --> 00:04:37.100
like this

87
00:04:37.500 --> 00:04:40.300
So the client sends an

88
00:04:40.300 --> 00:04:44.500
 egg message and thus the connection is established

89
00:04:43.500 --> 00:04:46.400
 another pattern that

90
00:04:46.400 --> 00:04:49.600
 may be happen for an open

91
00:04:49.600 --> 00:04:51.100
 port is like this.

92
00:04:51.900 --> 00:04:55.400
and this is our second pattern

93
00:04:54.400 --> 00:04:55.900
 for

94
00:04:57.200 --> 00:04:58.100
an open port

95
00:04:59.200 --> 00:05:00.300
so let's look at this.

96
00:05:01.400 --> 00:05:04.600
This is the second pattern and in this pattern.

97
00:05:05.500 --> 00:05:07.900
We also have a client.

98
00:05:08.900 --> 00:05:11.800
of course and a host sides

99
00:05:12.800 --> 00:05:16.600
and the communication begins again

100
00:05:15.600 --> 00:05:18.300
 with the scene message.

101
00:05:19.300 --> 00:05:21.300
from the client to The Host

102
00:05:22.400 --> 00:05:25.600
and the host response with a scene

103
00:05:25.600 --> 00:05:26.300
 act message.

104
00:05:27.200 --> 00:05:30.200
like this scene egg message

105
00:05:31.700 --> 00:05:34.800
So the client sends an egg in

106
00:05:34.800 --> 00:05:35.200
 response.

107
00:05:36.100 --> 00:05:36.600
again

108
00:05:38.300 --> 00:05:41.100
And then an rst egg comes

109
00:05:41.100 --> 00:05:42.400
 from the client.

110
00:05:43.800 --> 00:05:47.000
or ST, which means reset

111
00:05:48.200 --> 00:05:51.900
Egg message to finish the connection

112
00:05:51.900 --> 00:05:53.500
 and the conversation.

113
00:05:54.200 --> 00:05:57.800
And in this way sending the rst ACT

114
00:05:57.800 --> 00:05:59.200
 message by the client.

115
00:06:00.500 --> 00:06:04.100
By the client right after the egg message

116
00:06:03.100 --> 00:06:06.400
 isn't normal if there is no problem

117
00:06:06.400 --> 00:06:10.000
 with the network. So keep in mind that so in

118
00:06:09.200 --> 00:06:12.200
 close Port TCP handshake pattern is

119
00:06:12.200 --> 00:06:16.600
 like this. Let's take a look in here for

120
00:06:15.600 --> 00:06:16.900
 the

121
00:06:17.900 --> 00:06:18.800
closed port

122
00:06:19.500 --> 00:06:20.900
TCP conversation

123
00:06:22.400 --> 00:06:25.700
If the port is closed, let's see what happens

124
00:06:25.700 --> 00:06:27.400
 the client.

125
00:06:28.300 --> 00:06:30.800
And we have a host.

126
00:06:32.400 --> 00:06:35.500
So in this situation the client sends a

127
00:06:35.500 --> 00:06:39.100
 scene message, of course again to establish a

128
00:06:38.100 --> 00:06:41.200
 connection with the host.

129
00:06:42.300 --> 00:06:43.400
As seen message.

130
00:06:44.100 --> 00:06:46.300
Is sent by client?

131
00:06:46.900 --> 00:06:50.200
And the host on the other hand responds with

132
00:06:49.200 --> 00:06:52.100
 rst directly.

133
00:06:53.200 --> 00:06:56.500
First sense and rst X message

134
00:06:56.500 --> 00:06:59.200
 because the requested Port is closed.

135
00:07:00.100 --> 00:07:03.400
Since and map TCP connect scan also

136
00:07:03.400 --> 00:07:06.400
 performs Sports scanning by obtaining these

137
00:07:06.400 --> 00:07:09.600
 patterns. We will see such packets in

138
00:07:09.600 --> 00:07:13.000
 the traffic. We capture during Port scanning. Well,

139
00:07:12.400 --> 00:07:15.700
 the question that comes to mind

140
00:07:15.700 --> 00:07:18.100
 at this point if there is a

141
00:07:18.100 --> 00:07:22.400
 terrific with the same structure as TCP today,

142
00:07:21.400 --> 00:07:24.400
 we hashtag patterns. How do we

143
00:07:24.400 --> 00:07:28.000
 separate the end map port scan? How do we separate

144
00:07:27.400 --> 00:07:30.600
 the envelope port scan ones from the

145
00:07:30.600 --> 00:07:32.300
 real TCP handshake?

146
00:07:33.100 --> 00:07:37.500
The answer is we have to use first correct

147
00:07:36.500 --> 00:07:39.700
 filtering expiration. So now

148
00:07:39.700 --> 00:07:43.000
 let's open our pickup file containing TCP

149
00:07:42.300 --> 00:07:44.800
 connect scan packets now.

150
00:07:47.100 --> 00:07:50.400
And to inspect and map TCP connect scans in

151
00:07:50.400 --> 00:07:54.400
 a PK file firstly you should use this filtering

152
00:07:53.400 --> 00:07:55.200
 expiration.

153
00:07:58.300 --> 00:08:02.100
Now I am typing the filtering expression into

154
00:08:01.100 --> 00:08:03.900
 the display filter field.

155
00:08:04.900 --> 00:08:06.700
And this filter expiration.

156
00:08:08.700 --> 00:08:12.300
Have some values and these values

157
00:08:11.300 --> 00:08:15.400
 about the flex value the

158
00:08:14.400 --> 00:08:16.100
 experimenters.

159
00:08:16.700 --> 00:08:18.500
and TCP flag

160
00:08:19.900 --> 00:08:22.400
In here, the TCP Flex

161
00:08:22.400 --> 00:08:25.800
 is seen seen for like if something

162
00:08:25.800 --> 00:08:28.500
 like is said to one and

163
00:08:28.500 --> 00:08:31.800
 if x flag is set to

164
00:08:31.800 --> 00:08:34.700
 zero we have an end map scan packets.

165
00:08:35.100 --> 00:08:39.000
We may have a enemap scan packet. So

166
00:08:38.700 --> 00:08:42.300
 the second important point you

167
00:08:41.300 --> 00:08:44.400
 should look at after this stage. Is

168
00:08:44.400 --> 00:08:47.400
 this the IP addresses of

169
00:08:47.400 --> 00:08:49.600
 the source and destination?

170
00:08:50.500 --> 00:08:53.500
But firstly let's apply this

171
00:08:53.500 --> 00:08:56.600
 filtering into our pickup file.

172
00:08:57.800 --> 00:08:59.900
And I have clicked the enter.

173
00:09:00.500 --> 00:09:01.000
So now

174
00:09:02.100 --> 00:09:06.000
we are seeing the scene messages scene packets.

175
00:09:06.800 --> 00:09:07.400
because

176
00:09:08.500 --> 00:09:12.200
we have set the scene value as one

177
00:09:11.200 --> 00:09:14.500
 and the x value is

178
00:09:14.500 --> 00:09:15.100
 0.

179
00:09:16.700 --> 00:09:20.100
Because of this we are seeing now only

180
00:09:19.100 --> 00:09:21.600
 the same packets.

181
00:09:22.500 --> 00:09:22.800
and

182
00:09:23.800 --> 00:09:26.800
we will analyze the packets over

183
00:09:26.800 --> 00:09:29.700
 scene packets and the second

184
00:09:29.700 --> 00:09:32.600
 important point. You should look at after this stage.

185
00:09:32.600 --> 00:09:35.300
 Is this the IP address of the source

186
00:09:35.300 --> 00:09:39.300
 and the destination this has typically involve

187
00:09:38.300 --> 00:09:42.200
 a large number of distinct Source

188
00:09:41.200 --> 00:09:44.900
 IP addresses all trying

189
00:09:44.900 --> 00:09:45.700
 connect to

190
00:09:46.500 --> 00:09:48.900
a single destination IP address

191
00:09:51.100 --> 00:09:55.600
And map TCP connect scans typically involve a

192
00:09:54.600 --> 00:09:57.300
 large number of these things

193
00:09:57.300 --> 00:10:00.800
 Source IP addresses all trying to

194
00:10:00.800 --> 00:10:03.800
 connect to a single destination IP

195
00:10:03.800 --> 00:10:04.000
 address.

196
00:10:04.700 --> 00:10:08.200
As like this for example here scene messages

197
00:10:08.200 --> 00:10:11.400
 came from a single Source IP

198
00:10:11.400 --> 00:10:15.700
 address to a single destination IP

199
00:10:15.700 --> 00:10:19.200
 address and the next place to look from

200
00:10:18.200 --> 00:10:21.800
 here is of course the port

201
00:10:21.800 --> 00:10:22.400
 numbers.

202
00:10:23.700 --> 00:10:25.000
this nation port

203
00:10:27.400 --> 00:10:32.300
especially is destination Port so nmap.

204
00:10:30.300 --> 00:10:33.500
 TCP connect scans.

205
00:10:34.100 --> 00:10:38.300
Often Target a wide range of port numbers looking

206
00:10:37.300 --> 00:10:40.600
 for open ports that might

207
00:10:40.600 --> 00:10:43.900
 be running Services as in here.

208
00:10:43.900 --> 00:10:46.500
 You can see there are too many.

209
00:10:47.200 --> 00:10:48.700
port numbers that

210
00:10:49.700 --> 00:10:52.800
have been sent some sin packets

211
00:10:52.800 --> 00:10:55.100
 and as you

212
00:10:55.100 --> 00:10:59.200
 can see here a single client sends requests

213
00:10:58.200 --> 00:11:01.300
 to avoid range of

214
00:11:01.300 --> 00:11:04.700
 port numbers. So these packets are

215
00:11:04.700 --> 00:11:07.700
 the end map TCP connects can

216
00:11:07.700 --> 00:11:08.200
 packets.

217
00:11:08.600 --> 00:11:11.000
And now let's take a look

218
00:11:11.100 --> 00:11:15.300
 at the handshake patterns created by nmet Port

219
00:11:14.300 --> 00:11:17.200
 scanning on open ports.

220
00:11:17.800 --> 00:11:21.400
I know ports 135 and

221
00:11:21.400 --> 00:11:25.100
 139 are open. That's

222
00:11:24.100 --> 00:11:26.900
 right a filtering.

223
00:11:27.500 --> 00:11:28.300
TCP

224
00:11:29.400 --> 00:11:30.800
DCP Dot

225
00:11:31.900 --> 00:11:32.300
port

226
00:11:33.500 --> 00:11:34.400
is equal to

227
00:11:37.800 --> 00:11:38.900
135

228
00:11:41.900 --> 00:11:44.700
and click on the enter now.

229
00:11:47.500 --> 00:11:50.600
There it is. Just like we saw

230
00:11:50.600 --> 00:11:52.700
 in the open port pattern.

231
00:11:53.900 --> 00:11:55.900
Scene message comes first.

232
00:11:56.800 --> 00:11:57.400
as you can see

233
00:11:59.100 --> 00:12:01.600
from the attacker machine Maybe

234
00:12:03.100 --> 00:12:07.000
we can imagine this IP belongs to

235
00:12:07.100 --> 00:12:10.400
 the end map Port scanner and

236
00:12:11.700 --> 00:12:14.900
it sends a scene message to the

237
00:12:15.700 --> 00:12:17.800
Target to Target machine

238
00:12:18.700 --> 00:12:21.700
That as the IP address ends with

239
00:12:21.700 --> 00:12:23.100
 2.15.

240
00:12:24.200 --> 00:12:26.100
and after scene message

241
00:12:27.100 --> 00:12:31.300
As you can see the host the target sends a

242
00:12:30.300 --> 00:12:32.700
 scene act message.

243
00:12:33.800 --> 00:12:36.400
As the second step of

244
00:12:36.400 --> 00:12:38.900
 the tcp3 very handshake.

245
00:12:39.500 --> 00:12:43.100
and after this scene egg message the

246
00:12:44.100 --> 00:12:47.500
End map scanner's hands and egg message to

247
00:12:47.500 --> 00:12:48.000
 the Target.

248
00:12:49.200 --> 00:12:52.600
So in here the TCP TV handshake

249
00:12:52.600 --> 00:12:54.200
 is completed.

250
00:12:55.200 --> 00:12:56.300
and the connection

251
00:12:57.100 --> 00:12:58.300
has been established.

252
00:12:59.400 --> 00:13:02.800
So just like we saw in the open port

253
00:13:02.800 --> 00:13:05.400
 pattern and on the other hand

254
00:13:05.400 --> 00:13:08.600
 and map performs a ports

255
00:13:08.600 --> 00:13:11.900
 can responds within egg and then

256
00:13:11.900 --> 00:13:13.900
 sends and rst.

257
00:13:14.700 --> 00:13:17.700
And rst egg message in

258
00:13:17.700 --> 00:13:20.900
 addition to these patterns. Finally. You

259
00:13:20.900 --> 00:13:24.200
 can also examine a packet payloads.

260
00:13:24.700 --> 00:13:28.200
So now let's examine another nmap ports

261
00:13:27.200 --> 00:13:30.700
 can method TCP stout or

262
00:13:30.700 --> 00:13:32.700
 tcps and

263
00:13:34.800 --> 00:13:37.500
We will use this pickup file

264
00:13:37.500 --> 00:13:41.300
 and maptcp start scene scan pickup

265
00:13:40.300 --> 00:13:43.500
 and G and this file also

266
00:13:43.500 --> 00:13:46.700
 has Network packets that were captured at the

267
00:13:46.700 --> 00:13:48.900
 moment. This port scan was performed.

268
00:13:49.800 --> 00:13:50.800
You should know this.

269
00:13:51.800 --> 00:13:54.500
And while nmftcp connect

270
00:13:54.500 --> 00:13:57.800
 scan is performed the nmap even

271
00:13:57.800 --> 00:14:01.700
 St. Comment mftcp since

272
00:14:01.700 --> 00:14:02.000
 can.

273
00:14:02.700 --> 00:14:06.400
Uses with the mrtcp sinscan

274
00:14:05.400 --> 00:14:08.800
 is performed with the

275
00:14:08.800 --> 00:14:12.100
 end map Heaven S command. So

276
00:14:11.100 --> 00:14:14.700
 this can option uses the

277
00:14:14.700 --> 00:14:17.300
 cineflag in the TCP packet heater

278
00:14:17.300 --> 00:14:21.000
 to establish a connection with target post and it

279
00:14:20.300 --> 00:14:23.300
 doesn't complete the TCP handshake.

280
00:14:23.900 --> 00:14:27.000
This is the important point. It doesn't complete

281
00:14:26.300 --> 00:14:29.200
 the TCP handshake. So

282
00:14:29.200 --> 00:14:32.800
 it is less detectable than anticip

283
00:14:32.800 --> 00:14:35.400
 connect scan. However, it

284
00:14:35.400 --> 00:14:38.700
 may be blocked by firewalls or other security

285
00:14:38.700 --> 00:14:42.000
 device that are configured to block syn

286
00:14:41.300 --> 00:14:45.000
 packets the patterns it follows for

287
00:14:44.300 --> 00:14:47.800
 open and close ports are like this

288
00:14:47.800 --> 00:14:49.500
 and let me show you now.

289
00:14:50.700 --> 00:14:53.200
A scene message comes from the

290
00:14:53.200 --> 00:14:53.900
 client.

291
00:14:54.500 --> 00:14:58.000
The end map client and the host

292
00:14:57.600 --> 00:15:00.500
 response with a scene egg again.

293
00:15:01.400 --> 00:15:05.600
As usual as seen Edge message, but

294
00:15:04.600 --> 00:15:07.900
 at this point the end

295
00:15:07.900 --> 00:15:10.600
 map finishes with rst, and

296
00:15:10.600 --> 00:15:13.900
 we will finish the conversation with

297
00:15:13.900 --> 00:15:15.700
 rst message.

298
00:15:16.500 --> 00:15:19.800
So, thus the TCP handshake

299
00:15:19.800 --> 00:15:21.200
 is not completed.

300
00:15:22.300 --> 00:15:23.200
for the close port

301
00:15:24.300 --> 00:15:26.200
the pattern will be like this.

302
00:15:27.400 --> 00:15:31.000
So in here the pattern is the same as before

303
00:15:30.500 --> 00:15:33.300
 as in the TCP connect

304
00:15:33.300 --> 00:15:36.900
 scan and as in message is sent to

305
00:15:36.900 --> 00:15:38.000
 the Post.

306
00:15:38.800 --> 00:15:42.300
And post ends with rst act

307
00:15:41.300 --> 00:15:43.600
 message as you know.

308
00:15:44.500 --> 00:15:47.900
Rst Edge message because the

309
00:15:47.900 --> 00:15:50.500
 port and map wants to establish a

310
00:15:50.500 --> 00:15:54.800
 connection is closed and now let's

311
00:15:54.800 --> 00:15:56.800
 move on to the pickup file.

312
00:15:59.400 --> 00:16:03.100
Now, let's see if nmap performs a

313
00:16:02.100 --> 00:16:06.000
 TCP handshake on open ports

314
00:16:05.400 --> 00:16:09.600
 without completing it without completing

315
00:16:08.600 --> 00:16:12.100
 the handshake process for

316
00:16:11.100 --> 00:16:14.400
 this. Let's look at the conversation in an

317
00:16:14.400 --> 00:16:17.500
 open port and I know in an open

318
00:16:17.500 --> 00:16:20.500
 port so I will type A filtering.

319
00:16:21.200 --> 00:16:21.600
it

320
00:16:27.900 --> 00:16:28.900
45

321
00:16:30.300 --> 00:16:32.000
is our Port that is open.

322
00:16:33.700 --> 00:16:35.700
As you can see it sent.

323
00:16:36.300 --> 00:16:38.000
an rst message

324
00:16:39.100 --> 00:16:42.600
in here as a response to the scene act

325
00:16:42.600 --> 00:16:45.500
 message, even though it was indeed and

326
00:16:45.500 --> 00:16:46.500
 open port.

327
00:16:47.400 --> 00:16:50.600
And map TCP scene and map TCP scene

328
00:16:50.600 --> 00:16:52.500
 Parts can is very fast.

329
00:16:53.400 --> 00:16:56.900
You should know this and it can be recognized by

330
00:16:56.900 --> 00:16:59.300
 sending too many thin messages

331
00:16:59.300 --> 00:17:01.600
 in a very short time span.

332
00:17:02.300 --> 00:17:06.100
So let's turn back to the packets all

333
00:17:05.100 --> 00:17:06.600
 of them.

334
00:17:07.500 --> 00:17:11.000
And when you investigate the time

335
00:17:10.400 --> 00:17:13.300
 range you can

336
00:17:13.300 --> 00:17:16.400
 see there are too many

337
00:17:16.400 --> 00:17:19.600
 seen packets in a very

338
00:17:19.600 --> 00:17:21.100
 very short time.

339
00:17:21.800 --> 00:17:25.700
In a very short time range, you

340
00:17:24.700 --> 00:17:28.300
 can see this now open

341
00:17:27.300 --> 00:17:31.900
 the iograph to analyze

342
00:17:30.900 --> 00:17:32.200
 it.

343
00:17:33.500 --> 00:17:37.100
Look at how quickly around 2,000 packets

344
00:17:36.100 --> 00:17:38.300
 were sent.

345
00:17:39.600 --> 00:17:41.100
in a very short time range

346
00:17:42.800 --> 00:17:43.400
nearly

347
00:17:44.600 --> 00:17:48.300
two seconds about 2000 scene

348
00:17:48.300 --> 00:17:52.100
 messages arrive in less than two seconds. So

349
00:17:51.100 --> 00:17:54.600
 it is important to have a wide range

350
00:17:54.600 --> 00:17:57.900
 of Target ports as well.

351
00:17:57.900 --> 00:18:01.200
 And remember that the PK

352
00:18:00.200 --> 00:18:02.400
 price we reviewed.

353
00:18:04.500 --> 00:18:07.300
Consists only of ports can packets.

354
00:18:07.300 --> 00:18:11.100
 Therefore we can easily analyze. So,

355
00:18:10.100 --> 00:18:13.300
 however, since there may be too

356
00:18:13.300 --> 00:18:16.700
 many Network packets in the same seconds in

357
00:18:16.700 --> 00:18:19.900
 very large pickup files to if

358
00:18:19.900 --> 00:18:22.900
 you are working in an Enterprise Network

359
00:18:22.900 --> 00:18:25.000
 environment, and you must

360
00:18:25.400 --> 00:18:28.800
 first filter The Source IP address in

361
00:18:28.800 --> 00:18:31.900
 order to perform this analysis.

362
00:18:33.100 --> 00:18:36.500
so however after this filtering after the

363
00:18:36.500 --> 00:18:37.700
 IP filtering

364
00:18:38.300 --> 00:18:40.500
you may notice a traffic like this one.

365
00:18:41.400 --> 00:18:43.800
That we have in this pickle file.

366
00:18:44.800 --> 00:18:47.900
For example here. You can write a field into

367
00:18:47.900 --> 00:18:49.700
 like this IP.

368
00:18:51.600 --> 00:18:52.100
Dot

369
00:18:52.800 --> 00:18:53.900
source

370
00:18:56.100 --> 00:18:59.600
Is equal to the suspicious IP?

371
00:19:00.700 --> 00:19:04.500
so we will write the suspicious

372
00:19:03.500 --> 00:19:06.000
 IP as

373
00:19:07.100 --> 00:19:09.100
10.0 Dot

374
00:19:10.000 --> 00:19:11.600
2.4

375
00:19:13.200 --> 00:19:16.800
And when we filter out this IP as

376
00:19:16.800 --> 00:19:19.500
 Source IP, we have

377
00:19:19.500 --> 00:19:21.500
 the our texts.

378
00:19:22.200 --> 00:19:25.500
Likewise in UDP port scan analysis.

379
00:19:25.500 --> 00:19:28.900
 You should write a filtering as

380
00:19:28.900 --> 00:19:32.200
 UDP dot SRC which

381
00:19:31.200 --> 00:19:34.500
 means source as UDP

382
00:19:34.500 --> 00:19:37.300
 packets will come and now let's

383
00:19:37.300 --> 00:19:40.400
 examine and map UDP port scan

384
00:19:40.400 --> 00:19:43.200
 and we are closing this peak a file.

385
00:19:45.100 --> 00:19:47.100
so the third one is

386
00:19:47.900 --> 00:19:51.400
Nmap, UDP scan and

387
00:19:50.400 --> 00:19:54.400
 it's common for

388
00:19:53.400 --> 00:19:55.400
 nmap.

389
00:19:56.200 --> 00:19:59.400
is even as you

390
00:20:01.700 --> 00:20:04.400
As you know UTP is not a connection based

391
00:20:04.400 --> 00:20:07.700
 protocol UDP packets are sent directly

392
00:20:07.700 --> 00:20:10.800
 to the destination. The protocol doesn't carry

393
00:20:10.800 --> 00:20:12.300
 whether packets error or not.

394
00:20:14.500 --> 00:20:17.400
Therefore we can imagine a pattern for

395
00:20:17.400 --> 00:20:19.600
 open ports like this.

396
00:20:20.500 --> 00:20:23.900
For UDP communication declined sense

397
00:20:23.900 --> 00:20:27.200
 a UDP packet to the host and

398
00:20:26.200 --> 00:20:29.700
 this is the UDP packet.

399
00:20:30.300 --> 00:20:34.100
So there is no packet turning back and that's

400
00:20:33.100 --> 00:20:34.500
 it.

401
00:20:35.900 --> 00:20:38.900
And enclosed ports close ports.

402
00:20:39.400 --> 00:20:43.500
We can imagine the communication like

403
00:20:43.500 --> 00:20:44.000
 this.

404
00:20:44.900 --> 00:20:49.000
If the port is closed client since

405
00:20:47.600 --> 00:20:50.700
 the UDP packet to

406
00:20:50.700 --> 00:20:53.700
 the host and because the port is

407
00:20:53.700 --> 00:20:56.500
 closed in the host site the

408
00:20:56.500 --> 00:21:00.400
 host will send and icmp packet

409
00:21:00.400 --> 00:21:04.300
 like this and icmp error

410
00:21:03.300 --> 00:21:06.700
 packet will be sent by

411
00:21:06.700 --> 00:21:07.200
 host.

412
00:21:08.200 --> 00:21:12.000
So if the port is closed and icmp message

413
00:21:11.300 --> 00:21:15.100
 is returned to the client. So

414
00:21:14.100 --> 00:21:18.600
 this message is destination unreachable

415
00:21:17.600 --> 00:21:20.000
 Port unreachable.

416
00:21:20.700 --> 00:21:24.200
The values of the code and type

417
00:21:23.200 --> 00:21:27.100
 parameters of the sicmp message

418
00:21:26.100 --> 00:21:30.300
 are will be three in

419
00:21:29.300 --> 00:21:32.800
 the icmp message. We

420
00:21:32.800 --> 00:21:34.200
 will see the perimeters.

421
00:21:34.900 --> 00:21:37.900
Gradually the type and

422
00:21:37.900 --> 00:21:41.100
 the type value will equal to 3

423
00:21:40.100 --> 00:21:43.800
 and the other parameter code.

424
00:21:44.500 --> 00:21:48.300
And code also will equal

425
00:21:47.300 --> 00:21:50.900
 to 3 so now

426
00:21:50.900 --> 00:21:54.300
 we can find and analyze such

427
00:21:53.300 --> 00:21:57.400
 icmp messages in our

428
00:21:56.400 --> 00:21:59.900
 pickup file to find a

429
00:21:59.600 --> 00:22:03.400
 UDP scan patterns because

430
00:22:02.400 --> 00:22:05.500
 if there are too many

431
00:22:05.500 --> 00:22:09.700
 acmp error messages for too

432
00:22:08.700 --> 00:22:11.500
 many ports in our Network.

433
00:22:11.500 --> 00:22:14.500
 There may be a UDP

434
00:22:14.500 --> 00:22:17.200
 scan operation. We will write

435
00:22:17.200 --> 00:22:21.100
 a filtering expression with this

436
00:22:20.100 --> 00:22:21.900
 pattern.

437
00:22:22.700 --> 00:22:25.600
Now, let's turn back to the PK file

438
00:22:25.600 --> 00:22:28.200
 and let's apply the

439
00:22:28.200 --> 00:22:28.700
 filtering.

440
00:22:30.800 --> 00:22:31.400
We will write.

441
00:22:32.800 --> 00:22:35.900
the icmp DOT

442
00:22:37.200 --> 00:22:39.100
type parameter

443
00:22:39.800 --> 00:22:40.700
is equal to

444
00:22:42.100 --> 00:22:43.300
3 and

445
00:22:45.300 --> 00:22:46.400
icmp

446
00:22:47.200 --> 00:22:51.300
dot the another parameter will

447
00:22:51.300 --> 00:22:51.900
 be called.

448
00:22:53.300 --> 00:22:54.500
is equal to

449
00:22:56.000 --> 00:22:56.400
3

450
00:22:57.500 --> 00:23:00.100
and now we can click on the enter.

451
00:23:01.700 --> 00:23:04.600
As you can see there are too many

452
00:23:04.600 --> 00:23:06.000
 packets.

453
00:23:08.400 --> 00:23:12.600
We have 101 packets with

454
00:23:11.600 --> 00:23:15.500
 the message of icmp

455
00:23:14.500 --> 00:23:17.700
 protocol and the message

456
00:23:17.700 --> 00:23:21.800
 contains destination unreachable or

457
00:23:21.800 --> 00:23:23.200
 Port unreachable.

458
00:23:25.300 --> 00:23:26.400
this answers

459
00:23:27.400 --> 00:23:30.600
were given to the same IP address for a

460
00:23:30.600 --> 00:23:33.300
 very wide range of ports.

461
00:23:34.100 --> 00:23:37.900
And it can be understood that this is a UDP

462
00:23:37.900 --> 00:23:38.900
 port scan.

463
00:23:40.400 --> 00:23:43.300
It is important to note that this method may

464
00:23:43.300 --> 00:23:46.700
 not be foolproof as there may be other types

465
00:23:46.700 --> 00:23:49.600
 of traffic that also exhibit this pattern

466
00:23:49.600 --> 00:23:52.300
 of multiple packets to the same

467
00:23:52.300 --> 00:23:55.900
 destination IP address with varying destination

468
00:23:55.900 --> 00:23:58.900
 ports additionally attackers may

469
00:23:58.900 --> 00:24:02.200
 use techniques like IPS, proofing

470
00:24:01.200 --> 00:24:05.300
 or randomized storage to evade

471
00:24:04.300 --> 00:24:07.900
 detection. So you should always consider

472
00:24:07.900 --> 00:24:10.600
 other indicators of an

473
00:24:10.600 --> 00:24:14.200
 app scans such as timing especially and

474
00:24:13.200 --> 00:24:16.900
 payloads and other network

475
00:24:16.900 --> 00:24:19.700
 metrics before making a final

476
00:24:19.700 --> 00:24:20.700
 conclusion.

477
00:24:24.100 --> 00:24:26.700
That's all for now. See you on the next video.
