HTTP requests and responses are sent in plaintext, which means that anyone can read them.

HTTP方式的请求和响应都是在明文下传输的,这就意味着任何人都可以读取它们的内容。

HTTP与HTTPS比较,不同之处有哪些? HTTP vs. HTTPS: What are the differences?

HTTPS is HTTP with encryption. The only difference between the two protocols is that HTTPS uses TLS (SSL) to encrypt normal HTTP requests and responses. As a result, HTTPS is far more secure than HTTP. A website that uses HTTP has http:// in its URL, while a website that uses HTTPS has https://.

HTTPS方式是HTTP的方式上加上加密,唯一的区别就是HTTPS方式使用SSL/TLS对正常的HTTP请求和响应进行了加密。结果就是,HTTPS方式比HTTP更安全。使用HTTP方式访问的网站的URL前缀是http://,而相对的HTTPS的则是以https://开头。

What is HTTP?

HTTP stands for Hypertext Transfer Protocol, and it is a protocol – or a prescribed order and syntax for presenting information – used for transferring data over a network. Most information that is sent over the Internet, including website content and API calls, uses the HTTP protocol. There are two main kinds of HTTP messages: requests and responses.

HTTP意为超文本传输协议,它是一个用于在网络上传输数据的协议,或一个根据预定顺序的一种语法,为的是传输展示信息的。大多数在网络上的数据是以HTTP方式传输,包括网站内容和API调用。HTTP有两种消息,请求和响应。

In the OSI model, HTTP is a layer 7 protocol.

在OSI模型中,HTTP拥有7层。

什么是HTTP请求?什么是HTTP响应? What is an HTTP request? What is an HTTP response?

HTTP requests are generated by a user's browser as the user interacts with web properties. For example, if a user clicks on a hyperlink, the browser will send a series of "HTTP GET" requests for the content that appears on that page. If someone Googles "What is HTTP?" and this article shows up in the search results, when they click on the link, their browser will create and send a series of HTTP requests in order to get the information necessary to render the page.

HTTP请求是用户在于网络资源交互时通过用户的浏览器产生的,例如,如果用户点击了一个超链接,浏览器将会发过一系列HTTP的GET请求来请求将要在页面上展示的内容。如果用户使用Google搜索了”What is HTTP?",在结果页面有一个文章,当用户再点击这篇文章时,浏览器会创建并发送一系列的HTTP请求,为的是获取足够的信息来展示解析这个页面。

These HTTP requests all go to either an origin server or a proxy caching server, and that server will generate an HTTP response. HTTP responses are answers to HTTP requests.

这些HTTP请求要么指向资源的源服务器要么是代理缓存服务器,这些服务器会生成对应的HTTP响应。HTTP响应就是为了回复HTTP请求的。

一个典型的HTTP请求长什么样? What does a typical HTTP request look like?

An HTTP request is just a series of lines of text that follow the HTTP protocol. A GET request might look like this:

HTTP请求就是一系列的遵守HTTP协议的文本行,一个GET请求示例如下:


GET /hello.txt HTTP/1.1
User-Agent: curl/7.63.0 libcurl/7.63.0 OpenSSL/1.1.l zlib/1.2.11
Host: www.example.com
Accept-Language: en

