【问题标题】:iphone: strace, dtruss, dtrace or equivalent?iphone:strace、dtruss、dtrace 还是同等产品?
【发布时间】:2012-02-02 08:05:11
【问题描述】:

有谁知道 iPhone 上是否有类似 stracedtrussdtrace 的东西?

tester-iPhone:/tmp root$ apt-cache search dtruss
tester-iPhone:/tmp root$ apt-cache search dtrace
tester-iPhone:/tmp root$ apt-cache search trace
tester-iPhone:/tmp root$ apt-get install strace
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Couldn't find package strace
tester-iPhone:/tmp root$ apt-get install dtrace
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Couldn't find package dtrace
tester-iPhone:/tmp root$ apt-get install ltrace
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Couldn't find package ltrace
tester-iPhone:/tmp root$ apt-get install dtruss
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Couldn't find package dtruss

【问题讨论】:

    标签: iphone jailbreak strace dtrace ltrace


    【解决方案1】:

    DTrace(因此也包括 dtruss)显然已在不久前移植到 iOS,但 Apple 尚未在他们自己的实验室之外发布它。我能找到的最佳参考是 DTrace 的一位作者的一句话:https://twitter.com/ahl/status/311866307115098112

    【讨论】:

      【解决方案2】:

      Frida 框架可能很有用,它使用 Python API 提供动态代码检测。它允许您将 JavaScript 的 sn-ps 注入 iOS(以及 Windows、Mac、Linux)上的本机应用程序。

      有一个很好的使用Frida on iOS的教程。

      还有 Saurik 的 Cycript,它允许“开发人员通过交互式控制台使用 Objective-C++ 和 JavaScript 语法的混合体来探索和修改 iOS 或 Mac OS X 上正在运行的应用程序”。

      当然还有他的Cydia Substrate 允许人们更改/注入 iOS 应用程序的行为。

      【讨论】:

      • 嗯...这很有趣。它与 DBI(动态二进制检测)有关吗?
      • 它似乎与 Pin、DynamicRIO 或 TEMU 等 DBI 工具有关,但不完全是 strace。无论如何,感谢您提供有用的信息。
      • 是的,它是一种类似 PIN 的工具,并不完全是 s/d/trace,但由于它们不可用,它似乎提供了最接近的相关功能 - 我认为可以检测功能之一有兴趣提供类似的分析。
      【解决方案3】:

      在真正的 iOS 越狱设备上,我使用了frida-trace

      frida-trace -m "+[NSUUID UUID]" -U "Debug CrackMe"    // trace UUID
      frida-trace -m "*[ComVendorDebugger* *]" -U -f com.robot.demo.app   // wildcard trace on Classes
      frida-trace -i "getaddrinfo" -i "SSLSetSessionOption" -U -f com.robot.demo.app      // trace SSL setup options on iOS
      frida-trace -m "-[NSURLRequest initWithURL:]" -U -f funky-chicken.hello-swift-4-2      // trace URLs
      

      此工具也适用于jailed 设备。参考frida-gadget

      在 iOS 模拟器上我可以dtrace 调用:

      sudo dtrace -qn 'syscall::ptrace:entry { printf("%s(%d, %d, %d, %d) from %s\n", probefunc, arg0, arg1, arg2, arg3, execname); }'
      Password: // you need sudo
      
      
      ptrace(31, 0, 0, 0) from debugger_challen
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2013-01-19
        • 1970-01-01
        • 2018-01-13
        • 2017-02-16
        • 2011-10-24
        相关资源
        最近更新 更多