tracking traces of deleted applications · ios –all about the bundle •deletion of an app...

53
Tracking traces of deleted applications Christopher Vance Alexis Brignoni

Upload: others

Post on 17-Jan-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Tracking traces of deleted applications · iOS –All About the Bundle •Deletion of an app deletes the entire “Container” •Native files and databases track references to apps

Tracking traces of deleted applications

Christopher Vance

Alexis Brignoni

Page 2: Tracking traces of deleted applications · iOS –All About the Bundle •Deletion of an app deletes the entire “Container” •Native files and databases track references to apps

iOS – All About the Bundle

• Deletion of an app deletes the entire “Container”

• Native files and databases track references to apps

• Deleted? Or Just Offloaded?

Page 3: Tracking traces of deleted applications · iOS –All About the Bundle •Deletion of an app deletes the entire “Container” •Native files and databases track references to apps

Offloaded?

• Apple allows users to “Offload” apps not frequently used

• Deletes the App container, but not the Data container

Page 4: Tracking traces of deleted applications · iOS –All About the Bundle •Deletion of an app deletes the entire “Container” •Native files and databases track references to apps

Offloaded?

Page 5: Tracking traces of deleted applications · iOS –All About the Bundle •Deletion of an app deletes the entire “Container” •Native files and databases track references to apps

App Storage (ApplicationState.db)Package Name com.atebits.Tweetie2

AppSource Location /private/var/containers/Bundle/Application/15FFD685-5154-4C07-B332-95F3F7521A48/Twitter.app

Application Data Location /private/var/mobile/Containers/Data/Application/1562A7BD-D4FA-4838-88FC-3F48C009EBD0

\private\var\mobile\Library\FrontBoard\applicationState.db

Page 6: Tracking traces of deleted applications · iOS –All About the Bundle •Deletion of an app deletes the entire “Container” •Native files and databases track references to apps

No Directions

• Offloaded apps lose ApplicationState.db entry (no map to container)

• MobileInstallation Log MAY have it depending on time.

• Bundle ID is searchable in FileSystem

Page 7: Tracking traces of deleted applications · iOS –All About the Bundle •Deletion of an app deletes the entire “Container” •Native files and databases track references to apps

IconState.plist (Springboard)

• Still lists the app.

• Device will show a cloud icon next to app on the home screen.

• BundleID is the key!

Page 8: Tracking traces of deleted applications · iOS –All About the Bundle •Deletion of an app deletes the entire “Container” •Native files and databases track references to apps

Search for BundleID.plist

• Each app has a plist file named [BundleID].plist in the Preferences folder

• Source path reveals the UUID for that App!

Page 9: Tracking traces of deleted applications · iOS –All About the Bundle •Deletion of an app deletes the entire “Container” •Native files and databases track references to apps

Learning BundleIDs

• Search for app online [Google: reddit ios app]– Look for http://apps.apple.com/

• Take the number after ID in URL– https://apps.apple.com/us/app/reddit/id1064216828

• Open URL: https://itunes.apple.com/lookup?id=

– Put value after the “=”

Page 10: Tracking traces of deleted applications · iOS –All About the Bundle •Deletion of an app deletes the entire “Container” •Native files and databases track references to apps

Learning BundleIDs

• Data downloaded as .txt file

• Search for “bundleID”

Page 11: Tracking traces of deleted applications · iOS –All About the Bundle •Deletion of an app deletes the entire “Container” •Native files and databases track references to apps

Search for BundleID!• Mobile Installation Logs• UninstalledApplications.plist• DAAP.sqlitedb• AppPurchaseHistory.6.sqlitedb• ScreenTime• PowerLog.PLSQL• KnowledgeC.db• DataUsage• CallHistory.storedata ???

Page 12: Tracking traces of deleted applications · iOS –All About the Bundle •Deletion of an app deletes the entire “Container” •Native files and databases track references to apps

