WEBVTT

1
00:00:00.170 --> 00:00:05.835
Welcome back to Windows
registry forensics course 4.

2
00:00:05.835 --> 00:00:10.410
The SAM hive file, Section 3.

3
00:00:10.410 --> 00:00:14.610
We're going to talk about
user accounts, and RIDs.

4
00:00:14.610 --> 00:00:16.140
We're going to talk about
the user accounts and

5
00:00:16.140 --> 00:00:18.240
the values within
the user accounts,

6
00:00:18.240 --> 00:00:19.590
and we're going to talk about

7
00:00:19.590 --> 00:00:23.235
the relative identifiers
and what they mean to us.

8
00:00:23.235 --> 00:00:25.650
As we looked at before,

9
00:00:25.650 --> 00:00:30.975
the RID is the last portion

10
00:00:30.975 --> 00:00:34.725
of our total security identifier,

11
00:00:34.725 --> 00:00:36.810
and the RID identifies

12
00:00:36.810 --> 00:00:40.185
each individual
user on the system.

13
00:00:40.185 --> 00:00:43.490
If you're looking at a
vista or seven machine,

14
00:00:43.490 --> 00:00:47.940
the RIDs are going
to start at 1000,

15
00:00:47.940 --> 00:00:52.355
the user created accounts are
going to begin with 1000.

16
00:00:52.355 --> 00:00:55.700
If you're looking at
Windows 8 and 10,

17
00:00:55.700 --> 00:00:57.685
or you can say Windows 8 and up,

18
00:00:57.685 --> 00:00:59.900
the user-created
accounts are going to

19
00:00:59.900 --> 00:01:03.125
start with a RID of 1001.

20
00:01:03.125 --> 00:01:07.220
Now, each time a
new user is added,

21
00:01:07.220 --> 00:01:10.330
these numbers are
incremented by one.

22
00:01:10.330 --> 00:01:12.635
It's very important to remember

23
00:01:12.635 --> 00:01:15.230
these numbers are never reused.

24
00:01:15.230 --> 00:01:19.820
If you come across a computer
that has 1001, 1002,

25
00:01:19.820 --> 00:01:22.750
and then skips to 1004,

26
00:01:22.750 --> 00:01:25.610
you can be pretty sure
that at some point in time

27
00:01:25.610 --> 00:01:29.940
an account was deleted
on that local machine.

28
00:01:32.390 --> 00:01:36.545
The way we resolve these grids,

29
00:01:36.545 --> 00:01:39.350
those hexidecimal representations
under the user Sub

30
00:01:39.350 --> 00:01:42.240
key to a particular user name,

31
00:01:42.240 --> 00:01:43.950
is through the names key.

32
00:01:43.950 --> 00:01:45.860
When we look at the
names Key below,

33
00:01:45.860 --> 00:01:48.230
we can see a list of users.

34
00:01:48.230 --> 00:01:52.955
If we look at a specific user,

35
00:01:52.955 --> 00:02:00.045
we can see that they have a
specific relative identifier.

36
00:02:00.045 --> 00:02:03.085
In this case we're looking
at the Sub key of names,

37
00:02:03.085 --> 00:02:06.120
and we're looking
at the Ivan user,

38
00:02:06.120 --> 00:02:08.830
and we can see that
the Ivan user RID in

39
00:02:08.830 --> 00:02:12.055
this particular account
is 1001 in decimal.

40
00:02:12.055 --> 00:02:15.705
In hex, we see that 3E9.

41
00:02:15.705 --> 00:02:17.160
If we look above,

42
00:02:17.160 --> 00:02:20.680
we can see the 3E9 under
the users Sub key,

43
00:02:20.680 --> 00:02:23.950
and that would be Ivan's
user account information

44
00:02:23.950 --> 00:02:26.125
contained within that sub key.

45
00:02:26.125 --> 00:02:28.375
Now when we look at that sub key,

46
00:02:28.375 --> 00:02:31.390
we can see that there are
two values in that sub key.

