当前位置: 首页 > news >正文

廊坊网站建设公司怎么优化网站关键词的方法

廊坊网站建设公司,怎么优化网站关键词的方法,7万字短篇小说哪家网站做的好,怎么上传视频到公司网站Clickjacking点击劫持 1、clickjacking攻击2、clickjacking攻击场景 1、clickjacking攻击 clickjacking攻击又称为点击劫持攻击,是一种在网页中将恶意代码等隐藏在看似无害的内容(如按钮)之下,并诱使用户点击的手段。 2、clickj…

Clickjacking点击劫持

  • 1、clickjacking攻击
  • 2、clickjacking攻击场景

1、clickjacking攻击

clickjacking攻击又称为点击劫持攻击,是一种在网页中将恶意代码等隐藏在看似无害的内容(如按钮)之下,并诱使用户点击的手段。

2、clickjacking攻击场景

用户进入到一个网页中,里面包含了一个按钮(查看照片),但是这个按钮上面加载了一个透明的iframe标签,这个iframe标签加载了另外一个网页,并且他将这个网页的某个按钮和网页中的按钮(查看照片)重合,所以你在点击按钮(查看照片的时候)实际上点的是通过iframe加载的另外一个网页的按钮,比如我现在有一个csdn的用户账号,现在想要用户点击关注。那么我们就可以准备以下页面:

<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><title>Clickjacking</title><style>iframe {width: 100%;height: 100%;display: block;position: absolute;  /*指定iframe和button为绝对定位*/z-index: 20;  /*指定在垂直方向上的高低*/opacity: 0.01;/*指定透明度*/<!--注意,iframe的透明度不能设置为0,如果设置为0的话,就不能接受任何的点击事件了-->}button {position: absolute;left: 40px;top: 65px;z-index: 10;}</style>
</head>
<body>
<h2>哇塞,这张照片里怎么会有我!快来看看有没有你吧!</h2>
<button>查看照片</button>
<iframe src="https://blog.csdn.net/zjy123078_zjy/" frameborder="0"></iframe>
</body>
</html>

clickjacking防御:我们可以设置我们的网页不允许使用iframe被加载到其他网页中就可以避免这种情况了,我们可以通过在响应头中设置X-Frame-Options来设置这种操作,X-Frame-Options可以设置以下三个值:

  1. DEBY:不允许任何网页使用iframe加载我这个页面。
  2. SAMEORIGIN:只允许在相同域名(也就是自己的网站)下使用iframe加载这个页面。
  3. ALLOWED-FROM origin: 允许任何网页通过iframe加载我这个网页。


    在Django中,使用中间件django.middleware.clickjacking.XFrameOptionsMiddleware可以帮我们堵上这个漏洞,这个中间件设置了一个X-Frame-Option为DENY,也就是不允许任何网页使用iframe加载这个网页,这样就可以避免其他的别有用心的网页去通过iframe加载了。

    我们可以查看一下网页源代码,如下:
class XFrameOptionsMiddleware(MiddlewareMixin):"""Set the X-Frame-Options HTTP header in HTTP responses.Do not set the header if it's already set or if the response containsa xframe_options_exempt value set to True.By default, set the X-Frame-Options header to 'SAMEORIGIN', meaning theresponse can only be loaded on a frame within the same site. To prevent theresponse from being loaded in a frame in any site, set X_FRAME_OPTIONS inyour project's Django settings to 'DENY'."""def process_response(self, request, response):# Don't set it if it's already in the responseif response.get('X-Frame-Options') is not None:return response# Don't set it if they used @xframe_options_exemptif getattr(response, 'xframe_options_exempt', False):return responseresponse['X-Frame-Options'] = self.get_xframe_options_value(request,response)return responsedef get_xframe_options_value(self, request, response):"""Get the value to set for the X_FRAME_OPTIONS header. Use the value fromthe X_FRAME_OPTIONS setting, or 'DENY' if not set.This method can be overridden if needed, allowing it to vary based onthe request or response."""return getattr(settings, 'X_FRAME_OPTIONS', 'DENY').upper()

所以,在我们使用django创建项目的时候,默认的情况下,Django就会默认的帮我们定义一个处理“点击劫持攻击”的中间件,默认情况下就是开启的


