WEBVTT - This file was automatically generated by VIMEO

1
00:00:05.800 --> 00:00:09.000
 Another common class of security vulnerabilities on

2
00:00:08.500 --> 00:00:11.300
 Android applications are known as hard.

3
00:00:11.300 --> 00:00:14.500
 Coating issues with hard coating issues. They're

4
00:00:14.500 --> 00:00:17.600
 mostly the active heart, coding

5
00:00:17.600 --> 00:00:20.600
 information into our service code that is

6
00:00:20.600 --> 00:00:24.000
 potentially exposing information about how the application runt

7
00:00:23.500 --> 00:00:26.300
 or maybe exposing something like a username or

8
00:00:26.300 --> 00:00:29.900
 password or some sort of sensitive data through two

9
00:00:29.900 --> 00:00:32.500
 types of hard coating issues. In this video of

10
00:00:32.500 --> 00:00:35.500
 the first one is sort of the classic hard-coding issue

11
00:00:35.500 --> 00:00:38.600
 where we hard-coded a password into some Java

12
00:00:38.600 --> 00:00:41.400
 file and since we can pile it, we figure known

13
00:00:41.400 --> 00:00:44.400
 as going to be able to decompile. Wouldn't be able to get that

14
00:00:44.400 --> 00:00:47.200
 password. However, that's not the case, as we can

15
00:00:47.200 --> 00:00:50.600
 see 3D compiling and then the other one will be a little bit more complex,

16
00:00:50.600 --> 00:00:53.400
 which will involve actually shared libraries and

17
00:00:53.400 --> 00:00:56.900
 shared objects in discussing, how we can potentially extract passwords

18
00:00:56.900 --> 00:00:57.500
 from those as well.

19
00:00:58.300 --> 00:01:01.500
 So you'll see this, we need to enter in some sort of vendor key

20
00:01:01.500 --> 00:01:04.700
 in order to access this is section.

21
00:01:04.700 --> 00:01:07.400
 So if we try to access it was a access denied

22
00:01:07.400 --> 00:01:10.500
 if we entered the wrong values. So in

23
00:01:10.500 --> 00:01:13.100
 order to extract the password for this,

24
00:01:13.100 --> 00:01:16.600
 we need to find first the activity that corresponds to this login

25
00:01:16.600 --> 00:01:20.600
 page. And in this case, it would be hard code activity. Now,

26
00:01:19.600 --> 00:01:22.500
 a lot of the times it might not be named exactly

27
00:01:22.500 --> 00:01:26.200
 like this. It might not be as easy to find the activity. If

28
00:01:25.200 --> 00:01:28.100
 you need to try to find this as well. You can also take a

29
00:01:28.100 --> 00:01:31.700
 look at the the log messages or the, the displayed messages

30
00:01:31.700 --> 00:01:34.200
 in the alerts. So as you can see, this one

31
00:01:34.200 --> 00:01:37.300
 has that same access denied message. So, we know that we're probably in the

32
00:01:37.300 --> 00:01:37.900
 right place.

33
00:01:38.900 --> 00:01:41.500
 Now, looking at this code, we can see that we're taking

34
00:01:41.500 --> 00:01:45.100
 a look at the the HCG text field.

35
00:01:44.100 --> 00:01:47.800
 We're going to text Amber checking if the string equals

36
00:01:47.800 --> 00:01:50.100
 a vendor secret key. So you can

37
00:01:50.100 --> 00:01:53.400
 see, we parked in the password and this means that it's very

38
00:01:53.400 --> 00:01:56.700
 easy for someone to decompile this application and figure

39
00:01:56.700 --> 00:01:59.100
 out the password for this. So, now from here, we can

40
00:01:59.100 --> 00:02:01.400
 just type in a fender secret key.

41
00:02:02.500 --> 00:02:05.500
 And press access. And as you can see access granted in

42
00:02:05.500 --> 00:02:08.300
 this case. So this is one type of a

43
00:02:08.300 --> 00:02:11.200
 very common hard-coded activity problem. We're on

44
00:02:11.200 --> 00:02:14.400
 it. We heard could a password in plain text rather than doing