47
00:02:31.390 --> 00:02:35.020
We have a V value and an F value.

48
00:02:35.020 --> 00:02:40.235
We also have a last write
time to that sub key,

49
00:02:40.235 --> 00:02:42.710
and with that last write time,

50
00:02:42.710 --> 00:02:45.125
we know that something
was changed,

51
00:02:45.125 --> 00:02:46.160
but we don't know

52
00:02:46.160 --> 00:02:49.310
which value within that
sub key was changed.

53
00:02:49.310 --> 00:02:52.160
As we can see, we have
also a number 4 there,

54
00:02:52.160 --> 00:02:55.955
which that is the number
of values in the sub key.

55
00:02:55.955 --> 00:02:58.909
One of those four values was

56
00:02:58.909 --> 00:03:02.340
changed at that last write time,

57
00:03:02.340 --> 00:03:04.250
but which one we won't be able

58
00:03:04.250 --> 00:03:07.320
to tell from within the registry.

59
00:03:07.450 --> 00:03:09.680
When we're taking a look,

60
00:03:09.680 --> 00:03:11.270
the first value we're
going to look at is

61
00:03:11.270 --> 00:03:13.479
going to be the F value,

62
00:03:13.479 --> 00:03:16.220
and what's important
to remember here is

63
00:03:16.220 --> 00:03:19.940
whichever value when you're
using the tool that you

64
00:03:19.940 --> 00:03:23.240
are clicked on are
highlighted on is going to

65
00:03:23.240 --> 00:03:27.460
determine the hex that you
see below for the value.

66
00:03:27.460 --> 00:03:29.959
If you're looking at the F value,

67
00:03:29.959 --> 00:03:34.020
you want to make sure you
are clicked on the F value,

68
00:03:34.190 --> 00:03:37.010
or you'll be seeing the wrong hex

69
00:03:37.010 --> 00:03:39.095
and it won't make a lot of sense.

70
00:03:39.095 --> 00:03:42.260
One of the things contained
within the F value,

71
00:03:42.260 --> 00:03:45.475
is going to be the
last login time.

72
00:03:45.475 --> 00:03:49.520
That is going to be
seen at hex offset 08

73
00:03:49.520 --> 00:03:53.240
for a length of eight
bytes to hex offset 0F,

74
00:03:53.240 --> 00:03:56.190
and that would be
decimal 8 to 15.

75
00:03:56.710 --> 00:04:01.020
The last login time
is eight bytes long.

76
00:04:01.480 --> 00:04:05.060
It's RID little-endian, and it

77
00:04:05.060 --> 00:04:08.425
is a 64 bit Windows File time.

78
00:04:08.425 --> 00:04:11.085
We can see it converted there.

79
00:04:11.085 --> 00:04:13.525
You see the bites highlighted.

80
00:04:13.525 --> 00:04:16.100
We see the Windows File time

81
00:04:16.100 --> 00:04:20.010
in our decoder off to
the right-hand side,

82
00:04:20.120 --> 00:04:22.310
and we can also see
a little bigger

83
00:04:22.310 --> 00:04:25.020
representation of that there too.

84
00:04:25.190 --> 00:04:30.800
When you translate those
bytes, little-endian,

85
00:04:30.800 --> 00:04:32.935
you're going to get a date of

86
00:04:32.935 --> 00:04:38.775
January 27th, 2020 at 040826.

87
00:04:38.775 --> 00:04:43.290
That would be the last login
time for this user account,

88
00:04:43.290 --> 00:04:46.430
and we are looking
at the Ivan account.

89
00:04:46.520 --> 00:04:49.850
Also contained
within the F value,

90
00:04:49.850 --> 00:04:53.410
is going to be our last
password change time.

91
00:04:53.410 --> 00:04:59.505
This is going to be located
at hex offsets 1821F,

92
00:04:59.505 --> 00:05:01.905
which is decimal 21 to 31.

93
00:05:01.905 --> 00:05:05.230
Again, it's eight bytes long,

