简体   繁体   English

Frida - 列出 Android 进程

[英]Frida - list Android processes

This question is about the security framework, Frida.这个问题是关于安全框架 Frida 的。 On the target Android device, why can't my Frida-Server [which is loaded onto the Android device] list the running processes?在目标 Android 设备上,为什么我的 Frida-Server [已加载到 Android 设备上] 无法列出正在运行的进程?

$ frida-ps -U returns only the Frida-Server process ID and strangely, adb. $ frida-ps -U只返回 Frida-Server 进程 ID,奇怪的是,adb。

I am running Android 4.4.2 (32 bit O/S).我正在运行 Android 4.4.2(32 位操作系统)。 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.我在设备上设置了最新的 Android Frida 服务器死机。

$ 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:我可以在目标 Android 设备上列出我的应用程序的进程 ID:

$ adb shell ps | grep myapp

I killed my Frida Server on the Android device and restarted it:我在 Android 设备上杀死了我的 Frida 服务器并重新启动它:

$ kill -9 <process id>

When I try to attach directly to the process ID $ frida -U <process ID> I get a permission denied message.当我尝试直接附加到进程 ID $ frida -U <process ID>我收到一条权限被拒绝的消息。

Two clues helped me solve this.两条线索帮助我解决了这个问题。 The fact I could see我能看到的事实

  1. The adb process. adb 进程。
  2. I was getting a permission error when trying to execute $ frida -U <process ID>尝试执行$ 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.答案是使用adb shell进入目标 Android 设备并在 Frida-Server 上执行 Change Ownership (chown)。

When I installed it, the Frida-Server was installed as the owner Shell.当我安装它时,Frida-Server 被安装为所有者 Shell。 When I changed the owner to Root, all my processes listed fine on my Mac when I ran: $ frida-ps -U当我将所有者更改为 Root 时,我运行时在 Mac 上列出的所有进程都正常: $ frida-ps -U

The chown command was: chown 命令是:

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

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

It is because your frida-server has not enough permission那是因为你的 frida-server 权限不够
Make sure frida-server run as root, then you can list all processes确保 frida-server 以 root 身份运行,然后您可以列出所有进程

Try to do these:尝试做这些:
1. copy frida-server to device 1.复制frida-server到设备
2. run as root on your device, and start frida-server 2. 在您的设备上以 root 身份运行,并启动 frida-server
3. with usb connection, and run frida-ps(client frida must be same version with frida-server) 3. 用usb连接,并运行frida-ps(客户端frida必须与frida-server版本相同)

Then you can list processes然后你可以列出进程

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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