简体   繁体   中英

Frida - list Android processes

This question is about the security framework, Frida. On the target Android device, why can't my Frida-Server [which is loaded onto the Android device] list the running processes?

$ frida-ps -U returns only the Frida-Server process ID and strangely, adb.

I am running Android 4.4.2 (32 bit O/S). The device is rooted.

I updated the version on my host machine (not target app):

$ sudo easy_install -U frida

I setup the very latest Android Frida server on device dies.

$ curl -O https://build.frida.re/frida/android/arm/bin/frida-server
$ adb push frida-server /data/local/tmp/
$ adb shell "chmod 755 /data/local/tmp/frida-server"
$ adb shell "/data/local/tmp/frida-server &"

I could list the process ID of my app on the target Android device:

$ adb shell ps | grep myapp

I killed my Frida Server on the Android device and restarted it:

$ kill -9 <process id>

When I try to attach directly to the process ID $ frida -U <process ID> I get a permission denied message.

Two clues helped me solve this. The fact I could see

  1. The adb process.
  2. I was getting a permission error when trying to execute $ frida -U <process ID>

The answer was to adb shell into the target Android device and do a Change Ownership (chown) on the Frida-Server.

When I installed it, the Frida-Server was installed as the owner Shell. When I changed the owner to Root, all my processes listed fine on my Mac when I ran: $ frida-ps -U

The chown command was:

/data/local/tmp # chown root frida-server

在尝试在 Android 设备上安装 Frida 服务器之前,请使用adb root

It is because your frida-server has not enough permission
Make sure frida-server run as root, then you can list all processes

Try to do these:
1. copy frida-server to device
2. run as root on your device, and start frida-server
3. with usb connection, and run frida-ps(client frida must be same version with frida-server)

Then you can list processes

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM