1
1

00:00:00,360  -->  00:00:01,560
<v Instructor>As you might have guessed,</v>
2

2

00:00:01,560  -->  00:00:04,440
packet captures can take up a lot of storage space
3

3

00:00:04,440  -->  00:00:06,720
and they can grow quickly in size.
4

4

00:00:06,720  -->  00:00:09,240
For example, if I'm conducting full packet capture
5

5

00:00:09,240  -->  00:00:10,980
on my home network each day,
6

6

00:00:10,980  -->  00:00:12,870
I would need several gigabytes of storage
7

7

00:00:12,870  -->  00:00:14,430
just for my small family
8

8

00:00:14,430  -->  00:00:17,010
because every single packet that goes in and out of my house
9

9

00:00:17,010  -->  00:00:18,180
would be captured.
10

10

00:00:18,180  -->  00:00:20,430
Every video game my son is playing online,
11

11

00:00:20,430  -->  00:00:22,200
every YouTube video he watches,
12

12

00:00:22,200  -->  00:00:24,420
every Netflix show my wife binges,
13

13

00:00:24,420  -->  00:00:26,880
all of that would be captured bit by bit.
14

14

00:00:26,880  -->  00:00:29,400
This is known as a full packet capture.
15

15

00:00:29,400  -->  00:00:31,890
Now, a full packet capture or FPC
16

16

00:00:31,890  -->  00:00:33,930
is going to capture the entire packet.
17

17

00:00:33,930  -->  00:00:35,820
This includes the header and the payload
18

18

00:00:35,820  -->  00:00:39,000
for all traffic that is entering or leaving your network.
19

19

00:00:39,000  -->  00:00:41,520
As I said, this would be a ton of information
20

20

00:00:41,520  -->  00:00:43,710
and quickly eat up all of our storage.
21

21

00:00:43,710  -->  00:00:45,210
Now, because full packet capture
22

22

00:00:45,210  -->  00:00:47,160
takes up so much storage space,
23

23

00:00:47,160  -->  00:00:49,140
a lot of times we won't collect it.
24

24

00:00:49,140  -->  00:00:52,290
Instead, we'll use something called flow analysis,
25

25

00:00:52,290  -->  00:00:54,420
and this relies on a flow collector.
26

26

00:00:54,420  -->  00:00:56,520
Now, a flow collector is a means of recording
27

27

00:00:56,520  -->  00:00:59,340
metadata and statistics about network traffic
28

28

00:00:59,340  -->  00:01:01,380
rather than recording each and every frame
29

29

00:01:01,380  -->  00:01:02,940
that's going over our network.
30

30

00:01:02,940  -->  00:01:05,280
This allows us to use flow analysis tools
31

31

00:01:05,280  -->  00:01:07,170
that provide network traffic statistics
32

32

00:01:07,170  -->  00:01:08,700
sampled by the collector.
33

33

00:01:08,700  -->  00:01:11,700
This way we can capture information about the flow
34

34

00:01:11,700  -->  00:01:15,450
instead of the data itself, saving us a lot of space.
35

35

00:01:15,450  -->  00:01:17,730
But we aren't going to have the contents
36

36

00:01:17,730  -->  00:01:19,260
of what was going over the network,
37

37

00:01:19,260  -->  00:01:21,480
just information about it.
38

38

00:01:21,480  -->  00:01:24,810
Now, this information can be stored inside of a database
39

39

00:01:24,810  -->  00:01:26,670
and queried later by our different tools
40

40

00:01:26,670  -->  00:01:28,620
and produce reports and graphs.
41

41

00:01:28,620  -->  00:01:31,170
This is the idea of flow analysis.
42

42

00:01:31,170  -->  00:01:32,940
Now, the great thing about flow analysis
43

43

00:01:32,940  -->  00:01:35,340
is it's going to allow us to highlight trends and patterns
44

44

00:01:35,340  -->  00:01:36,960
in the traffic being generated.
45

