1
00:00:00,000 --> 00:00:01,020
In this lesson,

2
00:00:01,020 --> 00:00:02,850
we're going to discuss rootkits.

3
00:00:02,850 --> 00:00:05,160
Now, a rootkit is a specific type of software

4
00:00:05,160 --> 00:00:07,230
that's designed to gain administrative-level control,

5
00:00:07,230 --> 00:00:10,230
over a given computer system without being detected.

6
00:00:10,230 --> 00:00:12,060
Now, this is a really important concept

7
00:00:12,060 --> 00:00:14,490
because if somebody can install a rootkit on your system,

8
00:00:14,490 --> 00:00:15,330
they can gain root

9
00:00:15,330 --> 00:00:17,880
or administrative-level permissions over that system.

10
00:00:17,880 --> 00:00:19,470
And this is the highest level of permissions

11
00:00:19,470 --> 00:00:22,770
that somebody can have on a given computer system or server.

12
00:00:22,770 --> 00:00:25,500
So, if you're using a Windows machine, for example,

13
00:00:25,500 --> 00:00:27,210
the account with the highest level of permission,

14
00:00:27,210 --> 00:00:29,130
is called the administrator account.

15
00:00:29,130 --> 00:00:31,170
That administrator account allows the person

16
00:00:31,170 --> 00:00:33,300
to install programs, delete programs,

17
00:00:33,300 --> 00:00:34,980
open ports, shut ports,

18
00:00:34,980 --> 00:00:36,720
and do pretty much whatever it is they want to do

19
00:00:36,720 --> 00:00:38,490
on that given system.

20
00:00:38,490 --> 00:00:42,090
If the victim is using Unix, Linux or a Mac OS computer,

21
00:00:42,090 --> 00:00:43,410
this type of administrator account,

22
00:00:43,410 --> 00:00:45,420
is actually called the root account.

23
00:00:45,420 --> 00:00:47,190
Either way, getting administrative

24
00:00:47,190 --> 00:00:49,320
or root account access is a wonderful thing

25
00:00:49,320 --> 00:00:51,150
for an attacker or threat actor,

26
00:00:51,150 --> 00:00:53,040
but it is a horrible thing for you

27
00:00:53,040 --> 00:00:55,110
and the security of your system.

28
00:00:55,110 --> 00:00:57,630
So now that you have an understanding of what a rootkit is,

29
00:00:57,630 --> 00:00:59,520
and the type of permissions it's seeking to gain,

30
00:00:59,520 --> 00:01:02,670
let's take a moment to learn how a rootkit actually works.

31
00:01:02,670 --> 00:01:04,230
Now, if you look at a computer system,

32
00:01:04,230 --> 00:01:06,330
it has several different rings of permission used

33
00:01:06,330 --> 00:01:07,500
throughout the system.

34
00:01:07,500 --> 00:01:09,690
The outermost ring is called ring three,

35
00:01:09,690 --> 00:01:12,090
and this is where the user permissions are going to be used.

36
00:01:12,090 --> 00:01:14,880
So if you're logged as a standard or regular user,

37
00:01:14,880 --> 00:01:17,370
you're mostly going to be operating in ring three.

38
00:01:17,370 --> 00:01:19,830
Now, each program can be run in different security rings,

39
00:01:19,830 --> 00:01:22,200
moving from ring three at the outermost level,

40
00:01:22,200 --> 00:01:24,390
all the way down to ring zero at the innermost

41
00:01:24,390 --> 00:01:26,460
or highest permission level in the system.

42
00:01:26,460 --> 00:01:28,020
When you're operating in ring zero,

43
00:01:28,020 --> 00:01:29,970
we call this the kernel mode.

44
00:01:29,970 --> 00:01:32,160
The kernel mode allows the system to control access

45
00:01:32,160 --> 00:01:34,410
to things like the device drivers, your sound card,

46
00:01:34,410 --> 00:01:37,530
your video display or monitor, and other things like that.

47
00:01:37,530 --> 00:01:40,380
Kernel mode or ring zero is not something you're going to log

48
00:01:40,380 --> 00:01:43,110
into the system as, but instead it is the most trusted

49
00:01:43,110 --> 00:01:46,470
and powerful ring inside the operating systems design.

50
00:01:46,470 --> 00:01:48,210
Now, if you log in as the administrator

51
00:01:48,210 --> 00:01:49,740
or route user on a system,