45
00:02:14.400 --> 00:02:17.900
 something like obscuring it or Krypton get or hashing

46
00:02:17.900 --> 00:02:20.300
 it or, you know, putting it on a server or something

47
00:02:20.300 --> 00:02:23.200
 like that. There's a whole lot of different things that we could be doing.

48
00:02:23.200 --> 00:02:27.100
 That aren't this primarily? We would be sent

49
00:02:26.100 --> 00:02:29.400
 you like, hash the password in order to protect it.

50
00:02:29.400 --> 00:02:32.500
 But even then someone could get the hottest password

51
00:02:32.500 --> 00:02:35.600
 and try to force it with like an offline. It's hot. So

52
00:02:35.600 --> 00:02:38.200
 that's not really the best way to do it. Typically what

53
00:02:38.200 --> 00:02:41.500
 we want to do here is Sir. Is there a fight on server-side or place

54
00:02:41.500 --> 00:02:45.400
 it somewhere that someone wouldn't be able to access it if they decompiler application?

55
00:02:44.400 --> 00:02:46.800
 So I be the key idea.

56
00:02:47.900 --> 00:02:50.200
 So let's go ahead and discuss the other type of

57
00:02:50.200 --> 00:02:51.100
 hard coating issue.

58
00:02:52.200 --> 00:02:55.100
 And this one is relatively somewhere. Again, we have to enter in

59
00:02:55.100 --> 00:02:58.100
 like a password. If we got the wrong password. It will give us

60
00:02:58.100 --> 00:03:01.500
 the access denied message. And if you entering the correct password, Jose

61
00:03:01.500 --> 00:03:04.300
 access granted. We look at the heart

62
00:03:04.300 --> 00:03:08.000
 rate activity, which is hard code to activity. You'll see

63
00:03:07.100 --> 00:03:09.600
 that things are slightly different here.

64
00:03:10.600 --> 00:03:13.900
 You see it's grabbing D. J at I access.

65
00:03:13.900 --> 00:03:16.000
 So this is this is a

66
00:03:16.500 --> 00:03:19.400
 method from the DIA, the DJ and

67
00:03:19.400 --> 00:03:22.500
 I object, which is this one here.

68
00:03:22.500 --> 00:03:25.800
 So what we going to do, if you want to find this class to

69
00:03:25.800 --> 00:03:28.300
 determine what the access method is actually doing.

70
00:03:28.300 --> 00:03:31.600
 So if I go into this class here, which

71
00:03:31.600 --> 00:03:34.400
 I have here diva AJ, and I you'll see

72
00:03:34.400 --> 00:03:37.800
 that there is a static load, that happens to

73
00:03:37.800 --> 00:03:40.300
 hitting a shared library and the Esso

74
00:03:40.300 --> 00:03:44.000
 name is Diva AJ and I so we

75
00:03:43.600 --> 00:03:47.200
 can find shirt objects in the resources

76
00:03:46.200 --> 00:03:49.200
 under library and you'll

77
00:03:49.200 --> 00:03:52.200
 see that it's compiled for every different type of processor. Which of these

78
00:03:52.200 --> 00:03:55.400
 objects are going to be the same, the main difference being the Assembly Language

79
00:03:55.400 --> 00:03:58.200
 that is targeting the really any of these are

80
00:03:58.200 --> 00:03:59.600
 going to be able to give us information.

81
00:04:00.600 --> 00:04:03.500
 Saudi shirt object libraries as we discussed

82
00:04:03.500 --> 00:04:06.100
 they can't really be decompiled in the traditional sort of

83
00:04:06.100 --> 00:04:09.800
 way. We can't go from a shared object to source code. However, what

84
00:04:09.800 --> 00:04:12.300
 we can do to objects for

85
00:04:12.300 --> 00:04:15.100
 drinks. So what I mean by this is that any sort of

86
00:04:15.100 --> 00:04:18.300
 like static like texts were able to extract from the

87
00:04:18.300 --> 00:04:21.200
 shared object libraries. There's a number of different ways to

88
00:04:21.200 --> 00:04:25.000
 do it. I like to use a utility called strings and

89
00:04:24.100 --> 00:04:27.200
 what strengths does is that essentially allows us