94
00:05:05.230 --> 00:05:09.370
64-bit Windows File time,

95
00:05:09.370 --> 00:05:12.260
and it is RID little-endian.

96
00:05:12.940 --> 00:05:15.650
Our last failed login time,

97
00:05:15.650 --> 00:05:17.810
which is the last time
a user either entered

98
00:05:17.810 --> 00:05:20.240
a wrong password or
didn't enter a password,

99
00:05:20.240 --> 00:05:21.800
just click the head,

100
00:05:21.800 --> 00:05:25.015
but it's our last
failed login time.

101
00:05:25.015 --> 00:05:27.600
Again it is eight bytes long,

102
00:05:27.600 --> 00:05:34.455
it starts at hexadecimal
offset to 2F decimal 4047.

103
00:05:34.455 --> 00:05:37.985
It gives us the last
failed login time.

104
00:05:37.985 --> 00:05:40.700
Those bytes, again,
are RID little endian,

105
00:05:40.700 --> 00:05:45.420
and it is a Windows
64-bit File time format.

106
00:05:47.420 --> 00:05:49.740
The location of the RID.

107
00:05:49.740 --> 00:05:51.340
Where do we find the RID?

108
00:05:51.340 --> 00:05:53.615
It's also contained
within the F value,

109
00:05:53.615 --> 00:05:57.730
and it's contained
at offset 30 to 33.

110
00:05:57.730 --> 00:06:00.840
It is also RID little endian,

111
00:06:00.840 --> 00:06:03.560
and we can see that if we look at

112
00:06:03.560 --> 00:06:05.885
that and we reverse
the byte order,

113
00:06:05.885 --> 00:06:09.110
we can see 00, 00, 03,

114
00:06:09.110 --> 00:06:16.830
E9 and 3E9 or 03E9 would
be Ivan's RID in hex.

115
00:06:16.830 --> 00:06:21.615
We can see on the right-hand
side, it's 32 bits.

116
00:06:21.615 --> 00:06:27.580
It translates to
1,001 in decimal.

117
00:06:27.580 --> 00:06:29.860
If we were to convert
that hexadecimal,

118
00:06:29.860 --> 00:06:31.359
we would get 1,001,

119
00:06:31.359 --> 00:06:33.220
and we know that the
user with the RID

120
00:06:33.220 --> 00:06:36.920
1,001 is Ivan in
our specific case.

121
00:06:37.350 --> 00:06:40.210
Password required.

122
00:06:40.210 --> 00:06:43.180
This is something that over

123
00:06:43.180 --> 00:06:48.200
the years has been
misinterpreted.

124
00:06:50.120 --> 00:06:53.800
It does not mean that
a password is or

125
00:06:53.800 --> 00:06:56.620
is not set for that
particular user account.

126
00:06:56.620 --> 00:06:59.650
What this means is

127
00:06:59.650 --> 00:07:02.435
that it means that any
password policies,

128
00:07:02.435 --> 00:07:04.690
like you have to
have a characters.

129
00:07:04.690 --> 00:07:06.820
You have to have
upper and lowercase.

130
00:07:06.820 --> 00:07:08.140
You have to cap a character.

131
00:07:08.140 --> 00:07:09.385
You have to have numbers.

132
00:07:09.385 --> 00:07:13.120
Any of these particular
password policies that are set

133
00:07:13.120 --> 00:07:17.950
do not apply to this
specific user account.

134
00:07:17.950 --> 00:07:21.055
If you see a 0,

135
00:07:21.055 --> 00:07:22.660
it would be the account is

136
00:07:22.660 --> 00:07:25.495
active and a password
is required.

137
00:07:25.495 --> 00:07:28.360
If you see a 1, that would

138
00:07:28.360 --> 00:07:31.850
mean that the account
is not active,

139
00:07:31.850 --> 00:07:35.410
and if we see a 4, and again,

140
00:07:35.410 --> 00:07:37.420
we're looking at
the right nibble of

141
00:07:37.420 --> 00:07:41.155
hex offset 38, DECIMAL 56.

