WEBVTT - This file was automatically generated by VIMEO

1
00:00:07.500 --> 00:00:10.400
 The next time I found her ability that Cruiser is really good

2
00:00:10.400 --> 00:00:13.100
 at being able to detect. Our content provider based

3
00:00:13.100 --> 00:00:17.100
 upon her abilities of being

4
00:00:17.100 --> 00:00:20.500
 able to access data from an application from somewhere

5
00:00:20.500 --> 00:00:23.500
 external to that application. So, if like top

6
00:00:23.500 --> 00:00:26.600
 number one wants to access data from App number to it

7
00:00:26.600 --> 00:00:29.300
 was typically as a content provider to be able to access that

8
00:00:29.300 --> 00:00:33.200
 data. Now, I'm content providers are hidden behind permissions.

9
00:00:32.200 --> 00:00:36.200
 Some of them are not hidden behind permission. If

10
00:00:35.200 --> 00:00:38.500
 they're not here by in permissions, they're accessible from

11
00:00:38.500 --> 00:00:41.300
 anywhere, which means that we could potentially do something with

12
00:00:41.300 --> 00:00:44.200
 that to expose data. No, we thought in

13
00:00:44.200 --> 00:00:47.300
 mind, we have to consider some of the, some of the, some of

14
00:00:47.300 --> 00:00:50.400
 the information here, regarding the content providers up in

15
00:00:50.400 --> 00:00:53.500
 general, being able to create content provider isn't necessarily an

16
00:00:53.500 --> 00:00:56.400
 issue. However, if you're able to do SQL injection to

17
00:00:56.400 --> 00:00:59.400
 a content provider, that can be a big issue. So we'll

18
00:00:59.400 --> 00:01:02.800
 take a look at what that can typically look like inside of here. So,

19
00:01:02.800 --> 00:01:05.300
 if you want to expose content providers, that

20
00:01:05.300 --> 00:01:05.800
 exist.

21
00:01:05.800 --> 00:01:09.000
 On an application, we can get through troesser and

22
00:01:08.100 --> 00:01:10.900
 we can do that through the following commands here.

23
00:01:12.900 --> 00:01:17.300
 So if I run a scanner. Provider.

24
00:01:16.300 --> 00:01:20.100
 Find, uri's Lego

25
00:01:19.100 --> 00:01:22.200
 - A and I give it the name of the application.

26
00:01:25.700 --> 00:01:28.100
 What this will do as it was supposed to me. All of

27
00:01:28.100 --> 00:01:31.700
 the URI, is that exist? You are Riser. That content providers

28
00:01:31.700 --> 00:01:34.100
 that we may be able to query. So you can

29
00:01:34.100 --> 00:01:38.100
 see that there's two of them here that were actually able to query. I

30
00:01:37.100 --> 00:01:40.200
 just want to I want to give you a bit of an idea about

31
00:01:40.200 --> 00:01:43.800
 what this looks like from Sir Vega typical legitimate

32
00:01:43.800 --> 00:01:46.300
 perspective. So if I treat a shell into

33
00:01:46.300 --> 00:01:51.500
 my device here, I can do something like this query. I

34
00:01:50.500 --> 00:01:53.900
 think you do. I spend at URI and

35
00:01:53.900 --> 00:01:56.000
 then you put in like the URI that you want a

36
00:01:56.000 --> 00:01:56.400
 query.

37
00:01:58.500 --> 00:02:01.500
 And what happens is this will simply run through

38
00:02:01.500 --> 00:02:04.300
 a specific type of a query and you

39
00:02:04.300 --> 00:02:07.900
 can typically provide them with with so arguments.

40
00:02:08.700 --> 00:02:11.900
 And those arguments can be interpreted in potentially

41
00:02:11.900 --> 00:02:15.000
 exploited. So I think I

42
00:02:15.200 --> 00:02:18.100
 might have to put two hyphens into it. Yeah, I have to

43
00:02:18.100 --> 00:02:21.200
 put two hyphens to Bri to high