90
00:04:27.200 --> 00:04:30.800
 to search the whole library for the Statics drink.

91
00:04:30.800 --> 00:04:33.100
 So you can see here. I've got the copy of

92
00:04:33.100 --> 00:04:36.100
 the library on. If you want to grab a copy of

93
00:04:36.100 --> 00:04:39.500
 them. What you can do is you can change this APK to

94
00:04:39.500 --> 00:04:42.200
 a zip folder. And then what you do this, you

95
00:04:42.200 --> 00:04:45.500
 can open up the set and then you can go into the libraries for

96
00:04:45.500 --> 00:04:48.400
 their like before and then extract the value from there.

97
00:04:49.400 --> 00:04:52.300
 So don't be the way that you would be able to extract it. If

98
00:04:52.300 --> 00:04:55.300
 you're looking to extract it onto your device and then

99
00:04:55.300 --> 00:04:58.200
 utilizing strings were able to search it for any sort

100
00:04:58.200 --> 00:05:01.600
 of text that may exist. So let's go ahead and open up command

101
00:05:01.600 --> 00:05:05.400
 line dance, CD to this directory. And

102
00:05:04.400 --> 00:05:07.700
 then the way that it works is you just go string. Exe

103
00:05:07.700 --> 00:05:10.200
 and then we type in the name of the file that we want

104
00:05:10.200 --> 00:05:15.000
 to search. So it would be the Liv Diva Janiya. And

105
00:05:13.100 --> 00:05:16.200
 you can see here, we get all

106
00:05:16.200 --> 00:05:19.100
 the texts drinks that are existing inside of

107
00:05:19.100 --> 00:05:22.100
 that. Soo file. Now, from here, we have

108
00:05:22.100 --> 00:05:25.300
 to do a little bit of thinking, to be able to extract the

109
00:05:25.300 --> 00:05:26.700
 ones that are important to us.

110
00:05:27.700 --> 00:05:29.900
 You'll notice Aldis. One's here.

111
00:05:30.900 --> 00:05:34.000
 If you have some familiarity with with Assembly

112
00:05:33.300 --> 00:05:37.000
 Language, is, you know, that these thoughts will typically correspond

113
00:05:36.300 --> 00:05:39.200
 to labels or points to jump

114
00:05:39.200 --> 00:05:42.800
 too. So these dots. Like text

115
00:05:42.800 --> 00:05:45.500
 file Center Street, like text, talk text

116
00:05:45.500 --> 00:05:48.100
 Data, they aren't really as important

117
00:05:48.100 --> 00:05:51.800
 to us because they're just like sort of like you. Divisions of

118
00:05:51.800 --> 00:05:54.300
 the file itself. So we aren't really interested in

119
00:05:54.300 --> 00:05:57.700
 those. You can see that these genuine GCC or

120
00:05:57.700 --> 00:06:00.400
 probably telling us this was compiled with so

121
00:06:00.400 --> 00:06:03.600
 this information again isn't necessarily relevant

122
00:06:03.600 --> 00:06:06.500
 interesting. The gold one point one looks

123
00:06:06.500 --> 00:06:09.400
 to me like a version number of something and you

124
00:06:09.400 --> 00:06:12.500
 can see here. It's you and you called - version so this is

125
00:06:12.500 --> 00:06:15.700
 probably just a version number. So that's not necessarily important.

126
00:06:15.700 --> 00:06:18.400
 You can see these are other shared objects that

127
00:06:18.400 --> 00:06:21.800
 are being used. So again, these aren't really particularly important

128
00:06:21.800 --> 00:06:24.700
 these again or mostly labels.

129
00:06:24.700 --> 00:06:27.300
 So it's indicating the end that the SS start the

130
00:06:27.300 --> 00:06:30.200
 E data. So those aren't really something that's going

131
00:06:30.200 --> 00:06:30.800
 to be interest.

132
00:06:30.800 --> 00:06:33.200
 Similar with this year, for the

133
00:06:33.200 --> 00:06:36.500
 same reasons as to your copy, is a c function. That's

134
00:06:36.500 --> 00:06:40.000
 like we be used inside of here. These appear