45

00:01:36,960  -->  00:01:39,090
It allows us to get alerts based on anomalies
46

46

00:01:39,090  -->  00:01:41,130
that we might see and different patterns and triggers
47

47

00:01:41,130  -->  00:01:42,150
that we might see.
48

48

00:01:42,150  -->  00:01:43,770
We can also have visualization tools
49

49

00:01:43,770  -->  00:01:45,720
that allow us to quickly create a map
50

50

00:01:45,720  -->  00:01:48,570
of different network connections and the flow patterns,
51

51

00:01:48,570  -->  00:01:50,820
and we can identify different traffic patterns
52

52

00:01:50,820  -->  00:01:53,910
that might reveal bad behavior, malware in transit,
53

53

00:01:53,910  -->  00:01:56,490
tunneling, and other bad things out there.
54

54

00:01:56,490  -->  00:01:59,370
Now, to do this, we can use several different tools.
55

55

00:01:59,370  -->  00:02:01,770
For instance, there is NetFlow, Zeek,
56

56

00:02:01,770  -->  00:02:04,080
and Multi Router Traffic Grapher.
57

57

00:02:04,080  -->  00:02:05,730
Let's talk about each of these.
58

58

00:02:05,730  -->  00:02:07,740
First, we have NetFlow.
59

59

00:02:07,740  -->  00:02:09,570
NetFlow is a Cisco-developed means
60

60

00:02:09,570  -->  00:02:11,250
of reporting network flow information
61

61

00:02:11,250  -->  00:02:12,990
to a structured database.
62

62

00:02:12,990  -->  00:02:14,640
This is one of the first ones out there,
63

63

00:02:14,640  -->  00:02:16,770
and eventually it actually became the standard
64

64

00:02:16,770  -->  00:02:18,210
that everyone started using
65

65

00:02:18,210  -->  00:02:22,500
under the name IPFIX or IP Flow Information Export.
66

66

00:02:22,500  -->  00:02:25,320
Now, this allows us to define a particular traffic flow
67

67

00:02:25,320  -->  00:02:26,610
based on the different packets
68

68

00:02:26,610  -->  00:02:28,350
that share the same characteristics.
69

69

00:02:28,350  -->  00:02:31,590
For instance, maybe it's the same source and destination IP
70

70

00:02:31,590  -->  00:02:34,290
signifying that there's a session between two hosts.
71

71

00:02:34,290  -->  00:02:35,790
That would be one data flow,
72

72

00:02:35,790  -->  00:02:37,770
and we can get information about it.
73

73

00:02:37,770  -->  00:02:39,510
Now, some of the information we can capture
74

74

00:02:39,510  -->  00:02:42,630
inside of NetFlow is going to be information about the packets
75

75

00:02:42,630  -->  00:02:44,130
that go over the devices,
76

76

00:02:44,130  -->  00:02:45,960
things like the network protocol interface
77

77

00:02:45,960  -->  00:02:49,290
that's being used, the version and type of IP being used,
78

78

00:02:49,290  -->  00:02:51,480
the source and destination IP address,
79

79

00:02:51,480  -->  00:02:53,280
the source and destination port,
80

80

00:02:53,280  -->  00:02:55,710
or the IP's type of service.
81

81

00:02:55,710  -->  00:02:57,570
All of this information can be gathered
82

82

00:02:57,570  -->  00:03:00,120
and then we can actually analyze it and look at it visually
83

83

00:03:00,120  -->  00:03:01,680
using different tools.
84

84

00:03:01,680  -->  00:03:04,050
For example, here on the screen, you can see that I'm using
85

85

00:03:04,050  -->  00:03:08,190
the SolarWinds tool to show the NetFlow data of a network,
86

86

00:03:08,190  -->  00:03:10,440
or you can look at it in a text-based manner.
87

87

00:03:10,440  -->  00:03:13,020
For instance, here you can see the different flows
88

88

