欢迎来到尧图网

客户服务 关于我们

您的位置:首页 > 健康 > 美食 > frida.exe

frida.exe

2024/10/24 1:53:14 来源:https://blog.csdn.net/weixin_74305514/article/details/141861688  浏览:    关键词:frida.exe

frida 的使用

通过frida -h显示帮助信息

Usage: frida [options] targetOptions:--version             show program's version number and exit-h, --help            show this help message and exit-D ID, --device=ID    connect to device with the given ID-U, --usb             connect to USB device-R, --remote          connect to remote frida-server-H HOST, --host=HOST  connect to remote frida-server on HOST-f FILE, --file=FILE  spawn FILE-F, --attach-frontmostattach to frontmost application-n NAME, --attach-name=NAMEattach to NAME-p PID, --attach-pid=PIDattach to PID--stdio=inherit|pipe  stdio behavior when spawning (defaults to “inherit”)--aux=option          set aux option when spawning, such as “uid=(int)42(supported types are: string, bool, int)--realm=native|emulatedrealm to attach in--runtime=qjs|v8      script runtime to use--debug               enable the Node.js compatible script debugger--squelch-crash       if enabled, will not dump crash report to console-O FILE, --options-file=FILEtext file containing additional command line options-l SCRIPT, --load=SCRIPTload SCRIPT-P PARAMETERS_JSON, --parameters=PARAMETERS_JSONparameters as JSON, same as Gadget-C CMODULE, --cmodule=CMODULEload CMODULE--toolchain=any|internal|externalCModule toolchain to use when compiling from sourcecode-c CODESHARE_URI, --codeshare=CODESHARE_URIload CODESHARE_URI-e CODE, --eval=CODE  evaluate CODE-q                    quiet mode (no prompt) and quit after -l and -e--no-pause            automatically start main thread after startup-o LOGFILE, --output=LOGFILEoutput to log file--eternalize          eternalize the script before exit--exit-on-error       exit with code 1 after encountering any exception inthe SCRIPT

常用选项

  • --version
    显示 frida 的版本号并退出。
  • -h,--help
    显示帮助信息,列出所有可用选项并退出。
  • -U, --usb
    通过 USB 连接到设备。
  • -H HOST, --host=HOST
    连接到指定 HOST 上的远程 frida-server。
  • -D ID, --device=ID:
    连接到指定 ID 的设备。
  • -f FILE, --file=FILE
    spawn模式,启动指定的文件(启动一个新的进程并挂起)。
  • -F, --attach-frontmost
    attach模式,附加到前台运行的应用程序。
  • -n NAME, --attach-name=NAME
    附加到指定名称的应用程序。
  • -p PID, --attach-pid=PID
    附加到指定进程 ID 的应用程序。
  • -l SCRIPT, --load=SCRIPT
    加载指定的脚本文件。
  • --no-pause:
    启动后自动启动主线程,通常配合-f选项使用。
  • -o LOGFILE, --output=LOGFILE:
    将输出记录到指定的日志文件中。

设备连接

通过USB连接
用一根USB数据线将手机和电脑连接起来,启动frida-server
在这里插入图片描述
这里写一段测试代码test.js

function usbTest(){Java.perform(function (){console.log("USB connected!")})
}setImmediate(function (){usbTest();
})

通过命令执行frida -UF -l test.js,可以看到输出结果,那么USB就连接成功了。

在这里插入图片描述

通过HOST连接
先通过USB连接把frida-server启动起来,在启动的时候加上-l选项来设置监听的地址,
ip地址可以通过ip addressifconfig命令来查看,frida-server的默认监听端口为27042
启动frida-server
./frida-server-14.2.18-android-arm64 -l 192.168.xx.xx:27042

在这里插入图片描述

执行命令frida -H 192.168.xx.xx:27042 -F -l test.js,可以看到输出结果,说明我们通过HOST连接成功了
在这里插入图片描述

这里有需要注意的是,通过HOST连接需要确保手机和电脑能够互相Ping通,这就需要手机和电脑在相同的网段下,电脑开着防火墙的话手机是Ping不同电脑的。

frida-server的选项

在这里插入图片描述
常用的选项

  • --version
    输出版本信息
  • -l
    设置监听地址

WiFi ADB

这里有一个好用的adb连接工具,WiFi ADB软件允许用户通过无线网络(Wi-Fi)连接和控制Android设备,而不需要使用USB线。
官网链接WiFi ADB (需要科学上网)
下载安装到手机端,就可以通过WiFi进行adb调试(需要连接同一个WiFi)。

根据提示进行操作即可
在这里插入图片描述

连接成功
在这里插入图片描述

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com