142
00:07:41.155 --> 00:07:43.570
Just the nibble.

143
00:07:43.570 --> 00:07:47.965
Just that little
highlighted 4 there,

144
00:07:47.965 --> 00:07:49.180
on the right-hand side,

145
00:07:49.180 --> 00:07:51.410
the right nibble of that hex

146
00:07:51.410 --> 00:07:54.070
offset is what
we're interpreting.

147
00:07:54.070 --> 00:07:56.140
If we see a 4, that means that

148
00:07:56.140 --> 00:07:59.800
any password policies do
not apply to this account.

149
00:07:59.800 --> 00:08:02.050
It does not mean that there's

150
00:08:02.050 --> 00:08:05.195
no password set for this account.

151
00:08:05.195 --> 00:08:10.450
Even if that was a 0,

152
00:08:10.450 --> 00:08:13.195
that doesn't necessarily mean

153
00:08:13.195 --> 00:08:16.435
that a password is
set for the account.

154
00:08:16.435 --> 00:08:18.520
That would mean that

155
00:08:18.520 --> 00:08:21.400
any policies would
apply to that account.

156
00:08:21.400 --> 00:08:23.690
But it does not mean

157
00:08:23.690 --> 00:08:27.250
specifically that a
password is required.

158
00:08:27.250 --> 00:08:30.860
You cannot rely just
on that right nibble.

159
00:08:31.230 --> 00:08:34.930
But that 4, and I just want
to make this very clear,

160
00:08:34.930 --> 00:08:37.235
because I know you're going
to see other stuff out there,

161
00:08:37.235 --> 00:08:39.430
because I've seen it
that says that that

162
00:08:39.430 --> 00:08:41.695
4 means that there's no
password on the account.

163
00:08:41.695 --> 00:08:44.110
That is not what it means.

164
00:08:44.820 --> 00:08:46.930
Now, the login count,

165
00:08:46.930 --> 00:08:50.590
how many times has the user
logged into the account?

166
00:08:50.590 --> 00:08:52.840
We're going to be able
to see that again,

167
00:08:52.840 --> 00:08:55.390
we're staying in the F value.

168
00:08:55.670 --> 00:09:00.190
That is going to be at
hexadecimal offset,

169
00:09:00.190 --> 00:09:05.665
42 and 43 decimal 66 and 67.

170
00:09:05.665 --> 00:09:06.970
This is how many times

171
00:09:06.970 --> 00:09:11.095
the specific user has
logged into the account.

172
00:09:11.095 --> 00:09:13.025
In this case we see

173
00:09:13.025 --> 00:09:16.060
a hexadecimal number of
its read Little Endian.

174
00:09:16.060 --> 00:09:18.580
Again, it would be 00, 35,

175
00:09:18.580 --> 00:09:22.525
and if we translated that
from hex to decimal.

176
00:09:22.525 --> 00:09:25.760
We would get a login count of 53.

177
00:09:25.760 --> 00:09:27.455
In this particular case,

178
00:09:27.455 --> 00:09:31.760
Ivan has logged onto
his account 53 times.

179
00:09:31.950 --> 00:09:35.095
Now let's talk about the V value.

180
00:09:35.095 --> 00:09:36.835
Within the V value,

181
00:09:36.835 --> 00:09:39.675
you're going to see
the account username

182
00:09:39.675 --> 00:09:43.480
and the hash for the password,

183
00:09:43.480 --> 00:09:47.424
the NTLM hash values.

184
00:09:47.424 --> 00:09:53.495
There used to be LAN Man
hash values, LM hash values.

185
00:09:53.495 --> 00:09:57.835
You're not going to see that
on anything Vista or above,

186
00:09:57.835 --> 00:10:01.055
you have to go back
to XP to see these.

187
00:10:01.055 --> 00:10:05.565
They're not going to
be on newer computers.

188
00:10:05.565 --> 00:10:08.525
Pretty much we're not
seeing those anymore.

