README.md 5.3 KB

lib

  1. tcpdump
  2. frida
  3. mumu模拟器
  4. [adb命令]
  5. objection

install

  1. node:

        node install -g frida
    
  2. python3:

        pip install frida-tools
        pip install objection
    

adb

ADB A ndroid D ebug B ridge 安卓调试桥
adb devices ( ★ ) list all connected devices 罗列所有已连接的设备
(检查电脑上连接的 Android 设备)
adb kill-server 停止 ADB 服务
adb start-server 开启 ADB 服务
adb connect( ★ ) 连接 Android 设备
adb disconnect 断开已连接的 Android 设备
adb shell ( ★ ) 进入 Android 的 Linux 交互环境
adb remount 重新挂载获得文件系统的读写权限,需要有 root 权限
adb pull( ★ ) 从 Android 系统中获取文件 adb pull []
adb push( ★ ) 将文件推送到 Android 系统中 adb push adb version 查看当前 adb 版本
adb install ( ★ ) 安装 apk 文件到 Android 系统
adb uninstall 卸载 apk 文件
- adb devices ( ★ ) list all connected devices 罗列所有已连接的设备
(检查电脑上连接的 Android 设备)
- adb kill-server 停止 ADB 服务
- adb start-server 开启 ADB 服务
- adb connect( ★ ) 连接 Android 设备
- adb disconnect 断开已连接的 Android 设备
- adb shell ( ★ ) 进入 Android 的 Linux 交互环境
- adb remount 重新挂载获得文件系统的读写权限,需要有 root 权
限
- adb pull( ★ ) 从 Android 系统中获取文件 adb pull
<remote> [<local>]
- adb push( ★ ) 将文件推送到 Android 系统中 adb push
<local> <remote>
- adb version 查看当前 adb 版本
- adb install ( ★ ) <file> 安装 apk 文件到 Android 系统
- adb uninstall <packageName> 卸载 apk 文件

objection

#启动命令
objection -g 包名 explore     					# 注入进程,如果objection没有找到进程,会以spwan方式启动进程
objection -N -h IP地址 -p 端口号 -g 包名 explore    # 指定ip和端口的连接
 
# spawn启动前就Hook某个类
objection -N -h 192.168.1.3 -p 9999 -g 包名 explore --startup-command "android hooking watch class '包名.类名'"
 
# spawn启动前就Hook某个方法打印参数、返回值、函数调用栈
objection -N -h 192.168.1.3 -p 9999 -g 包名 explore --startup-command "android hooking watch class_method '包名.类名.方法' --dump-args --dump-return --dump-backtrace"

# Memory 指令
memory list modules										#枚举当前进程模块
memory list exports [lib_name]							#查看指定模块的导出函数
memory list exports libart.so --json /root/libart.json	#将结果保存到json文件中
memory search --string --offsets-only					#搜索内存
    
# activity 和 service 操作
android hooking list activities					#枚举activity
android intent launch_activity [activity_class]	#启动activity
android hooking list services					#枚举services
android intent launch_service [services_class]	#启动services

# android heap 指令
android heap search instances com.xx.xx.class	#堆内存中搜索指定类的实例, 可以获取该类的实例id
android heap execute [ins_id] [func_name]		#直接调用指定实例下的方法
android heap evaluate [ins_id]					#自定义frida脚本, 执行实例的方法

# android 指令
android root disable				#尝试关闭app的root检测
android root simulate				#尝试模拟root环境
android ui screenshot [image.png]	#截图
android ui FLAG_SECURE false		#设置FLAG_SECURE权限

# 内存漫游
android hooking list classes					#列出内存中所有的类[search_name]	#在内存中所有已加载的类中搜索包含特定关键词的类
android hooking search methods [search_name]	#在内存中所有已加载的方法中搜索包含特定关键词的方法
android hooking generate simple [class_name]	#直接生成hook代码

# hook方法
android hooking watch class com.xxx.xxx			#hook指定类, 会打印该类下的所有调用
# hook指定方法, 如果有重载会hook所有重载,打印详细信息通过下面参数:
# --dump-args : 打印参数
# --dump-backtrace : 打印调用栈
# --dump-return : 打印返回值
android hooking watch class_method com.xxx.xxx.methodName --dump-args --dump-backtrace --dump-return
android hooking set return_value com.xxx.xxx.methodName false	#设置返回值(只支持bool类型)

# 任务管理器
jobs list			#查看任务列表
jobs kill [task_id]	#关闭任务

# 抓包
android sslpinning disable	#关闭ssl校验

# 执行命令行
android shell_exec [command]

exp:

  1. adb connect 127.0.0.1:16384
  2. adb devices -l
  3. adb push ./frida-server /data/local/tmp/
  4. adb push ./tcpdump /data/local/tmp/
  5. adb shell "/data/local/tmp/frida-server &"
  6. adb shell "/data/local/tmp/tcpdump -i any -s 0 -w /data/local/tmp/capture.pcap &"
  7. adb forward tcp:27043 tcp:27043
  8. adb forward tcp:27042 tcp:27042
  9. frida-ps -U
  10. frida -U -f com.nursinghome.monitor -l ./sslkeyfilelog.js
  11. 复制打印出来的日志并保存
  12. adb pull /data/local/tmp/capture.pcap D:\platform-tools-adb
  13. 用wireshark打开pcap,选项tls中导入刚才保存的日志
  14. adb shell pm list packages

notice

  1. 老版本frida 跑脚本使用包名(frida -U -f app包名 -l **.js),新版本使用app名称即可(frida -U app名称 -l **.js)