Mobile Installation Logs• /private/var/installd/Library/Logs/MobileInstallation/*.log

(0 or 1)• Tracks when apps are installed, uninstalled, moved

containers, and destroyed containers.• Gives timestamps and path to app.

• iOS-Mobile-Installation-Logs-Parser:• https://github.com/abrignoni/iOS-Mobile-Installation-Logs-

Parser

Page 13: Tracking traces of deleted applications · iOS –All About the Bundle •Deletion of an app deletes the entire “Container” •Native files and databases track references to apps

Mobile Installation Logs

Page 14: Tracking traces of deleted applications · iOS –All About the Bundle •Deletion of an app deletes the entire “Container” •Native files and databases track references to apps

UninstalledApplications.plist

• \private\var\installd\Library\MobileInstallation\UninstalledApplications.plist

BundleIDs & Dates/Times

Goes back MONTHS

Page 15: Tracking traces of deleted applications · iOS –All About the Bundle •Deletion of an app deletes the entire “Container” •Native files and databases track references to apps

DAAP.sqlitedb

• \private\var\mobile\Library\Caches\com.apple.appstored\DAAP.sqlitedb

• DAAP – Digital Audio Access Protocol for sharing media across a local network

• Lists ALL apps purchased by Apple ID!

• Appears to have been added in iOS 12

• Lists who bought the app! (Remember family sharing)

Page 16: Tracking traces of deleted applications · iOS –All About the Bundle •Deletion of an app deletes the entire “Container” •Native files and databases track references to apps

AppPurchaseHistory.6.sqlitedb

• \private\var\mobile\Library\Caches\com.apple.storeservices\AppPurchaseHistory.6.sqlitedb

• Lists out apps purchased by Apple ID holder

• Includes original purchase date

• Very similar to DAAP.sqlitedb (but found in older iOS)

Page 17: Tracking traces of deleted applications · iOS –All About the Bundle •Deletion of an app deletes the entire “Container” •Native files and databases track references to apps

Screen Time

• \private\var\mobile\Library\Application Support\com.apple.remotemanagementd\RMAdminStore-Local.sqlite

• Added in iOS 12, tracks daily usage history of Apps.

• Only stores the last ~7 days for times, app notifications, and on-screen time.

• Synced applications stick around! [Sometimes]

Page 18: Tracking traces of deleted applications · iOS –All About the Bundle •Deletion of an app deletes the entire “Container” •Native files and databases track references to apps

PowerLog.PLSQL• Stores SO much data. • Tracks app usage and deletion times. • Lists offloaded apps as deleted (careful!)• Timestamps didn’t appear as accurate, and different

from table to table.

• SUPER thankful for APOLLO– https://github.com/mac4n6/APOLLO

Page 19: Tracking traces of deleted applications · iOS –All About the Bundle •Deletion of an app deletes the entire “Container” •Native files and databases track references to apps

PowerLog.PLSQL

• PLApplicationAgent_EventNone_AllApps

• PLApplicationAgent_EventNone_AllPlugins

• PLApplicationAgent_EventNone_AppVersions

• PLAppTimeService_Aggregate_AppRunTime

Page 20: Tracking traces of deleted applications · iOS –All About the Bundle •Deletion of an app deletes the entire “Container” •Native files and databases track references to apps

KnowledgeC.db

• Useful to track application install/uninstall dates/times

• Application in Focus (even after removal)

Page 21: Tracking traces of deleted applications · iOS –All About the Bundle •Deletion of an app deletes the entire “Container” •Native files and databases track references to apps

DataUsage.sqlite

• Private\var\wireless\Library\Databases\DataUsage.sqlite

• Found in iTunes backups and full file system

• Tracks only cellular data usage (app must be used once on cellular network)

• Keeps longer records of deleted apps

• Tracks several usage timestamps

Page 22: Tracking traces of deleted applications · iOS –All About the Bundle •Deletion of an app deletes the entire “Container” •Native files and databases track references to apps

DataUsage.sqlite

Page 23: Tracking traces of deleted applications · iOS –All About the Bundle •Deletion of an app deletes the entire “Container” •Native files and databases track references to apps

netusage.sqlite

• Private/var/networkd/netusage.sqlite

• Almost identical structure

• Better at clearing deleted apps

• Tracks WiFi / Cellular / Wired data sizes

• Multiple potential timestamps

Page 24: Tracking traces of deleted applications · iOS –All About the Bundle •Deletion of an app deletes the entire “Container” •Native files and databases track references to apps

Deleted Database Records!

• App could call to Call Log API

– Call Logs now delete records of apps that are deleted

– bundleID can be carved

– {SCREENSHOT}

Page 25: Tracking traces of deleted applications · iOS –All About the Bundle •Deletion of an app deletes the entire “Container” •Native files and databases track references to apps

The Takeaways

• Some apps were there, some weren’t.

• The less time passes the more potential for data.

• Not every artifact will be populated for each deleted app.

Page 26: Tracking traces of deleted applications · iOS –All About the Bundle •Deletion of an app deletes the entire “Container” •Native files and databases track references to apps

Timelining Activity• App Purchase Times

• Potential Install Times

• Usage/Connection Times

• Times in Focus (Last 7-30 days)

• Deleted Time

DAAP / AppPurchase.6

Mobile Installation Logs

DataUsage / NetUsage / PowerLog

KnowledgeC / ScreenTime

Mobile Installation Logs DeletedApplications.plistPowerLog

Page 27: Tracking traces of deleted applications · iOS –All About the Bundle •Deletion of an app deletes the entire “Container” •Native files and databases track references to apps

Android – Trace categories

• Native to Android

• Vendor installed

• User installed 3rd party apps

Page 28: Tracking traces of deleted applications · iOS –All About the Bundle •Deletion of an app deletes the entire “Container” •Native files and databases track references to apps

Native to Android

• Usagestats

– https://www.sans.org/cyber-security-summit/archives/file/summit-archive-1528491463.pdf

– Keeps app activity record even after app deletion

Page 29: Tracking traces of deleted applications · iOS –All About the Bundle •Deletion of an app deletes the entire “Container” •Native files and databases track references to apps

Usagestats

Page 30: Tracking traces of deleted applications · iOS –All About the Bundle •Deletion of an app deletes the entire “Container” •Native files and databases track references to apps

Usagestats

• lastTimeActive="1756933803"

• package="com.viber.voip“

• timeActive="512058"

• lastEvent="2"

• appLaunchCount="14"

Page 31: Tracking traces of deleted applications · iOS –All About the Bundle •Deletion of an app deletes the entire “Container” •Native files and databases track references to apps

Usagestats

Page 32: Tracking traces of deleted applications · iOS –All About the Bundle •Deletion of an app deletes the entire “Container” •Native files and databases track references to apps

Usagestats

• Python Script

– https://github.com/abrignoni/Android-Usagestats-XML-Parser

Page 33: Tracking traces of deleted applications · iOS –All About the Bundle •Deletion of an app deletes the entire “Container” •Native files and databases track references to apps

Well known Android native DBs

• /data/com.android.vending/databases

– Localappstate.db

– Library.db

– Package_verification.db

Page 34: Tracking traces of deleted applications · iOS –All About the Bundle •Deletion of an app deletes the entire “Container” •Native files and databases track references to apps

Vendor Installed

• Samsung Members

Page 35: Tracking traces of deleted applications · iOS –All About the Bundle •Deletion of an app deletes the entire “Container” •Native files and databases track references to apps

Samsung Members

• Pocket Geek

• Installed by default

Page 36: Tracking traces of deleted applications · iOS –All About the Bundle •Deletion of an app deletes the entire “Container” •Native files and databases track references to apps

Samsung Members

• Pocket Geek

• Installed by default

• Path:

– /data/com.samsung.oh/databases/

• Databases:• com_pocketgeek_sdk_app_inventory.db -> android_app

• com_pocketgeek_sdk.db -> device_events

Page 37: Tracking traces of deleted applications · iOS –All About the Bundle •Deletion of an app deletes the entire “Container” •Native files and databases track references to apps

Samsung Members

• com_pocketgeek_sdk_app_inventory.db

– Display name

– Package_name

– System_app

– Last_used

Page 38: Tracking traces of deleted applications · iOS –All About the Bundle •Deletion of an app deletes the entire “Container” •Native files and databases track references to apps

Samsung Members

• com_pocketgeek_sdk_app_inventory.db

Page 39: Tracking traces of deleted applications · iOS –All About the Bundle •Deletion of an app deletes the entire “Container” •Native files and databases track references to apps

Samsung Members

• com_pocketgeek_sdk.db– Type

• Network, install, power, and alert events

– Value• JSON

• Inventory data for apps

– Created_at• Epoch time

Page 40: Tracking traces of deleted applications · iOS –All About the Bundle •Deletion of an app deletes the entire “Container” •Native files and databases track references to apps

Samsung Members

• com_pocketgeek_sdk.db

Page 41: Tracking traces of deleted applications · iOS –All About the Bundle •Deletion of an app deletes the entire “Container” •Native files and databases track references to apps

Context log

• Path:

– /data/com.Samsung.android.providers.context/databases/ContextLog.db -> use_app

Page 42: Tracking traces of deleted applications · iOS –All About the Bundle •Deletion of an app deletes the entire “Container” •Native files and databases track references to apps

Context log

• Timestamp: Epoch & human readable

• Timezone offset

• App ID + app sub ID

• Start & stop times: Epoch & human readable

• Duration in miliseconds

Page 43: Tracking traces of deleted applications · iOS –All About the Bundle •Deletion of an app deletes the entire “Container” •Native files and databases track references to apps

Context log

Page 44: Tracking traces of deleted applications · iOS –All About the Bundle •Deletion of an app deletes the entire “Container” •Native files and databases track references to apps

Samsung Smart Manager

Page 45: Tracking traces of deleted applications · iOS –All About the Bundle •Deletion of an app deletes the entire “Container” •Native files and databases track references to apps

Samsung Smart Manager

• Installed by default

• Path:

– /data/com.samsung.android.sm/databases

• Databases:

– sm.db -> crash_info, excluded_app

– lowpowercontext-system-db -> usage_log

Page 46: Tracking traces of deleted applications · iOS –All About the Bundle •Deletion of an app deletes the entire “Container” •Native files and databases track references to apps

Samsung Smart Manager

• lowpowercontext-system-db

– Package_name

– Start_time_string

– End_time_string

Page 47: Tracking traces of deleted applications · iOS –All About the Bundle •Deletion of an app deletes the entire “Container” •Native files and databases track references to apps

Samsung Smart Manager

• lowpowercontext-system-db

Page 48: Tracking traces of deleted applications · iOS –All About the Bundle •Deletion of an app deletes the entire “Container” •Native files and databases track references to apps

User installed 3rd party apps

• CCleaner

Page 49: Tracking traces of deleted applications · iOS –All About the Bundle •Deletion of an app deletes the entire “Container” •Native files and databases track references to apps

CCleaner

• Optimize app usage

• Large user base

• Path:– /data/com.piriform.ccleaner/databases

• Databases:– cleaner_apps_db -> app

– scanner_cache.db -> appInfoCache

Page 50: Tracking traces of deleted applications · iOS –All About the Bundle •Deletion of an app deletes the entire “Container” •Native files and databases track references to apps

CCleaner

• Cleaner_apps_db

Page 51: Tracking traces of deleted applications · iOS –All About the Bundle •Deletion of an app deletes the entire “Container” •Native files and databases track references to apps

CCleaner

• Scanner_cache.db

Page 52: Tracking traces of deleted applications · iOS –All About the Bundle •Deletion of an app deletes the entire “Container” •Native files and databases track references to apps

Resources

• https://github.com/abrignoni

– DFIR SQL Query Repo

• https://www.magnetforensics.com/artifact-exchange/

Page 53: Tracking traces of deleted applications · iOS –All About the Bundle •Deletion of an app deletes the entire “Container” •Native files and databases track references to apps