52
00:01:49,740 --> 00:01:51,120
you're going to have route permission,

53
00:01:51,120 --> 00:01:54,210
and you'll be operating at ring one of the operating system.

54
00:01:54,210 --> 00:01:56,670
Now, this is closer to ring zero than ring three was,

55
00:01:56,670 --> 00:01:59,370
so it's easier to do more damage on the system

56
00:01:59,370 --> 00:02:02,070
from ring one than it would be from ring three.

57
00:02:02,070 --> 00:02:03,570
Now, when a root kit is installed,

58
00:02:03,570 --> 00:02:06,240
it tries to gain the highest levels of permission possible.

59
00:02:06,240 --> 00:02:08,280
So any malicious code it's going to execute,

60
00:02:08,280 --> 00:02:10,830
we'll operate in ring one, or if they're lucky,

61
00:02:10,830 --> 00:02:12,780
even as low as ring zero.

62
00:02:12,780 --> 00:02:14,880
Remember, the closer the malicious code is

63
00:02:14,880 --> 00:02:16,440
to ring zero or the kernel,

64
00:02:16,440 --> 00:02:17,910
the more permissions it's going to have

65
00:02:17,910 --> 00:02:20,430
and the more damage it can do on your system.

66
00:02:20,430 --> 00:02:22,200
Now, when a rootkit is installed on a system,

67
00:02:22,200 --> 00:02:24,990
it tries to move itself from ring one to ring zero,

68
00:02:24,990 --> 00:02:26,430
so it can hide from other functions

69
00:02:26,430 --> 00:02:29,190
of your operating system as well to avoid detection.

70
00:02:29,190 --> 00:02:31,920
In fact, rootkits are able to perform malicious operations

71
00:02:31,920 --> 00:02:34,350
on a target computer at any date they want

72
00:02:34,350 --> 00:02:36,990
without the knowledge of the administrators or the users,

73
00:02:36,990 --> 00:02:38,400
and even sometimes without the knowledge

74
00:02:38,400 --> 00:02:41,640
of the operating system itself if they're properly coded.

75
00:02:41,640 --> 00:02:43,860
Remember, a rootkit is designed to really dig

76
00:02:43,860 --> 00:02:45,390
into your operating system deeply.

77
00:02:45,390 --> 00:02:47,550
So your antivirus and anti-malware solutions,

78
00:02:47,550 --> 00:02:50,280
have a really really hard time detecting them.

79
00:02:50,280 --> 00:02:52,290
Now, one technique that's used by rootkits

80
00:02:52,290 --> 00:02:54,300
to gain this deeper level of access is known

81
00:02:54,300 --> 00:02:56,100
as a DLL injection.

82
00:02:56,100 --> 00:02:58,230
Now, a DLL injection is a technique used

83
00:02:58,230 --> 00:03:00,540
to run arbitrary code within the address space

84
00:03:00,540 --> 00:03:02,370
of another process by forcing it

85
00:03:02,370 --> 00:03:04,620
to load a dynamic-link library.

86
00:03:04,620 --> 00:03:07,380
A dynamic-link library, also known as a DLL,

87
00:03:07,380 --> 00:03:09,180
is simply a collection of code and data

88
00:03:09,180 --> 00:03:11,610
that can be used by multiple programs simultaneously

89
00:03:11,610 --> 00:03:13,890
to allow for code reuse and modularization

90
00:03:13,890 --> 00:03:15,210
in software development.

91
00:03:15,210 --> 00:03:17,160
And these DLLs are often provided

92
00:03:17,160 --> 00:03:20,460
by default inside of the Windows operating system.

93
00:03:20,460 --> 00:03:21,960
With a DLL injection,

94
00:03:21,960 --> 00:03:23,370
the malicious code is going to be inserted

95
00:03:23,370 --> 00:03:25,680
into a running process on a Windows machine

96
00:03:25,680 --> 00:03:28,140
by taking advantage of those dynamic-link libraries

97
00:03:28,140 --> 00:03:30,180
that are being loaded up at runtime.

98
00:03:30,180 --> 00:03:31,920
This means that the Windows system,

99
00:03:31,920 --> 00:03:33,270
doesn't even understand the fact

100
00:03:33,270 --> 00:03:36,090
that it has a rootkit installed inside of one of those DLLs

101
00:03:36,090 --> 00:03:36,923
that is then designed

