type
status
date
slug
summary
tags
category
icon
password
一、证书安装以及Android数据包抓取
- 先导出
Burpsuite
DER
格式证书,然后使用openssl
将其转为pem格式
并且输出hash值,然后将其转换为.0
格式

- 然后将证书移入手机中
- 如果是安装为用户凭据则可以直接将
pem
格式证书放入手机存储中,然后直接使用证书安装工具安装,或者直接将.0
格式文件移动至/data/misc/user/0/cacerts-added
中,并且给予644
权限(-rw-r--r--)
- 如果安装为系统凭据,则需要将
.0
格式文件移动至/system/etc/security/cacerts
目录并且给予644
权限(-rw-r--r--)
重启设备即可生效。
由于从Android 7.0版本开始,系统不再信任安装的用户证书,可能会导致无法抓取SSL/TLS加密数据包或者无网络等问题,因此需要将HttpCanary根证书添加至系统CA目录,此操作需要在Root设备上进行。部分手机可能有限制,无法修改system分区,可以用magisk模块的方式不修改system分区安装系统证书。如何使用magisk在安卓安装https ca证书 | Chara's Blog
将证书放到
fiddler_ca_cert_magisk.zip
里的/system/etc/security/cacerts/
下,可以使用7-zip直接拖进去,不需要设置文件权限。
- 然后配置手机的代理服务器,将其代理服务器IP设置为Windows抓包设备的IP(同一局域网下),端口
8080

- Burpsuite设置
Proxy Listeners
,添加监听192.168.0.106:8080
然后即可正常抓包。


二、Charles的安装与使用
- 使用Charles破解工具Charles破解工具 注册Charles
- 和Burpsuite操作过程一样,保存Chreles证书,并且使用openssl获取哈希值,然后转为.0格式,然后将其安装到系统目录,重启设备即可生效


- 配置Charles监听代理
(Proxy→SSL Proxying Settings 和Proxy→Proxy Settings )
和手机代理



- 在首次收到包时选择允许Allow

三、VPN抓包方式
在实际抓手机 App 包场景中,有很多种方案,经典的就是 Fiddler 、 Burpsuite ,但是 Fiddler 、 Burpsuite 会遇到一个问题,如果 App 为了防止中间人抓包,特意设置了不走代理这个选项,那单独直接用 Fiddler 、 Burpsuite 这些抓包工具就不能抓包的。
- 最简单的方法就是使用
HttpCanary
在手机端进行抓包
- 或者使用Postern + Charles 这个组合,是因为 Charles 没有直接监听到 App,Charles 是监听到了 Postern 上,Postern 就是一个VPN ,所以 App 设置不走代理也没用,它是通过 VPN 将所有流量转发到 Charles 的 socks 代理,再打开 Charles 的 External Proxy Server — (外部代理服务器)转发到 Burpsuite,从而实施中间人抓包
在这里使用
VProxid
替代Postern
作为VPN代理- 先导出Charles根证书,然后密码设置为
123456
,导出为p12
格式

- 在Burpsuite中导入刚刚导出的charles证书

- 在Charles中修改代理设置,取消全部
HTTP Proxy

- 然后设置转发下游代理,下面两个选项分别为 HTTP 代理和 HTTPS 代理,都要填写 Wb Proxy Server 代理地址,也就是下游的 Burp 代理地址


- 向VPN代理APP中添加设置,服务器IP为抓包Windows设备的局域网IP,端口为charles
SOCKS
设置的端口,选择需要抓包的APP

- 然后就可以开始抓包

- 如果不想使用VPN方式抓包就恢复到Charles的设置即可

如果出现小锁,可以右键对应流量,然后Enable SSL Proxying
四、Windows抓包电脑版微信小程序
- proxifier 添加 burp 代理服务器,协议类型必须是 https

- 查看微信程序名称

- 添加代理规则 可以用 * 通配符,选择之前配置好的 burp 代理服务器

- 打开公众号文章后即可在 Proxifier 中看到代理流量

- burp 成功抓包

五、iptables 转发流量配合抓包
将 Android 设备和 BurpSuite处于同一网络下,使用 root 权限将访问任何主机的 80 和 443 端口请求转发到 BurpSuite。
使用
iptables -t nat -L
查看规则,发现出口流量被转发至指定IP和端口
在
BurpSuite
中启用透明代理Porxy -> Options -> Edit -> Request handing -> Support invisible proxying(enable only if need)

如果想清空规则
六、LAMDA中间人代理抓包

启动中间人,这将会全自动的在设备上开启全局的中间人,你就可以截获应用的 http/s 流量,当然,也可以包括 DNS 请求(全局)。 它可以自动应用及撤销中间人,退出脚本后设备及网络也将恢复它原来的样子。仅需安装
Magisk-LAMDA
模块如果你需要对国际APP进行中间人,请转到 globalmitm
执行下面命令即可
参考
- 作者:LLeaves
- 链接:https://lleavesg.top//article/Android%E6%8A%93%E5%8C%85
- 声明:本文采用 CC BY-NC-SA 4.0 许可协议,转载请注明出处。
相关文章