-
Notifications
You must be signed in to change notification settings - Fork 952
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
双进程反调试案例 #44
Comments
mark. |
很奇怪,我的表现情况不一样 1|root@x86:/ # cat /proc/2746/status |
我这边TracerPid:0 |
抱歉,草率了,原来我的APP卡在了第一个界面. |
好像有人之前写过解决方法,看这个: |
感谢。不过,我认为最终极的解决方案是hook安卓framewokr层把他孵化的子进程拦截掉。使得永远也ptrace不了自己,这样frida原操作就可以继续进行。安卓孵化子进程的套路比较固定,比较好弄。 |
通杀方案: |
你怎么解决的这个问题啊 |
多进程防护 |
问题解决了吗 |
遇到一个app孵化了一个子进程,然后子进程又对父进程进行了trace。导致frida无法附加上去。
第一步:直接输入进程名发现,有两个相同的进程。(失败)
Enter the need to attach package.
: com.gome.eshopnew
It's com.gome.eshopnew that you have attached app.
Traceback (most recent call last):
File "hooker.py", line 93, in attach
online_session = rdev.attach(target)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/frida/core.py", line 26, in wrapper
return f(*args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/frida/core.py", line 156, in attach
return Session(self._impl.attach(self._pid_of(target)))
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/frida/core.py", line 180, in _pid_of
return self.get_process(target).pid
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/frida/core.py", line 26, in wrapper
return f(*args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/frida/core.py", line 110, in get_process
raise _frida.ProcessNotFoundError("ambiguous name; it matches: %s" % ", ".join(["%s (pid: %d)" % (process.name, process.pid) for process in matching]))
frida.ProcessNotFoundError: ambiguous name; it matches: com.gome.eshopnew (pid: 7661), com.gome.eshopnew (pid: 7743)
第二步:尝试通过进程号attach(失败)
Enter the need to attach package.
: 7661
It's 7661 that you have attached app.
Traceback (most recent call last):
File "hooker.py", line 91, in attach
online_session = frida.core.Session(rdev._impl.attach(pid))
frida.PermissionDeniedError: unable to access process with pid 7661 due to system restrictions; try
sudo sysctl kernel.yama.ptrace_scope=0
, or run Frida as root思考:仔细一想可能主进程已经被traceing了........
第三步:验证猜想
~/hooker/com.gome.eshopnew$ adb shell
1|oxygen: su
1|oxygen: cat /proc/7661/status
Name: m.gome.eshopnew
State: S (sleeping)
Tgid: 7661
Pid: 7661
PPid: 744
TracerPid: 7743
Uid: 10122 10122 10122 10122
Gid: 10122 10122 10122 10122
Ngid: 0
FDSize: 256
Groups: 3001 3002 3003 9997 50122
VmPeak: 2304804 kB
VmSize: 2253688 kB
TracerPid果然是非0。这种情况需要想办法把孵化的那个子进程干掉,或者找到做ptrace的那个so硬改nop重打包安装。其他暂时没想到
The text was updated successfully, but these errors were encountered: