LogoLogo
  • About Me
  • Notes
    • Android Pentesting
      • First Android App
      • ADB
      • The INTERNET Permission
      • Installing Certificate in User Store
      • Installing system certificates
      • Install system certificates on android 14
      • apktool (for patching and decompiling)
      • Advanced Network interception using VPN
      • DNS Spoofing and Transparent Proxy
      • HTTP Mock
      • APK
      • Static analysis
        • Getting APK from a Device
      • Case Study: A Weather App
      • Frida & Objection
      • Frida Scripts
        • Tracing Activities
        • Tracing Fragments
      • Frida Trace
      • SSL Validation Bypasses
Powered by GitBook
On this page

Was this helpful?

  1. Notes
  2. Android Pentesting

ADB

adb push (To transfer files between your computer and the device)
adb push <local_file_on_computer> <target_path_on_device>
  • Example:-

adb push Desktop/test.png /sdcard/Downloads/
adb pull (To transfer files between device and your computer)
adb pull <file_path_on_device> [<optional_target path_on_the_computer>]
  • Example:-

adb pull /sdcard/Downloads
adb install (To install an apk to the device form your computer)
adb install <path to .apk>
All about a package (application)
  • To list installed packages

adb shell pm list packages
  • To list installed 3rd party packages

adb shell pm list packages -3
  • Clear the application data without removing the actual application

adb shell pm clear <package_name>
  • List activities and permissions of a package

adb shell dumpsys package <package_name>
  • Start a specific activity of a specific package

adb shell am start <package_name>/.<activity_name>
  • To pass some extra string with activity

adb shell am start -n <package_name>/.<activity_name> -e <extra thing here>
  • Uninstall specified package

adb uninstall <package_name>
  • To set some permission to app (modify app operation to allow it to do something)

adb shell appops set <package_name> <PERM_NAME> allow
adb logcat (to view the ongoing logs)
  • To view log in another format

adb logcat -v <log_format>
<log_format>
Description

brief

Show priority, tag, and PID of the process issuing the message.

long

Show all metadata fields and separate messages with blank lines.

process

Show PID only.

raw

Show the raw log message with no other metadata fields.

tag

Show the priority and tag only.

thread

Show priority, PID, and TID of the thread issuing the message.

threadtime

Show the date, invocation time, priority, tag, PID, and TID of the thread issuing the message. (This is the default)

time

Show the date, invocation time, priority, tag, and PID of the process issuing the message.

  • Log filtering

adb logcat "MainActivity:V *:S"
  • MainActivity:V ensures that logs from the tag MainActivity with a severity of Verbose and above are logged.

  • *:S Ensures that all other Tags are ignored (as nothing will log with log-level Silent or above)

⇒ Logging level

  • V Verbose

  • D Debug

  • I Info

  • W Warning

  • E Error

  • F Fatal

  • S Silent

Packet logging with tcpdump
emulator -tcpdump packets.cap -avd Emulator_API_34
  • packets.cap name of the file where traffic will be captured

  • Emulator_API_34 name of the emulator which is to be turned on (AvdId)

    • AvdId can be found in more in the emulator

  • To install app with split configs

adb install-multiple <all apks with split parts>

PreviousFirst Android AppNextThe INTERNET Permission

Last updated 2 days ago

Was this helpful?