00:03:13,020  -->  00:03:16,110
that are there going from one all the way down to flow 15,
89

89

00:03:16,110  -->  00:03:18,930
and as I increase the ability to look into flow 15,
90

90

00:03:18,930  -->  00:03:21,090
you can see the source and destination address,
91

91

00:03:21,090  -->  00:03:23,220
the source port, the destination port,
92

92

00:03:23,220  -->  00:03:24,930
and some basic information about it,
93

93

00:03:24,930  -->  00:03:27,210
but you don't see the content of any of those packets
94

94

00:03:27,210  -->  00:03:28,290
that have been going through.
95

95

00:03:28,290  -->  00:03:29,310
Now because of this,
96

96

00:03:29,310  -->  00:03:31,470
NetFlow is going to provide you with metadata
97

97

00:03:31,470  -->  00:03:33,600
but you're not going to have the full packet captures,
98

98

00:03:33,600  -->  00:03:35,190
so you're not going to have a complete record
99

99

00:03:35,190  -->  00:03:36,510
of what's happening.
100

100

00:03:36,510  -->  00:03:38,850
Now, if you want to be able to have the best of both worlds,
101

101

00:03:38,850  -->  00:03:40,740
you can use something like Zeek.
102

102

00:03:40,740  -->  00:03:43,800
Zeke is a hybrid tool that passively monitors your network
103

103

00:03:43,800  -->  00:03:44,850
like a sniffer,
104

104

00:03:44,850  -->  00:03:47,250
but it's only going to log full packet capture
105

105

00:03:47,250  -->  00:03:49,620
based on data of potential interest.
106

106

00:03:49,620  -->  00:03:52,080
So essentially it's going to be sampling that data
107

107

00:03:52,080  -->  00:03:53,670
just like NetFlow does,
108

108

00:03:53,670  -->  00:03:55,590
but when it finds something that's quite interesting,
109

109

00:03:55,590  -->  00:03:57,330
it's going to log the entire thing,
110

110

00:03:57,330  -->  00:03:59,550
so we can then go back and look at that.
111

111

00:03:59,550  -->  00:04:01,080
This helps reduce our storage
112

112

00:04:01,080  -->  00:04:02,700
and our processing requirements,
113

113

00:04:02,700  -->  00:04:05,190
and it gives us an ability to have all this data
114

114

00:04:05,190  -->  00:04:07,110
into one single format.
115

115

00:04:07,110  -->  00:04:09,480
One of the great things about Zeek is that it performs
116

116

00:04:09,480  -->  00:04:10,980
normalization of the data
117

117

00:04:10,980  -->  00:04:13,620
and then it stores that data as a tab-delimited
118

118

00:04:13,620  -->  00:04:15,780
or JavaScript Object Notation language,
119

119

00:04:15,780  -->  00:04:17,850
JSON-formatted text files.
120

120

00:04:17,850  -->  00:04:18,780
This allows you to use it
121

121

00:04:18,780  -->  00:04:20,760
with lots of other different tools.
122

122

00:04:20,760  -->  00:04:22,860
For instance, here you can see on the screen
123

123

00:04:22,860  -->  00:04:24,420
that since this file was normalized,
124

124

00:04:24,420  -->  00:04:27,240
I could import it into another tool for visualization,
125

125

00:04:27,240  -->  00:04:29,010
searching, and analysis.
126

126

00:04:29,010  -->  00:04:32,160
In this image, I've imported the Zeek log into Splunk
127

127

00:04:32,160  -->  00:04:34,860
and from there I'm able to search for specific information
128

128

00:04:34,860  -->  00:04:37,290
during my analysis of a potential incident.
129

129

00:04:37,290  -->  00:04:38,370
The third tool we have
130

130

00:04:38,370  -->  00:04:42,390
is the Multi Router Traffic Grapher or MRTG.
131

131

00:04:42,390  -->  00:04:44,040
Now, if you took Network Plus,
132

132

