抓包就是将网络传输发送与接收的数据包进行截获、重发、编辑、转存等操作,常用来检验前后端传输数据的情况,常用的抓包工具有Fiddler、Charles、wireshark,不过接下来我要分享是另一个非常易上手的抓包工具----whistle。
1、前提
安装whistle之前需先安装node,因为whistle是使用node写的。
2、安装
--使用npm安装whistle
npm install -g whistle
--指定淘宝镜像安装cnpm,也可以使用cnpm安装whistle
npm install cnpm -g --registry=https://registry.npm.taobao.org
cnpm install -g whistle
3、启动
--不设置端口默认使用8899
w2 start
--指定端口8888
w2 start -p 8888
4、访问
--在浏览器访问127.0.0.1:8899
http://127.0.0.1:8899/#network
5、其它操作
--停止
w2 stop
--重启
w2 restart
1、下载证书
点击菜单栏HTTPS > Downloand RootCA,注:需勾选Enable HTTP/2。
2、安装证书
在Chrome安装受信任证书 > 管理证书 > 受信任的根证书颁发机构 > 导入 > 选择rootCA.crt,一路确定。
3、win10设置代理
win左下角搜索代理,代理 > 地址:127.0.0.1或者本机IPv4,端口:8899
4、验证
1、过滤请求
在Settings勾选Include Filter,在里面填写需过滤的域名(注:一个域名一行)
2、Rules
--1、重定向
https://www.baidu.com redirect://https://www.qq.com/
--2、修改请求方法和请求体
Rules:https://www.baidu.com method://post
Rules:https://www.baidu.com reqBody://{reqBody_demo}
Values:reqBodey_demo 我是修改后的请求体呀
--3、修改返回体
Rules:https://www.baidu.com file://{respBody_demo.json}
Values:respBody_demo.json{"demo":"我是修改后的返回体啊"}
--4、修改响应码https://www.baidu.com statusCode://404
--5、延迟响应https://www.baidu.com resDelay://5000
本篇简单描述了从whistle的安装到基本操作,更多whistle教程可查看官网进行解锁:https://wproxy.org/whistle/。
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有