> For the complete documentation index, see [llms.txt](https://nightowl131.gitbook.io/aapg/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://nightowl131.gitbook.io/aapg/manual-dynamic-analysis/3.3-analyze-local-storage.md).

# 3.3 Analyze local storage

## 3.3.1 LOCAL DATABASE

### sqlite

```
adb shell
cd /data/data/com.x.x.x/database/
sqlite3 db_name
```

**Within sql-shell:**

*list existing tables within db:*

```
.tables
```

*list table schema:*

```
.schema table_name
```

*or*

```
SELECT sql FROM sqlite_master WHERE tbl_name = 'insert_table_name' AND type = 'table';
```

### realm

```
adb pull path/to/database/on/phone/name.realm path/to/store/db/on/pc/
```

**open within** [**RealmStudio**](https://docs.realm.io/sync/realm-studio)

### Common locations

* */data/data/com.x.x.x/*
  * *shared\_prefs/*

    *(search for keysets -> used to encrypt files --> might be encrypted as well, if handled properly)*
  * *cache/*
  * *database/*
* */sdcard/Android/com.x.x.x/*

{% hint style="info" %}
*KEEP YOUR EYES OPEN FOR:*

* developer files
  * build configs
  * resources (i.e: *res/values/strings.xml*)
* backup files
* old (maybe unused) files
  {% endhint %}

## 3.3.2 THINGS TO REPORT

{% hint style="danger" %}

* Hardcoded cryptographics key
* Cleartext credentials stored in **.config**/.**xml** & **sqlite**-/**realm**-DB
* Misplaced files (i.e. creds.txt stored on SD-Card)
* Wrong file permissions set (also have a look @ **1.4**)
  {% endhint %}

## 3.3.3 MORE DETAILS

[Data storage security on Android](https://steemit.com/penetration/@surajraghuvanshi/data-storage-security-on-android)