44
00:02:21.200 --> 00:02:24.100
 fence here. So this what the actual command would look like.

45
00:02:26.100 --> 00:02:29.200
 CC my run. This, it actually gives me data that

46
00:02:29.200 --> 00:02:32.200
 it's inside of the database. If I can do with this, as

47
00:02:32.200 --> 00:02:35.300
 I can like provided specific projection. Write a

48
00:02:35.300 --> 00:02:38.300
 projection, is the fields that I actually want to see so friend. If

49
00:02:38.300 --> 00:02:41.600
 I wanted to just the title, I can say projection title, which

50
00:02:41.600 --> 00:02:44.400
 will show me, just the title. So, if

51
00:02:44.400 --> 00:02:47.300
 you take a look at the actual code here, I can help

52
00:02:47.300 --> 00:02:50.500
 you understand a little bit more. When we use the query Porsche.

53
00:02:50.500 --> 00:02:53.900
 What it will do is it will utilize this query function

54
00:02:53.900 --> 00:02:56.300
 inside of the provider and all content providers going

55
00:02:56.300 --> 00:02:59.200
 to look very similar. So we'll see here is

56
00:02:59.200 --> 00:03:02.100
 that when it actually runs the query, it rented to a

57
00:03:02.100 --> 00:03:07.100
 query Builder and it provides it with a production. Now, he's

58
00:03:05.100 --> 00:03:08.800
 generally relatively secure.

59
00:03:08.800 --> 00:03:11.200
 However, projections have

60
00:03:11.200 --> 00:03:14.100
 to be set in a very specific way. We should be done with the

61
00:03:14.100 --> 00:03:17.600
 projection is telling a query Builder, what columns are

62
00:03:17.600 --> 00:03:20.100
 actually felt like to be able to be inputted. If we

63
00:03:20.100 --> 00:03:23.400
 don't do this, then you can input theoretically anything into

64
00:03:23.400 --> 00:03:26.000
 that projection. It'll actually get executed a seat.

65
00:03:26.100 --> 00:03:29.200
 So did demonstrate this sort of idea. Let me

66
00:03:29.200 --> 00:03:32.900
 show you what this looks like from like, from my ADB shell.

67
00:03:34.100 --> 00:03:37.400
 So if the projection for title instead, I could replace

68
00:03:37.400 --> 00:03:40.800
 this with something different, I could do something like to starve from

69
00:03:40.800 --> 00:03:44.100
 SQL, light underscore master and

70
00:03:43.100 --> 00:03:46.200
 then I can put like the comment to coming up. The

71
00:03:46.200 --> 00:03:49.000
 rest of it with this does is. So when you

72
00:03:49.200 --> 00:03:52.500
 do the projection, it injects the data between select and

73
00:03:52.500 --> 00:03:55.200
 from that. What I'm doing is that this life

74
00:03:55.200 --> 00:03:58.300
 is already there. So they just put star from SQL, light

75
00:03:58.300 --> 00:04:01.300
 master and then I come it's at the rest. So that just showed

76
00:04:01.300 --> 00:04:05.000
 him the pic for you to select everything. From the master table. The master

77
00:04:04.200 --> 00:04:07.300
 table holds all of the information about

78
00:04:07.300 --> 00:04:10.200
 what exists inside of this database. So what you can see here, you

79
00:04:10.200 --> 00:04:13.000
 can see all the table information. That tells me the

80
00:04:13.500 --> 00:04:16.300
 SQL injection is possible. So this allows

81
00:04:16.300 --> 00:04:17.600
 me to be able to see that sort of information.

82
00:04:19.100 --> 00:04:22.600
 No course, we don't always want to be doing this manually

83
00:04:22.600 --> 00:04:25.700
 because it takes a lot of time to test a lot of content providers to

84
00:04:25.700 --> 00:04:28.400
 Laclede. Rose are actually has some built-in ability to

85
00:04:28.400 --> 00:04:31.100
 be able to do that. So the way that you can test this, if you

