A content provider component **supplies data from one application to others** on request. Such requests are handled by the methods of the ContentResolver class. A content provider can use different ways to store its data and the data can be **stored** in a **database**, in **files**, or even over a **network**.
It has to be declared inside the _Manifest.xml_ file. Example:
In this case, it's necessary the permission `READ_KEYS` to access `content://com.mwr.example.sieve.DBContentProvider/Keys`
\(_Also, notice that in the next section we are going to access `/Keys/` which isn't protected, that's because the developer got confused and protected `/Keys` but declared `/Keys/`_\)
**Maybe you can access private data or exploit some vulnerability \(SQL Injection or Path Traversal\).**
## Get info from **exposed content providers**
```text
dz> run app.provider.info -a com.mwr.example.sieve
We can **reconstruct** part of the content **URIs** to access the **DBContentProvider**, because we know that they must begin with “_content://_” and the information obtained by Drozer inside Path: _/Keys_.
Drozer can **guess and try several URIs**:
```text
dz> run scanner.provider.finduris -a com.mwr.example.sieve
Scanning com.mwr.example.sieve...
Unable to Query content://com.mwr.example.sieve.DBContentProvider/
...
Unable to Query content://com.mwr.example.sieve.DBContentProvider/Keys
The query will be like: `content://name.of.package.class/declared_name`
## **Database-backed Content Providers**
Probably most of the Content Providers are used as **interface** for a **database**. Therefore, if you can access it you could be able to **extract, update, insert and delete** information.
Check if you can **access sensitive information** or try to change it to **bypass authorisation** mechanisms.
When checking the code of the Content Provider **look** also for **functions** named like: _query, insert, update and delete_:
_Note that in insert and update you can use --string to indicate string, --double to indicate a double, --float, --integer, --long, --short, --boolean_
### Update content
Knowing the name of the columns you could also **modify the entries**:
It is simple to test for SQL injection **\(SQLite\)** by manipulating the **projection** and **selection fields** that are passed to the content provider.
When quering the Content Provider there are 2 interesting arguments to search for information: _--selection_ and _--projection_:
dz> run app.provider.read content://com.mwr.example.sieve.FileBackupProvider/etc/hosts
127.0.0.1 localhost
```
### **Path Traversal**
If you can access files, you can try to abuse a Path Traversal \(in this case this isn't necessary but you can try to use "_../_" and similar tricks\).
```text
dz> run app.provider.read content://com.mwr.example.sieve.FileBackupProvider/etc/hosts
127.0.0.1 localhost
```
#### **Automatic Path Traversal discovery by Drozer**
```text
dz> run scanner.provider.traversal -a com.mwr.example.sieve