189
00:10:08.525 --> 00:10:10.150
Although those were
great because they

190
00:10:10.150 --> 00:10:12.155
were really easy to code.

191
00:10:12.155 --> 00:10:15.470
But unfortunately for us,

192
00:10:15.470 --> 00:10:18.035
it gets a little harder,
but we can still do it and

193
00:10:18.035 --> 00:10:21.230
we're going to talk about that
more in the next section.

194
00:10:21.360 --> 00:10:23.705
User account-name.

195
00:10:23.705 --> 00:10:25.705
Now because the user account-name

196
00:10:25.705 --> 00:10:27.275
can be variable in length.

197
00:10:27.275 --> 00:10:32.000
I can name my user account
anything I want basically.

198
00:10:32.250 --> 00:10:35.370
It does not have

199
00:10:35.370 --> 00:10:39.130
a location set like we
looked at in the f value,

200
00:10:39.130 --> 00:10:41.830
we could say, I know
if I look at offset x,

201
00:10:41.830 --> 00:10:45.280
offset y, I'm going to be
able to see the login count,

202
00:10:45.280 --> 00:10:47.825
the failed login count,

203
00:10:47.825 --> 00:10:50.955
the last time the
password was set.

204
00:10:50.955 --> 00:10:54.090
When we're talking about
the user account-name.

205
00:10:54.090 --> 00:10:59.290
There are pointers to
it within the V-value,

206
00:10:59.290 --> 00:11:02.140
but I'm not going to drag you
through that calculation,

207
00:11:02.140 --> 00:11:04.180
because it's very
easy if you look

208
00:11:04.180 --> 00:11:06.880
at the ASCII on the
right-hand side of the pane.

209
00:11:06.880 --> 00:11:09.130
Again, I'm just using

210
00:11:09.130 --> 00:11:11.935
Registry Explorer with
this particular photo.

211
00:11:11.935 --> 00:11:14.695
You could use Registry Browser.

212
00:11:14.695 --> 00:11:18.655
You could use AccessData
Registry Viewer,

213
00:11:18.655 --> 00:11:21.400
or you could even use
Registry Ripper and

214
00:11:21.400 --> 00:11:24.200
it will give you the
user account name.

215
00:11:24.200 --> 00:11:26.500
Since it is very easy to see in

216
00:11:26.500 --> 00:11:28.580
the ASCII on the right-hand
side of the pane,

217
00:11:28.580 --> 00:11:31.130
we can see the username of Ivan.

218
00:11:31.130 --> 00:11:33.005
One thing you do want to remember

219
00:11:33.005 --> 00:11:34.889
is you're looking at Unicode,

220
00:11:34.889 --> 00:11:36.460
and I think I briefly

221
00:11:36.460 --> 00:11:38.365
mentioned Unicode is
going to be padded.

222
00:11:38.365 --> 00:11:41.399
You're going to see
those 0's in between

223
00:11:41.399 --> 00:11:46.450
the letters and they're
represented in ASCII as the dots.

224
00:11:46.450 --> 00:11:47.710
If you look at the
right-hand side,

225
00:11:47.710 --> 00:11:49.885
you can see it's dot i,

226
00:11:49.885 --> 00:11:52.180
dot v, dot a,

227
00:11:52.180 --> 00:11:54.895
dot n, that's Unicode.

228
00:11:54.895 --> 00:11:58.270
The username will be in
Unicode and it'll be easily

229
00:11:58.270 --> 00:12:00.940
visible on the right-hand side

230
00:12:00.940 --> 00:12:04.235
of your pane looking
at your ASCII column.

231
00:12:04.235 --> 00:12:06.335
Here we can see I
have highlighted

232
00:12:06.335 --> 00:12:09.710
the bytes and the username.

233
00:12:10.130 --> 00:12:15.880
We're going to talk about
the NTLM hashes and

234
00:12:15.880 --> 00:12:18.455
decrypting these hashes to obtain

235
00:12:18.455 --> 00:12:22.420
the account password
in the next section.