86
00:04:31.100 --> 00:04:33.500
 can do something like this, you can say run.

87
00:04:34.600 --> 00:04:38.100
 A scanner. Providers.

88
00:04:37.100 --> 00:04:42.300
 Viator. Injection.

89
00:04:43.300 --> 00:04:46.400
 And then - A and then we put in the name of the application again.

90
00:04:48.400 --> 00:04:52.000
 I want this with you, is it will attempt injection donnisha

91
00:04:51.500 --> 00:04:54.700
 providers? It'll tell you, if you can inject to the projection

92
00:04:54.700 --> 00:04:57.800
 or if you can inject you the selection, would you

93
00:04:57.800 --> 00:05:00.400
 can do in both of these cases? So when we

94
00:05:00.400 --> 00:05:04.100
 talked about this selection, the selection is actually the where Clause so we

95
00:05:03.100 --> 00:05:06.900
 can give it a where Clause we can give it a projection as

96
00:05:06.900 --> 00:05:10.200
 well and both of those scenes have injection enabled

97
00:05:09.200 --> 00:05:10.700
 on them.

98
00:05:11.400 --> 00:05:14.200
 So now in general, once we have this

99
00:05:14.200 --> 00:05:17.300
 information, were able to run a crew like I just

100
00:05:17.300 --> 00:05:20.700
 did here to get all the information for sequel master. And

101
00:05:20.700 --> 00:05:23.300
 then you do, I think that we can get other pieces of information. If there's

102
00:05:23.300 --> 00:05:26.100
 more date, instead of the state of peace that we shouldn't have access to will be

103
00:05:26.100 --> 00:05:29.300
 able to get to that utilizing this. So, that's sort of

104
00:05:29.300 --> 00:05:33.500
 the general idea. And just if what we're going to be doing with this and

105
00:05:32.500 --> 00:05:35.200
 just a show, like, you can

106
00:05:35.200 --> 00:05:38.600
 get the sensitive information inside of drozer, and

107
00:05:38.600 --> 00:05:42.300
 you can get that through running gum. Scanner. Provider.

108
00:05:41.300 --> 00:05:44.000
 It sucks, equal tables.

109
00:05:44.900 --> 00:05:47.400
 And with this will do is it will essentially just

110
00:05:47.400 --> 00:05:50.300
 give you all of the tables that exists if

111
00:05:50.300 --> 00:05:53.800
 a if a content provider is vulnerable. So you

112
00:05:53.800 --> 00:05:56.400
 can see it tells me that these are the tables that are accessible

113
00:05:56.400 --> 00:06:00.000
 through it. Some through this injection, right?

114
00:05:59.100 --> 00:06:02.300
 So what I'm doing this, like for instance,

115
00:06:02.300 --> 00:06:05.500
 if you want to see what an injection could look like, I could replace

116
00:06:05.500 --> 00:06:09.400
 this with star from like for instance, Android metadata.

117
00:06:10.500 --> 00:06:13.900
 I can expose the metadata to us. I could

118
00:06:13.900 --> 00:06:16.400
 do this from from notes, which

119
00:06:16.400 --> 00:06:19.200
 is the other table that exists and that's serious out that we

120
00:06:19.200 --> 00:06:22.500
 got from the content providers. That's not overly interesting, but

121
00:06:23.300 --> 00:06:26.400
 I mean, you can get a lot of other things such as, like, the sea polite

122
00:06:26.400 --> 00:06:29.600
 version. I think you could do that, just generally through

123
00:06:29.600 --> 00:06:30.500
 something like, that.

124
00:06:34.300 --> 00:06:35.700
 this, for instance,

125
00:06:37.100 --> 00:06:41.000
 And I'll take an example of the three things that you could do with this sort of vulnerability. So

126
00:06:40.600 --> 00:06:43.900
 just give you a good idea of how long how content

127
00:06:43.900 --> 00:06:47.100
 providers can be exploited and how to find those vulnerabilities Street

128
00:06:46.100 --> 00:06:47.500
 Roeser.
