Advance ADB Command shell:

welcome you all for the series of blogs on android penetration testing .Today we will discuss Some advance command line interface that help us to interact with android device which help a developer or a Penetration tester work make more easy. If you don’t know about adb Follow our previous blog we already discuss about adb installation & How to interact with Your android device.’

How adb help us to installation packages:

To install any packages inside your Device we will install apk file we will use command:

→ adb install <apk>

In We have connected More Then One device we will use command To install apk:

→ adb -s deviceip:5555 install Yourapkname

To remove apk from our device we will use command:

→ adb uninstall apk

-> adb -s 192.168.43.133:5555 uninstall injuredandroid.apk

How adb help us to Interact with path of your target device :

How adb help us find and connect wit device path To find app database path we will enter path by typing command:

→ cd data/data/Package/databases

First we need to enter inside shell using adb shell command then,

As above picture we are in database path of our target application we can access it through our adb shell

Now, adb help us to find share preference path here we will use command to find out inside our target application

→ /data/data/<package>/shared_prefs/

As above picture we are inside share pref path Of our target share preferences that XML file inside the app on the device storage. They carried some information .

Now, We will check for application inside our target which install by user how we can access it by adb here we will use command:

→ cd /data/app

As above picture we have find out application that install by user we can also extract packages inside all these application.

Now, How adb help us to find our encrypted application that present inside our target applicationHere we will use command:

→ cd /mnt/asec

If in our target device is there any encrypted application available we can find on mnt/asec path as above picture.

Now, How to enter on sdcard path inside our target application using adb here we will use command to enter:

→ cd mnt/sdcard

As above picture we we are in external or internal sdcard path we can enter inside all path using cd command eg: cd Android , cd Pictures

Now, How to to enter inside external sd card of your target device using adb Here we will use command to enter:

→ /mnt/sdcard/external_sd

Now, How to list directory of content we can list out all content, path to list our all the content we will use command :

ls

As above picture we have list directory contents of our target device. As above picture we have list directory contents of our target device.

Now, to check size of each file inside our target application here we will use command:

→ ls -s

As above picture we have print out all sizes of file inside our target device.

Now, To find out list subdirectories recursively here we will use command :

→ ls -R

As above picture we have list out all the sub directories that inside our application using adb shell.

How adb help us to find more information about our target device:

Here To list out tcp connectivity of our target application we are using command to print all tcp connectivity

→ adb shell netstat

if you have more then one device then use command:

→ adb -s yourip:5555 shell netstat

As above picture we have see How adb help us to find tcp connectivity inside our target application.

Now, To print out current directory of Your target device using adb command:

→ adb shell pwd

If You have more then one device then run command specify by ip:

→ adb -s 192.168.43.133:5555 shell pwd

Now, to check battery status of our target device here we will use command:

→ adb shell dumpsys battery

→ adb -s 192.168.43.133:5555 shell dumpsys battery

As above picture it print out battery status of target Phone using adb shell.

Now, To list out all Phone features of our targeted device we will use command:

→ adb -s 192.168.43.133:5555 shell pm list features

→ adb shell pm list features

As above picture we have print out all features of our targeted device .

Now, To list out all service details of our targeted device here we will use command:

→ adb shell service list

→ adb -s 192.168.43.133:5555 shell service list

As above picture we have exported all services details available inside our application.

Conclusion:

As we have discuss Android Debug Bridge (ADB) is a very powerful command-line utility we can use to interact with our target devices or emulators. It is implemented in the server-client fashion and allows you to directly operate from the system level through shell commands on handheld devices. Here we Discuss some of important useful command line interface which help us to collect all possible information and interact with Our device.

Stick with our Blog series to learn more
For more interesting topics please visit www.securiumsolutions.com/blog
Our You tube channel : https://www.youtube.com/channel/UC-PEkJHE66uWpFf9nEq1nRA
Author: Pallab Jyoti Borah, VAPT Security Analyst
ThankYou

Leave a Comment

Your email address will not be published. Required fields are marked *