This section of text, generated by the user's browser, gets sent across the Internet. The problem is, it's sent just like this, in plaintext that anyone monitoring the connection can read. (Those who are unfamiliar with the HTTP protocol may find this text hard to understand, but anyone with a baseline knowledge of the protocol's commands and syntax can read it easily.)

上面的文本是被用户的浏览器生成的,可以通过网络发送出去。这问题就是,它就是这样以明文的形式发送出去,任何监测了连接的人都可以读取内容。(不熟悉HTTP协议的人可能会认为这些上述内容不好理解,但是任何有一些有关协议命令语法知识的人,都可以轻松的读取)

This is especially an issue when users submit sensitive data via a website or a web application. This could be a password, a credit card number, or any other data entered into a form, and in HTTP all this data is sent in plaintext for anyone to read. (When a user submits a form, the browser translates this into an HTTP POST request instead of an HTTP GET request.)

当用于通过网站或相关应用提交敏感数据时,这就是一个严重的问题了。这些敏感数据可能是一个密码,一个信用卡号,或者在表单中输入的数据,在用HTTP方式访问网站时,这些数据全部以明文方式传输,任何人都可以读取到。(当用户提交一个表单,浏览器使用HTTP的POST方法,而不是GET方法。)

When an origin server receives an HTTP request, it sends an HTTP response, which is similar:

当一个服务器收到HTTP请求后,它会回复一个HTTP响应,示例如下:


HTTP/1.1 200 OK
Date: Wed, 30 Jan 2019 12:14:39 GMT
Server: Apache
Last-Modified: Mon, 28 Jan 2019 11:17:01 GMT
Accept-Ranges: bytes
Content-Length: 12
Vary: Accept-Encoding
Content-Type: text/plainHello World!

If a website uses HTTP instead of HTTPS, all requests and responses can be read by anyone who is monitoring the session. Essentially, a malicious actor can just read the text in the request or the response and know exactly what information someone is asking for, sending, or receiving.

如果一个网站使用HTTP而非HTTPS,那么所有的请求和响应,只要有人在监测连接,都能读取到这些内容。本质上来讲,任何一个有恶意的人都能从请求和响应中读到并晓得其他人在查询什么,发送什么和接收什么。

HTTPS是什么? What is HTTPS?

The S in HTTPS stands for "secure." HTTPS uses TLS (or SSL) to encrypt HTTP requests and responses, so in the example above, instead of the text, an attacker would see a bunch of seemingly random characters.

HTTPS中的S代表的是安全,HTTPS方式使用SSL/TLS去加密HTTP中的请求和响应数据,所以,在上面的例子中,攻击者会看到一堆看似随机的字符而不是明文。

Instead of: HTTPS使用的不是下面这种


GET /hello.txt HTTP/1.1
User-Agent: curl/7.63.0 libcurl/7.63.0 OpenSSL/1.1.l zlib/1.2.11
Host: www.example.com
Accept-Language: en

The attacker sees something like: 攻击者看到的东西是下面这样

8Fw6T8UV81pQfyhDkhebbz7+oiwldr1j2gHBB3L3RFTRsQCpaSnSBZ78Vme+DpDVJPvZdZUZHpzbbcqmSW1+3xXGsERHg9YDmpYk0VVDiRvw1H5miNieJeJ/FNUjgH0BmVRWII6+T4MnDwmCMZUI/orxP3HGwYCSIvyzS3MpmmSe4iaWKCOHQ==

HTTPS请求中,TLS/SSL是如何加密HTTP请求和响应的? In HTTPS, how does TLS/SSL encrypt HTTP requests and responses?

TLS uses a technology called public key encryption: there are two keys, a public key and a private key, and the public key is shared with client devices via the server's SSL certificate. When a client opens a connection with a server, the two devices use the public and private key to agree on new keys, called session keys, to encrypt further communications between them.

TLS使用了一种名为公钥加密术的加密方式,这种方式有两个密钥,就是公钥和私钥。而公钥则是随着服务器的SSL证书下发分享到客户端。当一个客户端连接到服务器时,他们使用公钥私钥来沟通之后交互使用的对称密钥,也称为会话密钥。

All HTTP requests and responses are then encrypted with these session keys, so that anyone who intercepts communications can only see a random string of characters, not the plaintext.

所有的HTTP请求与响应被会话密钥加密解密,所以再有人拦截,看到的也只会是一堆随机的字符,而不是之前的明文了。

HTTPS如何对访问的服务器进行身份验证? How does HTTPS help authenticate web servers?

Authentication means verifying that a person or machine is who they claim to be. In HTTP, there is no verification of identity – it's based on a principle of trust. The architects of HTTP didn't necessarily make a decision to implicitly trust all web servers; they simply had priorities other than security at the time. But on the modern Internet, authentication is essential.

身份验证就是验证一个人或一台机器是否是它们声明的那个身份。在HTTP请求中,完全没有这种验证机制,它更相当于基于信任的原则。HTTP的设计架构中,不是必需去显示决定要不要信任所有的网站服务器,访问通顺大于安全。但是在现代的互联网中,身份验证是必需的。

Just like an ID card confirms a person's identity, a private key confirms server identity. When a client opens a channel with an origin server (e.g. when a user navigates to a website), possession of the private key that matches with the public key in a website's SSL certificate proves that the server is actually the legitimate host of the website. This prevents or helps block a number of attacks that are possible when there is no authentication, such as:

就像身份证能证明一个人的身份那样,私钥用于确定服务器的身份。当一个客户端打开访问服务器的通道时,如使用导航栏地址栏打开一个网址,一旦网站的SSL证书的公钥和服务器拥有的私钥能够匹配时,就能证明要访问的服务器就是这个网站的合法主机,身份验证即可通过。这能防止或阻拦那种在没有身份验证机制中存在的大多数攻击,发:

  • On-path attacks 中间人攻击
  • DNS hijacking DNS劫持
  • BGP hijacking IP段支持 路由支持 等
  • Domain spoofing 域名欺诈

HTTP为什么不安全?HTTP安全漏洞 Why is HTTP not secure? HTTP Security Gaps相关推荐

  1. 袁哥写的漏洞研究方法总结

    一.前期准备,建立安全模型: 1.熟悉软件功能.功能实现,配置等: 如:IIS的虚拟目录.脚本映射: 2.根据功能,分析安全需求,建立安全模型: IIS外挂,文件类型识别,目录正确识别:目录限制: 外 ...

  2. linux内核通用提权漏洞expliot 脏牛Dirty COW

    0x01 漏洞简介 Linux内核在处理内存写时拷贝(Copy-on-Write)时存在条件竞争漏洞,导致可以破坏私有只读内存映射.一个低权限的本地用户能够利用此漏洞获取其他只读内存映射的写权限,有可 ...

  3. 我滴个乖乖,我复现了Spring的漏洞,害怕!

    我真的复现了这次 Spring 的漏洞. 昨天晚上我正在家里悄悄卷你们的时候,突然有人给我发来这样的一个链接: https://sizeof.cat/post/springcore-rce/ 然后只配 ...

  4. Spring Boot 1.5.10 发布:修复重要安全漏洞!!!

    2019独角兽企业重金招聘Python工程师标准>>> 2018/01/31,Spring Boot团队发布了Spring Boot 1.5.10. Maven: <paren ...

  5. 不安全的反序列化_CVE202027131 思科安全管理器反序列化漏洞 POC

    简介 思科安全管理器是一个企业级安全管理应用程序,可提供对思科安全和网络设备的了解和控制.Cisco Security Manager在广泛的Cisco安全设备中提供全面的安全管理(配置和事件管理), ...

  6. 适用于 ESXi 6.x 中的 OpenSLP 安全漏洞 (CVE-2019-5544) 的权宜措施 (76372)

    适用于 ESXi 6.x 中的 OpenSLP 安全漏洞 (CVE-2019-5544) 的权宜措施 (76372) https://mp.csdn.net/editor/html/114924565 ...

  7. 思科智能交换机受多个严重漏洞影响

     聚焦源代码安全,网罗国内外最新资讯! 编译:奇安信代码卫士 思科修复了 Cisco Small Business 220 Series Smart Switches 中的多个高危漏洞,它们可导致会话 ...

  8. 几个大厂及 RCE漏洞二三事

     聚焦源代码安全,网罗国内外最新资讯! 编译:奇安信代码卫士团队 这两天有几个比较重要的漏洞和资讯,统一概括一下: (1)微软修复可接管 Azure 账户的漏洞 微软最近修复了一个 OAuth 2.0 ...

  9. Kubernetes首爆严重安全漏洞,请升级你的Kubernetes

    Kubernetes最近爆出特权升级漏洞,这是Kubernetes的首个重大安全漏洞.为了修补这个严重的漏洞,Kubernetes近日推出了几个新版本. 谷歌高级工程师Jordan Liggitt在周 ...

最新文章

  1. python类型转换-Python的数据类型转换函数
  2. 建立合理的索引提高SQL Server的性能
  3. OHSUMED数据集介绍
  4. linux系统下安装 Loadrunner11(个人感觉不错儿)
  5. VS2008 解决方案配置器,即Debug,Release 模式选择
  6. JavaMVC之JSON
  7. python 串口_如何使用Python开发串口通讯上位机(一)
  8. FD.io VPP的C语言接口如何使用:FD.io VPP: How To Use The C API
  9. js当中null和{}区别
  10. Penn Treebank Tags做点小翻译 (下篇)
  11. jsp中向数据库中插入当前时间的方法精确到秒
  12. STM32 中的CEC
  13. 多核服务器装SQL2005,提示SQL server服务无法启动
  14. 编程必会的100个代码大全,建议收藏
  15. 人人都是产品经理面试题
  16. cpt怎么转换成HTML,Excel直接转成模板cpt
  17. stc15流水灯c语言,STC89C52单片机流水灯
  18. Supervisor 配置详解
  19. 压箱底的Mac解压缩软件大放送
  20. 1076万毕业生,面对有史以来最大规模毕业潮,麻了

热门文章

  1. bzoj3514: Codechef MARCH14 GERALD07加强版
  2. 《计算机多媒体技术》课程标准
  3. cesium实现等高线效果
  4. eacharts地图加外边框阴影,增加立体效果
  5. [CTO札记]FriendFeed的特色功能,对社区的启发
  6. Celsius 的暴雷,会是加密领域的“雷曼时刻”吗?
  7. 员工管理 Mybatis-Plus的分页插件
  8. C语言拾遗-C语言基础-C89、C99与C11
  9. MMSE信道估计的推导
  10. 同城app开发功能模块