• 主页
  • 相册
  • 随笔
  • 目录
  • 存档
Total 244
Search AboutMe

  • 主页
  • 相册
  • 随笔
  • 目录
  • 存档

html5安全

2020-06-17

《白帽子讲Web安全》笔记

1. 简介

HTML5是HTML最新的修订版本,由万维网联盟(W3C)于2014年10月完成标准制定

2. iframe的sandbox

在HTML5中,专门为iframe定义了一个新的属性,叫sandbox。使用sandbox这一个属性
后,<iframe>标签加载的内容将被视为一个独立的“源”(源的概念请参考“同源策略”),其中的脚本将被禁止执行,表单被禁止提交,插件被禁止加载,指向其他浏览对象的链接也会被禁止。

2.1. iframe

An iFrame is a frame within a frame. It is a component of an HTML element that allows you to embed documents, videos, and interactive media within a page. By doing this, you can display a secondary webpage on your main page

iFrame is an additional element to share content from other sites.

  • <iframe src="https://www.youtube.com/embed/dXBohfjc4WA" width="680" height="480" allowfullscreen></iframe>

3. Link Types: noreferrer

在HTML5中为<a>标签和<area>标签定义了一个新的Link Types:no referrer
顾名思义,标签指定了noreferrer后,浏览器在请求该标签指定的地址时将不再发送

<a href="xxx" rel="noreffer">test</a>
这种设计是出于保护敏感信息和隐私的考虑。因为通过Referer,可能会泄露一些敏感信息

4. Canvas自动破解验证码

The HTML <canvas> element is used to draw graphics on a web page.


  • new Image() 并绑定 onload 事件,然后我们需要一个画布,创建一个 canvas 并获取 context,然后进行初始化
  • 阈值化
  • 通过绘制矩形一步步确定验证码的位置

5. 其他参考

  • 使用 canvas 破解简单验证码 | ccloli
  • Security
  • Web Security
  • Note
文件上传漏洞
跨站点请求伪造
  1. 1. 1. 简介
  2. 2. 2. iframe的sandbox
    1. 2.1. 2.1. iframe
  3. 3. 3. Link Types: noreferrer
  4. 4. 4. Canvas自动破解验证码
  5. 5. 5. 其他参考
© 2024 何决云 载入天数...