当前位置:网站首页>day16--The use of the packet capture tool Charles
day16--The use of the packet capture tool Charles
2022-08-10 07:41:00 【Ning Mang】
一. Web端
1. 证书的下载
默认情况下,Charles不能解析https协议的接口, 里面的请求和响应数据都是乱码格式,所以我们需要下载ssl证书,来获取里面的数据
1.1: Charles, 点击help, 选中SSL Proxying, 点击Install Charles Root Certificate
1.2: 点击"安装证书"
1.3: 点击"下一页"
1.4: 选中”将所有的证书都放入下列存储”,点击”Tour browsing”按钮
1.5: 选中”受新任的根证书颁发机构”,点击”确定”按钮
1.6 点击”下一页”按钮
1.7: 点击"完成"
1.8: 弹出"导入成功"界面
1.9: 点击”proxy”按钮,选中Proxy Settings…
1.10: 勾选允许传输http代理,接着点击”OK”按钮
1.11: 点击’proxy”按钮,选中SSL Proxyig settings..
1.12: 点击勾选运行代理,点击“add”按钮
1.13: 填写Host和Port都为*,正则表达式为匹配所有,再点击”OK”按钮
1.14: 点击”OK”按钮
1.15: 重启Charles,即可
1.16: 验证是否可以获取web端的https接口
(1) 打开Charles
(2) 打开浏览器输入数据
(3) 查看Charles
(4) 从上图所看,能获取htpps的包数据,即可对web端进行抓包
2. 断点调试
2.1 调试request
(1) 选中接口, 右击,选择breakpoints(允许本接口使用breakpionts功能)
(2) 选择 Copy URL
(3) 点击'Proxy', 选择Breakpoint Settings(断点设置)
(4) 选中Enable Breakpoints, 点击Add
(5) 粘贴URL, 将Query写入*, 选中request, 点击OK
(6) 点击OK
(7) 刷新网页, 弹出CharlesBreakpoint interface, 可编辑状态
(8) 修改请求参数, 执行操作, 查看网页
2.2 调试response
(1) 选中接口, 右击,选择breakpoints(允许本接口使用breakpionts功能)
(2) 选择 Copy URL
(3) 点击'Proxy', 选择Breakpoint Settings(断点设置)
(4) 选中Enable Breakpoints, 点击Add
(5) 粘贴URL, 将Query写入*, 选中response, 点击OK
(6) 点击OK
(7) 刷新网页, 弹出CharlesBreakpoint interface, 可编辑状态
(8) 修改响应信息, 执行操作, 查看网页
(9) 关掉breakpoint
3. Local modification redirection
3.1. 选中接口, 右击, 选择Save Response...
3.2. 选择路径, 点击保存
3.3. 修改response指向
(1) 选中需要修改response值的接口 后点击右键,选中最下面的Map Local...功能)
(2) Query中写入*, 选择.txt文件, 点击OK
3.4. 修改.txtfields in the file and save
3.5. 重新请求此接口, 此时接口返回值已经是 txtexpected value in the file了
3.6. 不用的时候,关掉maplocal.
(1) 点击Tools, 选择Map Local...
(2) 去掉对勾, 点击OK
4. 弱网测试
(1) 点击"Proxy", 选择Throttle Settings...
(2) 设置网络
5. 模拟403/404
(1) 选择某个接口, 右击, 选择Copy URL
(2) 点击Tools, 选择Block List...
(3) 设置黑名单
(4) 选择403/404
(5) 重新请求该接口
6. 屏蔽web网页的抓包信息
点击Proxy, 选择windows proxy前面去掉对勾
7. 过滤接口
(1) 点击View, 选择Focused Hosts...
(2) Focus on an interface, 最后点击OK保存
二. 模拟器(You need to ensure that you are on the same network)
1. 屏蔽web网页的抓包信息
2 Interface is allowed
(1)Proxy----> Proxy Settings...
(2) 设置port, 勾选Enale transparent HTTP proxying
3. 下载证书
3.1 Help--->SSL Proxying--->Install Charles Root Certificate on a Mobile Device or Remote Brower, Then the interface pops up
3.2 设置模拟器
(1) Set up the network manually
打开设置--->WLAN--->Left mouse click and long press--->勾选高级选项--->代理--->手动,
Fill in the hostname and port number, 点击保存
(2) 打开浏览器, 输入chls.pro/ssl, 回车键继续, 下载证书
(3) The certificate download is complete, 给它命名, 点击确定, 证书安装完成
4. Test if you can grab information from the emulator
5. 断点测试
5.1 修改request
(1) Check Test Interface, 鼠标右击, 选择Breakpoints, 选择Copy URL
(2) Proxy--->Breapoint Settings...--->勾选Enable Breakpoint --->add-->粘贴URL,将Query设置为*--->勾选request--->点击ok保存
(2) 点击OK保存
(3) 重新请求该接口, The breakpoint test interface pops up, 编辑状态
(4) 修改请求信息, 执行操作
5.2 修改response
(1) Check Test Interface, 鼠标右击, 选择Breakpoints, 选择Copy URL
(2) Proxy--->Breapoint Settings...--->勾选Enable Breakpoint --->add-->粘贴URL,将Query设置为*--->勾选response--->点击ok保存
(2) 点击OK保存
(3) 重新请求该接口, The breakpoint test interface pops up, 编辑状态
(4) 修改请求信息, 执行操作
(5) 刷新页面, 请求接口(返回值便是上一步已经修改好的值)
6. Local modification redirection
6.1 复制response内容, 保存.txt文件, 存在电脑本地
6.2 修改response指向,选中需要修改response值的接口 后点击右键,选中maplocal功能
6.3 修改.txtField values that need to be modified in the file and saved
6.4 重新请求该接口, 此时接口返回值已经是 txtexpected value in the file
6.5 .不用的时候,关掉maplocal.
Tools--->Map Local...--->Enable Map Local去掉对勾
7. 弱网测试
(1) 点击"Proxy", 选择Throttle Settings...
(2) 设置网络
边栏推荐
- WooCommerce installation and rest api usage
- 【Event Preview on August 9】Prometheus Summit
- 关于数据中心的设计方案,数据中心网络规划设计
- Go-Excelize API源码阅读(十一)—— GetActiveSheetIndex()
- .NET-7.WPF learning experience summary
- 上课笔记(7)(1)——#647. 找树根和孩子(root)
- 什么是长轮询
- Chapter 12 Other Database Tuning Strategies [2. Index and Tuning] [MySQL Advanced]
- PLSQL学习第一天
- 添加spark的相关依赖和打包插件(第六弹)
猜你喜欢
DGIOT 30 million meters set pressure reading
深入理解LTE网络的CDRX
卷积神经网络卷积层公式,卷积神经网络运算公式
COLMAP+OpenMVS realizes 3D reconstruction mesh model of objects
DGIOT supports industrial equipment rental and remote control
IDLE development wordCount program (5)
IDLE开发wordCount程序(第五弹)
C language file operation
【Rust指南】使用Cargo工具高效创建Rust项目 | 理解Rust特别的输入输出语句
VS2013-调试汇编代码-生成asm文件-结构体内存布局-函数参数压栈-调用约定
随机推荐
foreach遍历删除元素问题总结
Uni-app开发微信小程序使用本地图片做背景图
【Rust指南】使用Cargo工具高效创建Rust项目 | 理解Rust特别的输入输出语句
预测股票涨跌看什么指标,如何预测明天股票走势
.NET-7.WPF学习经验总结
pytest之parametrize参数化
人工神经网络工作原理,神经网络的工作原理
Uni applet Tencent map polygon background transparency
S0:12345:respawn:/bin/start_getty 115200 ttyS0 vt102
PLSQL学习第三天
ABAP Data Types 和XSD Type 映射关系以及XSD Type属性
CuteOneP is a PHP-based OneDrive multi-network disk mount program with member synchronization and other functions
IDLE development wordCount program (5)
Regular backup of mysql database (retain backups for nearly 7 days)
【Day10】进程管理命令
幂函数 指数函数 对数函数
CV-人脸识别-2018:ArcFace
数据库公共字段自动填充
SQL建表问题,帮我看看好吗朋友们~大家人。!
3.1-3.3 读书笔记