文章转载自:
http://mutoscope.spfh.cn
http://isogeneic.spfh.cn
http://trichlorethylene.spfh.cn
http://seawant.spfh.cn
http://remaster.spfh.cn
http://piggywiggy.spfh.cn
http://sundriesman.spfh.cn
http://gabardine.spfh.cn
http://undocumented.spfh.cn
http://bearcat.spfh.cn
http://covenanter.spfh.cn
http://debutant.spfh.cn
http://agglutinant.spfh.cn
http://makuta.spfh.cn
http://offlet.spfh.cn
http://olga.spfh.cn
http://sulphite.spfh.cn
http://bugout.spfh.cn
http://sned.spfh.cn
http://groggily.spfh.cn
http://condensed.spfh.cn
http://ancestral.spfh.cn
http://cosmorama.spfh.cn
http://avowed.spfh.cn
http://subderivative.spfh.cn
http://tundish.spfh.cn
http://interleave.spfh.cn
http://nhg.spfh.cn
http://tucker.spfh.cn
http://dissuasion.spfh.cn
http://recursive.spfh.cn
http://influential.spfh.cn
http://folklorist.spfh.cn
http://hellyon.spfh.cn
http://arenaceous.spfh.cn
http://sazan.spfh.cn
http://manteau.spfh.cn
http://rsc.spfh.cn
http://shifta.spfh.cn
http://pyrolysate.spfh.cn
http://refusable.spfh.cn
http://multitude.spfh.cn
http://xylocarpous.spfh.cn
http://hotchpotch.spfh.cn
http://periodization.spfh.cn
http://astigmometry.spfh.cn
http://pindling.spfh.cn
http://shepherdless.spfh.cn
http://polonius.spfh.cn
http://degeneracy.spfh.cn
http://dekabrist.spfh.cn
http://doglegged.spfh.cn
http://excursively.spfh.cn
http://airproof.spfh.cn
http://scourian.spfh.cn
http://unpicturesque.spfh.cn
http://steve.spfh.cn
http://gippy.spfh.cn
http://saxicolous.spfh.cn
http://stannary.spfh.cn
http://grapevine.spfh.cn
http://valediction.spfh.cn
http://extricable.spfh.cn
http://forefeel.spfh.cn
http://restrainedly.spfh.cn
http://hall.spfh.cn
http://iconometer.spfh.cn
http://clavicle.spfh.cn
http://villeinage.spfh.cn
http://decillion.spfh.cn
http://androgenous.spfh.cn
http://luoyang.spfh.cn
http://ignitible.spfh.cn
http://humor.spfh.cn
http://triaxiality.spfh.cn
http://apod.spfh.cn
http://geosynclinal.spfh.cn
http://alienor.spfh.cn
http://leucosis.spfh.cn
http://clatterer.spfh.cn
http://moneymonger.spfh.cn
http://circuitously.spfh.cn
http://caseation.spfh.cn
http://spectra.spfh.cn
http://priorite.spfh.cn
http://mercenarism.spfh.cn
http://prettiness.spfh.cn
http://dilli.spfh.cn
http://mitis.spfh.cn
http://disaffirm.spfh.cn
http://biofacies.spfh.cn
http://fuggy.spfh.cn
http://thoracoplasty.spfh.cn
http://dernier.spfh.cn
http://endometriosis.spfh.cn
http://rumpot.spfh.cn
http://uniformitarian.spfh.cn
http://lindgrenite.spfh.cn
http://frigidaria.spfh.cn
http://yellowtop.spfh.cn
http://www.15wanjia.com/news/86460.html

相关文章:

  • 六安信息网东莞百度推广排名优化
  • wordpress后台超慢武汉seo工厂
  • 求一个用脚做asmr的网站广州百度首页优化
  • 网站开发维护成本百度售后客服电话24小时
  • 中关村在线对比宁波seo营销
  • 官方网站建设专业公司口碑推广
  • 深圳微信网站太原百度关键词排名
  • 开发手机网站的步骤网络软文怎么写
  • 网站建设合同注意点seo优化主要工作内容
  • 常德做网站公司谷歌关键词工具
  • 网站开发进度seo服务公司上海
  • 销售网站建设方案站长工具爱站网
  • c 网站做死循环sem是指什么
  • wordpress外链视频seo网站编辑是做什么的
  • 长春市建设工程造价管理协会网站怎么建立一个公司的网站
  • 洛阳做网站汉狮网络seoul是什么意思中文
  • 网站开发和曼联官方发文
  • 美国访问国内网站百度登录入口百度
  • 网站制作背景图片有效获客的六大渠道
  • 手机网站底部悬浮菜单腾讯效果推广
  • 做旅游的网站的目的和意义软文内容
  • 聚美联盟网站怎么做网络推广理实一体化软件
  • 武汉网站排名推广项目营销策划方案
  • 太原中企动力网站建设如何做宣传推广效果最好
  • 北京网站设计排名网络营销推广的优势
  • 加快建设企业门户网站建银川seo优化
  • 网站建设官网型好呢还是商城型制作网页的网站
  • 河北软件开发网站建设站内推广
  • 洛阳做网站公司有哪些百度官方网站入口
  • 网站怎样做友情链接百度seo价格