00:04:44,040  -->  00:04:45,330
you've been introduced to this before
133

133

00:04:45,330  -->  00:04:47,250
because it was on that syllabus as well.
134

134

00:04:47,250  -->  00:04:50,100
The MRTG is a tool that's used to create graphs
135

135

00:04:50,100  -->  00:04:51,900
that show network traffic flows
136

136

00:04:51,900  -->  00:04:53,220
through the network interfaces
137

137

00:04:53,220  -->  00:04:54,840
of different routers and switches
138

138

00:04:54,840  -->  00:04:57,570
by polling those appliances using SNMP,
139

139

00:04:57,570  -->  00:04:59,970
the Simple Network Management Protocol.
140

140

00:04:59,970  -->  00:05:02,250
This looks like this graph here on the screen.
141

141

00:05:02,250  -->  00:05:04,230
Now, what is useful about this?
142

142

00:05:04,230  -->  00:05:06,810
Well, you can see patterns emerging.
143

143

00:05:06,810  -->  00:05:10,170
For instance, in the top graph on the router firewall,
144

144

00:05:10,170  -->  00:05:12,420
where do you see a big spike in traffic?
145

145

00:05:12,420  -->  00:05:14,520
You can see that there's a big spike in traffic
146

146

00:05:14,520  -->  00:05:16,590
between 2:00 and 4:00 am.
147

147

00:05:16,590  -->  00:05:17,730
Now, is that normal?
148

148

00:05:17,730  -->  00:05:20,040
Maybe and maybe not, but it's something we should go
149

149

00:05:20,040  -->  00:05:22,440
and further analyze, because if we see a big spike
150

150

00:05:22,440  -->  00:05:25,350
between 2:00 and 4:00 am, that could be something normal,
151

151

00:05:25,350  -->  00:05:27,330
like we are doing offsite backups,
152

152

00:05:27,330  -->  00:05:29,430
and therefore we're going to do that during off-peak hours,
153

153

00:05:29,430  -->  00:05:30,870
and you'll see a big spike in traffic
154

154

00:05:30,870  -->  00:05:33,000
as we're sending our data to our offsite facility.
155

155

00:05:33,000  -->  00:05:34,680
Maybe that's a reasonable explanation,
156

156

00:05:34,680  -->  00:05:37,620
or maybe the server has been infected with malware
157

157

00:05:37,620  -->  00:05:40,320
and at 2:00 to 4:00 am when we're all home sleeping,
158

158

00:05:40,320  -->  00:05:42,690
they're sending all the data back to the bad guy
159

159

00:05:42,690  -->  00:05:45,660
who's now collecting our data as part of data exfiltration.
160

160

00:05:45,660  -->  00:05:47,250
We don't know just by looking at this
161

161

00:05:47,250  -->  00:05:48,990
which of those two cases it is,
162

162

00:05:48,990  -->  00:05:50,910
but by looking at this we can identify
163

163

00:05:50,910  -->  00:05:53,250
that we should zero in between 2:00 and 4:00 am
164

164

00:05:53,250  -->  00:05:55,740
and figure out what was that additional traffic flow
165

165

00:05:55,740  -->  00:05:57,180
that happened and why.
166

166

00:05:57,180  -->  00:05:59,460
So based on this, we might make a hypothesis
167

167

00:05:59,460  -->  00:06:01,590
that we think data exfiltration is happening.
168

168

00:06:01,590  -->  00:06:03,840
In that case, we would want to set up a network sniffer
169

169

00:06:03,840  -->  00:06:06,510
in front of this server to see what traffic is leaving
170

170

00:06:06,510  -->  00:06:08,130
and where it's going to.
171

171

00:06:08,130  -->  00:06:09,750
Based on that, we can then dive deeper
172

172

00:06:09,750  -->  00:06:11,880
to see if it was something that was known good,
173

173

00:06:11,880  -->  00:06:15,273
such as a backup, or known bad, such as a bad guy.
