当前位置:网站首页>阿里P8倾情推荐,Fiddler抓包工具实战篇(一)
阿里P8倾情推荐,Fiddler抓包工具实战篇(一)
2022-06-28 03:43:00 【程序媛月下】

Fiddler简介
Fiddler是位于客户端和服务器端的HTTP代理
目前最常用的http抓包工具之一
功能非常强大,是web调试的利器
- 监控浏览器所有的HTTP/HTTPS流量
- 查看、分析请求内容细节
- 伪造客户端请求和服务器响应
- 测试网站的性能解密HTTPS的web会话
- 全局、局部断点功能
- 第三方插件
场景使用场景
- 接口调试、接口测试、线上环境调试、web性能分析
- 判断前后端bug、开发环境hosts配置、mock、弱网断网测试
B/S架构
编写程序部署到web服务器
web服务器运行在服务器上,绑定ip地址并监听某端口,接收和处理http请求
客户端通过http协议获取服务器上的网页、文档等

工作原理

HTTP
Hyper Text Transfer Protocol(超文本传输协议)
用于从万维网服务器传输超文本到本地浏览器的传送协议
HTTP协议是基于TCP的应用层协议,它不关心数据传输的细节,主要是用来规定客户端和服务端的数据传输格式,最初是用来向客户端传输HTML页面的内容。默认端口是80
http是基于请求与响应模式的、无状态的、应用层的协议

完整的HTTP协议
完整的http协议包含请求和响应两块内容

HTTP请求报文
HTTP请求报文主要由请求行、请求头部、空一行、请求正文(请求体)4部分组成

如下是fiddler某个会话的请求报文

请求方法( Request Method)
请求方法 | 备注 |
GET | 请求资源 |
POST | 提交资源 |
Head | 获取响应头 |
PUT | 替换资源 |
DELETE | 删除资源 |
OPTIONS | 允许客户端查看服务器的性能 |
TRACE | 回显服务器收到的请求,用于测试或诊断 |
URL
Uniform Resource Locator:统一资源定位符,用于描述网上的资源
格式:schema://host[:port#]/path/.../[?query-string]
scheme:协议,如http,https,ftp等
host:域名或者IP地址
port:端口
path:资源路径
query-string:发送的参数
如:https://www.baidu.com/s?wd=美美哒
请求头(Request Header)
请求头 | 描述 |
Host | 主机ip地址或域名 |
User-Agent | 客户端相关信息,如果操作系统、浏览器等信息 |
Accept | 指定客户端接收信息类型,如:image/jpg,text/html,application/json |
Accept-Charset | 客户端接受的字符集,如gb2312、iso-8859-1 |
Accept-Encoding | 可接受的内容编码,如gzip |
Accept-Language | 接受的语言,如Accept-Language:zh-cn |
Authorization | 客户端提供给服务端,进行权限认证的信息 |
Cookie | 携带的cookie信息 |
Referer | 当前文档的URL,即从哪个链接过来的 |
Content-Type | 请求体内容类型,如Content-Type: application/x-www-form-urlencoded |
Content-Length | 数据长度 |
Cache-Control | 缓存机制,如Cache-Control:no-cache |
Pragma | 防止页面被缓存,和Cache-Control:no-cache作用一样 |
HTTP响应报文
HTTP响应报文主要由状态行、消息报头、空一行、响应正文4部分组成

如下是fiddler某个会话的响应报文

状态码(Status Code)
用以表示网页服务器HTTP响应状态的3位数字代码
状态码 | 描述 |
1XX | 提示信息,请求被成功接收 |
2XX | 成功,请求被成功处理 200 |
3XX | 重定向相关 304 |
4XX | 客户端错误 404 |
5XX | 服务器端错误 500 |
响应头(Response Header)
响应头 | 描述 |
Server | HTTP服务器的软件信息 |
Date | 响应报文的时间 |
Expires | 指定缓存过期时间 |
Set-Cookie | 设置Cookie |
Last-Modified | 资源最后修改时间 |
Content-Type | 响应的类型和字符集,如:Content-Type: text/html; charset=utf-8 |
Content-Length | 内容长度 |
Connection | 如Keep-Alive,表示保持tcp连接不关闭,不会永久保持连接,服务器可设置 |
Location | 指明重定向的位置,新的URL地址,如304的情况 |
GET请求
格式http://host:port/path?xx=aa&yy=bb
如:http://120.78.128.25/futureloan/mvc/api/member/register?mobilephone=13555555528&pwd=萌萌哒
说明:
- http/https:协议类型
- host:服务器主机ip地址或域名
- port:端口号,如果是80可以省略,其它端口必须指明
- path:访问资源的路径
- ?:分隔符,用于区别path和参数
- xx=aa、yy=bb:请求参数列表
- &:多个参数的连接符号
未完待续,催更请点赞
边栏推荐
- 歐洲家具EN 597-1 跟EN 597-2兩個阻燃標准一樣嗎?
- Visualization of loss using tensorboard
- 窗帘做EN 1101易燃性测试过程是怎么样的?
- 机器学习入门笔记
- What is the level 3 password complexity of ISO? How often is it replaced?
- What is the process of en 1101 flammability test for curtains?
- 品达通用权限系统(Day 5~Day 6)
- Arrangement of basic electrical knowledge (II)
- 简单工厂模式
- [small program practice series] e-commerce platform source code and function implementation
猜你喜欢

first. Net core MVC project

多项目设计开发·类库项目引入入门

Notes to friendship chain

Detailed explanation of iptables firewall rules and firewalld firewall rules

Open the field of maker education and creation

Pychart shares third-party modules among different projects

MSc 307 (88) (2010 FTPC code) Part 2 smoke and toxicity test

Staggered and permutation combination formula

欧洲家具EN 597-1 跟EN 597-2两个阻燃标准一样吗?
![[small program practice series] e-commerce platform source code and function implementation](/img/a4/581d73c2ff5c190edc3d8438fa2122.png)
[small program practice series] e-commerce platform source code and function implementation
随机推荐
窗帘做EN 1101易燃性测试过程是怎么样的?
歐洲家具EN 597-1 跟EN 597-2兩個阻燃標准一樣嗎?
A summary of my recent situation in June 2022
Backtracking maze problem
Meichuang data security management platform has obtained the evaluation certificate of "data security product capability verification plan" of the Institute
English notes - cause and effect
English语法_形容词/副词3级-比较级_常用短语
11_刻意练习精讲
由两个栈组成的队列
leetcode - 329. Longest increasing path in matrix
In the era of video explosion, who is supporting the high-speed operation of video ecological network?
黑體輻射初探
Zipkin 服务链路追踪
MSc 307 (88) (2010 FTPC code) Part 2 smoke and toxicity test
Open the field of maker education and creation
光伏板怎么申请ASTM E108阻燃测试?
抖音实战~关注博主
指针链表
Understanding and learning of parental delegation mechanism
A preliminary study of blackbody radiation