102
00:03:36,923 --> 00:03:39,780
to load every time you boot up a Windows machine.

103
00:03:39,780 --> 00:03:41,970
This kind of DLL injection is going to work

104
00:03:41,970 --> 00:03:43,920
by using what is known as a shim.

105
00:03:43,920 --> 00:03:46,260
Now, a shim is simply a piece of software code

106
00:03:46,260 --> 00:03:47,910
that's placed between two components,

107
00:03:47,910 --> 00:03:50,370
and it intercepts the calls between those two components

108
00:03:50,370 --> 00:03:52,560
and then it can redirect those calls.

109
00:03:52,560 --> 00:03:55,110
So the rootkit will intercept the communications,

110
00:03:55,110 --> 00:03:56,700
between the Windows operating system

111
00:03:56,700 --> 00:03:58,380
and the dynamic-link library,

112
00:03:58,380 --> 00:04:01,230
and then it redirects that call once it's embedded

113
00:04:01,230 --> 00:04:02,610
into some kind of malicious code

114
00:04:02,610 --> 00:04:04,440
that's being embedded inside of it.

115
00:04:04,440 --> 00:04:06,630
Now, these rootkits are extremely powerful,

116
00:04:06,630 --> 00:04:08,430
and they're also very difficult to detect

117
00:04:08,430 --> 00:04:11,280
because the operating system is essentially blinded to them.

118
00:04:11,280 --> 00:04:13,080
To detect them, the best way is to boot

119
00:04:13,080 --> 00:04:14,130
from an external device

120
00:04:14,130 --> 00:04:15,990
and then scan the internal hard disk drive

121
00:04:15,990 --> 00:04:17,250
or solid state device

122
00:04:17,250 --> 00:04:19,110
to ensure you can detect those rootkits,

123
00:04:19,110 --> 00:04:21,300
using a good anti-malware scanning solution

124
00:04:21,300 --> 00:04:23,610
from a live boot Linux distribution.

125
00:04:23,610 --> 00:04:26,580
So remember, a rootkit is a piece of malicious software

126
00:04:26,580 --> 00:04:28,470
that's designed to infiltrate a computer system

127
00:04:28,470 --> 00:04:30,660
at the highest administrative permission level

128
00:04:30,660 --> 00:04:32,610
while remaining undetected.

129
00:04:32,610 --> 00:04:34,110
Rootkits aim to gain access

130
00:04:34,110 --> 00:04:35,880
as close to ring zero as possible,

131
00:04:35,880 --> 00:04:37,290
and they'll start out at ring three,

132
00:04:37,290 --> 00:04:38,700
the user-level permission ring,

133
00:04:38,700 --> 00:04:41,040
and work their way down all the way to ring zero,

134
00:04:41,040 --> 00:04:42,510
the kernel mode permission ring,

135
00:04:42,510 --> 00:04:44,280
where they can wreak the most havoc.

136
00:04:44,280 --> 00:04:45,960
A rootkit's primary objective is

137
00:04:45,960 --> 00:04:48,450
to seamlessly embedded itself into the operating system,

138
00:04:48,450 --> 00:04:49,380
and this is often done

139
00:04:49,380 --> 00:04:51,150
by exploiting the system's inherent trust

140
00:04:51,150 --> 00:04:54,210
in the dynamic link library system or DLL system,

141
00:04:54,210 --> 00:04:57,660
using a DLL injection, and the use of a shim technique.

142
00:04:57,660 --> 00:04:59,850
Because of the deep rooted nature of a rootkit

143
00:04:59,850 --> 00:05:02,310
and its ability to hide itself from the operating system,

144
00:05:02,310 --> 00:05:04,530
traditional antivirus and anti-malware solutions,

145
00:05:04,530 --> 00:05:06,690
will often fail to detect rootkits.

146
00:05:06,690 --> 00:05:08,340
Therefore, the most effective method

147
00:05:08,340 --> 00:05:10,230
for rootkit detection removal is going

148
00:05:10,230 --> 00:05:12,660
to be to conduct an external system scan.

149
00:05:12,660 --> 00:05:14,880
Remember, guarding yourself against rootkits,

150
00:05:14,880 --> 00:05:16,620
does require continuous vigilance

151
00:05:16,620 --> 00:05:19,110
and the implementation of robust security measures,

152
00:05:19,110 --> 00:05:21,183
across your entire enterprise systems.

