Triaging modern Android devices (aka android_triage bash script)
When dealing with mobile devices, you need to follow a procedure that includes various stages from identification to reporting. One of the key-point in this process is the acquisition, where we extract a copy of the data stored in the mobile device.
While evaluating your acquisition method, you should always consider the old but gold rule of the order of volatility (RFC 3227 - "When collecting evidence you should proceed from the volatile to the less volatile").
These extraction methods often rely on vulnerabilities and exploits (either at the hardware or the software level) developed to overcome device security. We use various tools and techniques and sometimes also a physical approach.
In some cases, especially for recent chipsets or operating system versions, there's no public solution to obtain a physical or a full file system dump. In those cases, we have to rely on (and we are limited to) communication options provided by the device.
On Android devices, in particular, we mostly rely on:
- ADB (Android Debug Bridge)
- MTP (Media Transfer Protocol)
- Manufacturer backup tools like Samsung SmartSwitch and Huawei HiSuite
On the ADB side, most of the commercial tools use four methods:
- ADB Backup: the tool executes the "adb backup" command, with some possible variations among the different tools. This typically doesn't include native and third-party apps data: every single app can specify in the AndroidManifest file (android:allowBackup parameter) if its data should be included or not in an ADB backup. An Android Backup typically includes the sdcard (emulated storage) content and some native databases
- Agent: the tool installs an agent (basically, an APK file) that requests permissions to read native application data, in particular Contacts, Call Log, and SMS/MMS. After GDPR, Google changed its permissions policy and introduced a restriction in reading call log and SMS only to the default handler: this required some changes in the flow used by most forensics tools
- ADB Screenshot: the tool leverages the ADB feature that allows taking a screenshot of the device. In this way, also third-party apps can be "screenshotted" and then processed in the tool, by using some image analysis techniques, to parse the content and make it readable and searchable
- APK Downgrade: the tool uninstalls the actual version of a third-party package (app) by preserving user data, and installs a previous version of the same package where the android:allowBackup parameter is set to "true". The tool creates an ADB Backup that includes the specific app and then reinstalls the actual app version.
- This script is only for testing purposes
- It requires an unlocked device (not protected with a passcode or with known passcode)
- ADB must be active on the device and the device must be paired with the host
- The script doesn't install or uninstall any APK and so it's not able to extract, for example, Call Logs, SMS messages, Third-party apps data, and so on
Option 1 - Collect Basic Information
- adb shell getprop
- adb shell settings list system
- adb shell settings list secure
- adb shell settings list global
- Device Manufacturer (adb shell getprop ro.product.manufacturer)
- Device Product (adb shell getprop ro.product.model)
- Android ID (adb shell settings get secure android_id)
- Android Serial Number (adb shell getprop ril.serialnumber)
- Product Code (adb shell getprop ro.product.code)
- Product Device (adb shell getprop ro.product.device)
- Product Name (adb shell getprop ro.product.name)
- Chipname (adb shell getprop ro.chipname)
- Android Version (adb shell getprop ro.build.version.release)
- Android Fingerprint (adb shell getprop ro.build.fingerprint)
- Build date (adb shell getprop ro.build.date)
- Build ID (adb shell ro.build.id)
- Bootloader Version (adb shell ro.boot.bootloader)
- Security Patch (adb shell ro.build.version.security_patch)
- Bluetooth Address (adb shell settings get secure bluetooth_address)
- Bluetooth Name (adb shell settings get secure bluetooth_name)
- Timezone (adb shell getprop persist.sys.timezone)
- USB Configuration (adb shell getprop persist.sys.usb.config)
- Storage Size (adb shell getprop storage.mmc.size)
- Notification Sound (adb shell getprop ro.config.notification_sound)
- Alerm Alert (adb shell getprop ro.config.alarm_alert)
- Ringtone (adb shell getprop ro.config.ringtone)
- Media Sound (adb shell getprop rro.config.media_sound)
- Device Time (adb shell date)
- adb shell id
- adb shell uname -a
- adb shell cat /proc/version
- adb shell uptime
- adb shell printenv
- adb shell cat /proc/partitions
- adb shell cat /proc/cpuinfo
- adb shell cat /proc/diskstats
- adb shell df
- adb shell df -ah
- adb shell mount
- adb shell ip address show wlan0
- adb shell ifconfig -a
- adb shell netstat -an
- adb shell lsof
- adb shell ps -ef
- adb shell top -n 1
- adb shell cat /proc/sched_debug
- adb shell vmstat
- adb shell sysctl -a
- adb shell ime list
- adb shell service list
- adb shell logcat -S -b all
- adb shell logcat -d -b all V:*
- adb shell pm get-max-users
- adb shell pm list users
- adb shell pm list features
- adb shell pm list instrumentation
- adb shell pm list libraries -f
- adb shell pm list packages -f
- adb shell pm list packages -f -u
- adb shell pm list permissions -f
- adb shell cat /data/system/uiderrors.txt
Option 4 - Execute Bugreport and Dumpsys
- adb bugreport
- adb shell dumpsys
- adb shell dumpsys account
- adb shell dumpsys activity
- adb shell dumpsys alarm
- adb shell dumpsys appops
- adb shell dumpsys audio
- adb shell dumpsys autofill
- adb shell dumpsys backup
- adb shell dumpsys battery
- adb shell dumpsys batteryproperties
- adb shell dumpsys batterystats
- adb shell dumpsys bluetooth_manager
- adb shell dumpsys carrier_config
- adb shell dumpsys clipboard
- adb shell dumpsys connectivity
- adb shell dumpsys content
- adb shell dumpsys cpuinfo
- adb shell dumpsys dbinfo
- adb shell dumpsys device_policy
- adb shell dumpsys devicestoragemonitor
- adb shell dumpsys diskstats
- adb shell dumpsys display
- adb shell dumpsys dropbox
- adb shell dumpsys gfxinfo
- adb shell dumpsys iphonesubinfo
- adb shell dumpsys jobscheduler
- adb shell dumpsys location
- adb shell dumpsys meminfo -a
- adb shell dumpsys mount
- adb shell dumpsys netpolicy
- adb shell dumpsys netstats
- adb shell dumpsys network_management
- adb shell dumpsys network_score
- adb shell dumpsys notification
- adb shell dumpsys package
- adb shell dumpsys password_policy
- adb shell dumpsys permission
- adb shell dumpsys phone
- adb shell dumpsys power
- adb shell dumpsys procstats --full-details
- adb shell dumpsys restriction_policy
- adb shell dumpsys sdhms
- adb shell dumpsys sec_location
- adb shell dumpsys secims
- adb shell dumpsys search
- adb shell dumpsys sensorservice
- adb shell dumpsys settings
- adb shell dumpsys shortcut
- adb shell dumpsys stats
- adb shell dumpsys statusbar
- adb shell dumpsys storaged
- adb shell dumpsys telecom
- adb shell dumpsys usagestats
- adb shell dumpsys user
- adb shell dumpsys usb
- adb shell dumpsys vibrator
- adb shell dumpsys wallpaper
- adb shell dumpsys wifi
- adb shell dumpsys window
- adb pull /system/
- adb pull /system/app
- adb pull /system/camerdata
- adb pull /system/container
- adb pull /system/etc
- adb pull /system/fake-libs
- adb pull /system/fonts
- adb pull /system/framework
- adb pull /system/hidden
- adb pull /system/lib
- adb pull /system/lib64
- adb pull /system/media
- adb pull /system/priv-app
- adb pull /system/saiv
- adb pull /system/tts
- adb pull /system/usr
- adb pull /system/vendor
- adb pull /system/xbin
- adb pull /scard
- adb shell content query --uri content://com.android.calendar/calendar_entities
- adb shell content query --uri content://com.android.calendar/calendars
- adb shell content query --uri content://com.android.calendar/attendees
- adb shell content query --uri content://com.android.calendar/event_entities
- adb shell content query --uri content://com.android.calendar/events
- adb shell content query --uri content://com.android.calendar/properties
- adb shell content query --uri content://com.android.calendar/reminders
- adb shell content query --uri content://com.android.calendar/calendar_alerts
- adb shell content query --uri content://com.android.calendar/colors
- adb shell content query --uri content://com.android.calendar/extendedproperties
- adb shell content query --uri content://com.android.calendar/syncstate
- adb shell content query --uri content://com.android.contacts/raw_contacts
- adb shell content query --uri content://com.android.contacts/directories
- adb shell content query --uri content://com.android.contacts/syncstate
- adb shell content query --uri content://com.android.contacts/profile/syncstate
- adb shell content query --uri content://com.android.contacts/contacts
- adb shell content query --uri content://com.android.contacts/profile/raw_contacts
- adb shell content query --uri content://com.android.contacts/profile
- adb shell content query --uri content://com.android.contacts/profile/as_vcard
- adb shell content query --uri content://com.android.contacts/stream_items
- adb shell content query --uri content://com.android.contacts/stream_items/photo
- adb shell content query --uri content://com.android.contacts/stream_items_limit
- adb shell content query --uri content://com.android.contacts/data
- adb shell content query --uri content://com.android.contacts/raw_contact_entities
- adb shell content query --uri content://com.android.contacts/profile/raw_contact_entities
- adb shell content query --uri content://com.android.contacts/status_updates
- adb shell content query --uri content://com.android.contacts/data/phones
- adb shell content query --uri content://com.android.contacts/data/phones/filter
- adb shell content query --uri content://com.android.contacts/data/emails/lookup
- adb shell content query --uri content://com.android.contacts/data/emails/filter
- adb shell content query --uri content://com.android.contacts/data/emails
- adb shell content query --uri content://com.android.contacts/data/postals
- adb shell content query --uri content://com.android.contacts/groups
- adb shell content query --uri content://com.android.contacts/groups_summary
- adb shell content query --uri content://com.android.contacts/aggregation_exceptions
- adb shell content query --uri content://com.android.contacts/settings
- adb shell content query --uri content://com.android.contacts/provider_status
- adb shell content query --uri content://com.android.contacts/photo_dimensions
- adb shell content query --uri content://com.android.contacts/deleted_contacts
- adb shell content query --uri content://downloads/my_downloads
- adb shell content query --uri content://downloads/download
- adb shell content query --uri content://media/external/file
- adb shell content query --uri content://media/external/images/media
- adb shell content query --uri content://media/external/images/thumbnails
- adb shell content query --uri content://media/external/audio/media
- adb shell content query --uri content://media/external/audio/genres
- adb shell content query --uri content://media/external/audio/playlists
- adb shell content query --uri content://media/external/audio/artists
- adb shell content query --uri content://media/external/audio/albums
- adb shell content query --uri content://media/external/video/media
- adb shell content query --uri content://media/external/video/thumbnails
- adb shell content query --uri content://media/internal/file
- adb shell content query --uri content://media/internal/images/media
- adb shell content query --uri content://media/internal/images/thumbnails
- adb shell content query --uri content://media/internal/audio/media
- adb shell content query --uri content://media/internal/audio/genres
- adb shell content query --uri content://media/internal/audio/playlists
- adb shell content query --uri content://media/internal/audio/artists
- adb shell content query --uri content://media/internal/audio/albums
- adb shell content query --uri content://media/internal/video/media
- adb shell content query --uri content://media/internal/video/thumbnails
- adb shell content query --uri content://settings/system
- adb shell content query --uri content://settings/system/ringtone
- adb shell content query --uri content://settings/system/alarm_alert
- adb shell content query --uri content://settings/system/notification_sound
- adb shell content query --uri content://settings/secure
- adb shell content query --uri content://settings/global
- adb shell content query --uri content://settings/bookmarks
- adb shell content query --uri content://com.google.settings/partner
- adb shell content query --uri content://nwkinfo/nwkinfo/carriers
- adb shell content query --uri content://com.android.settings.personalvibration.PersonalVibrationProvider/
- adb shell content query --uri content://settings/system/bluetooth_devices
- adb shell content query --uri content://settings/system/powersavings_appsettings
- adb shell content query --uri content://user_dictionary/words
- adb shell content query --uri content://browser/bookmarks
- adb shell content query --uri content://browser/searches
- adb shell content query --uri content://com.android.browser
- adb shell content query --uri content://com.android.browser/accounts
- adb shell content query --uri content://com.android.browser/accounts/account_name
- adb shell content query --uri content://com.android.browser/accounts/account_type
- adb shell content query --uri content://com.android.browser/accounts/sourceid
- adb shell content query --uri content://com.android.browser/settings
- adb shell content query --uri content://com.android.browser/syncstate
- adb shell content query --uri content://com.android.browser/images
- adb shell content query --uri content://com.android.browser/image_mappings
- adb shell content query --uri content://com.android.browser/bookmarks
- adb shell content query --uri content://com.android.browser/bookmarks/folder
- adb shell content query --uri content://com.android.browser/history
- adb shell content query --uri content://com.android.browser/bookmarks/search_suggest_query
- adb shell content query --uri content://com.android.browser/searches
- adb shell content query --uri content://com.android.browser/combined
Comments
Post a Comment