135
00:06:39.100 --> 00:06:42.800
 to be just like them information about the

136
00:06:42.800 --> 00:06:45.800
 actual Library itself, which will

137
00:06:45.800 --> 00:06:49.200
 leave us with these three pieces of information as

138
00:06:48.200 --> 00:06:49.700
 well as this

139
00:06:51.400 --> 00:06:54.300
 So when we're taking a look at these, we serve one of a structure, which

140
00:06:54.300 --> 00:06:56.300
 ones are relevant to us.

141
00:06:57.400 --> 00:07:00.600
 So from this week and we can serve essentially just trial-and-error

142
00:07:00.600 --> 00:07:04.700
 them to see which one is the correct input. There

143
00:07:03.700 --> 00:07:06.000
 are some other ways that we can sort of

144
00:07:06.200 --> 00:07:09.300
 like look at these and be able to decode information from them. Use it

145
00:07:09.300 --> 00:07:12.400
 when they help like the dollar sign character inside of them. It means that

146
00:07:12.400 --> 00:07:16.100
 there's some sort of script anything related to them. Potentially could

147
00:07:15.100 --> 00:07:18.500
 be like, an argument in a bash script or something like

148
00:07:18.500 --> 00:07:21.100
 that. A lot of the time, these will correspond to

149
00:07:21.100 --> 00:07:24.600
 like, hold lines for instance, which means that this is

150
00:07:24.600 --> 00:07:28.000
 probably the only one that's just general text. So,

151
00:07:27.100 --> 00:07:30.100
 if we think that this one is the right one, then we can bring

152
00:07:30.100 --> 00:07:34.600
 it over here and try to input it in, and see what will happen. So olustee.

153
00:07:33.600 --> 00:07:37.100
 F. G a d semicolon.

154
00:07:36.100 --> 00:07:37.600
 L a h.

155
00:07:38.800 --> 00:07:41.400
 We try to access. You see that we get access. Granted.

156
00:07:41.400 --> 00:07:44.400
 So obviously this is the proper password for it.

157
00:07:44.400 --> 00:07:47.500
 So you can see from here that even though

158
00:07:47.500 --> 00:07:50.500
 we can't necessarily decompile this year. Jex,

159
00:07:50.500 --> 00:07:53.200
 we can just search them for the strings that exist in

160
00:07:53.200 --> 00:07:56.000
 them. And if they have a hard-coded string inside of their, we're going to

161
00:07:56.100 --> 00:07:59.800
 be able to extract the string and potentially weakened

162
00:07:59.800 --> 00:08:01.200
 formation such as the password.

163
00:08:02.200 --> 00:08:05.900
 So this video gives you a bit of an idea behind how hard-coded

164
00:08:05.900 --> 00:08:08.900
 text is able to be utilized to potentially

165
00:08:08.900 --> 00:08:11.200
 exposed at about Android application. So,

166
00:08:11.200 --> 00:08:15.000
 these are the vulnerabilities to happen every so often and what

167
00:08:14.100 --> 00:08:17.100
 is X the shared object ones or maybe a

168
00:08:17.100 --> 00:08:20.500
 bit more common because people are a bit less careful when

169
00:08:20.500 --> 00:08:23.600
 they think that the thing can't be decompiled. But also if

170
00:08:23.600 --> 00:08:26.200
 they obscure the files at all, if we can sort of like

171
00:08:26.200 --> 00:08:29.600
 managed to an obscurity, the code

172
00:08:29.600 --> 00:08:32.400
 or unencrypted code, we can potentially figure out

173
00:08:32.400 --> 00:08:35.400
 the password. So not only are playing text to

174
00:08:35.400 --> 00:08:38.500
 information necessarily a bad idea. But

175
00:08:38.500 --> 00:08:41.400
 also even just like putting ashes into the code could

176
00:08:41.400 --> 00:08:44.700
 be dangerous because then, you can do, like, password-based. I

177
00:08:44.700 --> 00:08:49.000
 talked to try to decrypt them so you can

178
00:08:48.200 --> 00:08:51.200
 look out for 4:30. So

179
00:08:51.200 --> 00:08:53.900
 now you can take a look for these in any applications.
