当前位置:网站首页>Click hijacking attack
Click hijacking attack
2022-07-26 17:47:00 【Leisurely summer】
1、 Attack principle
Clickjacking (Click Jacking), Also known as UI Covering attacks
Hackers create a web page using iframe Contains the target site ; Hide the website in the target , Is that users are unaware of the existence of the target website ; Entice the user to click a specific button in the figure . The specific button position is consistent with the key button position in the original web page , The user clicks the button without knowing it , Lured to perform dangerous operations .

2、 attacks
Two ways :
- One is that the attacker uses a transparent iframe, Overlay on a web page , Then entice the user to operate on the page , At this time, the user will click the transparent iframe page ;
- Second, the attacker uses a picture to cover the web page , The meaning of blocking the original position of web page .
3、iframe Coverage attack and protection
iframe The attack is like a picture with a layer of transparent paper on it , The page you see is at the bottom , What you really click on is another web page that is transparent to hackers . A simple example of click hijacking , When you click on an unknown link , Automatically follow someone's blog or subscribe to a video .
If I posted many videos on Youku , Want more people to pay attention to it , So we prepared a page :
<!DOCTYPE html>
<html>
<meta http-equiv="Content-Type" content="text/html;
charset=utf-8">
<head>
<title> Clickjacking POC</title>
<style>
iframe {
width: 1440px;
height: 900px;
position: absolute;
top: -0px;
left: -0px;
z-index: 2;
-moz-opacity: 0;
opacity: 0;
filter: alpha(opacity=0);
}
button {
position: absolute;
top: 270px;
left: 1150px;
z-index: 1;
width: 90px;
height:40px;
}
</style>
</head>
<body>
<button> Beauty pictures </button>
<img src="http://pic1.win4000.com/wallpaper/2018-03-19/5aaf2bf0122d2.jpg">
<iframe src="http://i.youku.com/u/UMjA0NTg4Njcy" scrolling="no"></iframe>
</body>
</html>
Of course, the real page will be more exquisite , Not so simple .
terms of settlement
Use one HTTP head ——X-Frame-Options.X-Frame-Options It can be said to solve ClickJacking Born , It has three optional values :
- DENY: The browser will refuse to load any frame page ;
- SAMEORIGIN :frame The address of the page can only be the page under the same domain name ;
- ALLOW-FROM origin: allow frame Page address loaded ;
nginx To configure :
add_header X-Frame-Options SAMEORIGIN;
4、 Picture coverage attack and protection
Image overlay attack (Cross Site Image Overlaying), The attacker uses one or more pictures , Using pictures of style Or something you can control CSS, Overlay the picture on the web page , Form click hijacking . Of course, the information carried by the picture itself may have the meaning of deception , This does not require the user to click , Can also achieve the purpose of deception .
PS: This kind of attack can easily appear on the page of the website itself .
Example
You can enter HTML Add a picture to the content , Just overwrite the picture in the specified position .
<a href="http://tieba.baidu.com/f?kw=%C3%C0%C5%AE">
<img src="XXXXXX" style="position:absolute;top:90px;left:320px;" />
</a>terms of settlement
When defending against image overlay attacks , You need to check the user submitted HTML In the code ,img Labeled style Whether the property may cause a float .
summary :
Click hijacking is an attack that many people don't pay much attention to , He needs to entice users to interact with the page , The cost of implementing attacks is higher . In addition, developers may feel that users are stupid , Don't pay attention to this kind of attack .
边栏推荐
- 【欧米读书会】谈谈元宇宙中的创作者经济:无限次元
- Just this time! Talk about the technical solutions of distributed system in detail
- 二层管理型交换机如何设置IP
- (25) top level menu of blender source code analysis blender menu
- OpenWrt之feeds.conf.default详解
- Environment setup mongodb
- Hardware development and market industry
- SQL注入(思维导图)
- 云渲染-体积云【理论基础与实现方案】
- API for sellers -- description of the return value of adding baby API to Taobao / tmall sellers' stores
猜你喜欢

第16周OJ实践1 计算该日在本年中是第几天

Crazy God redis notes 02

【集训Day2】Sculpture

【集训Day3】section
![[machine learning] principle and code of mean shift](/img/d8/a367c26b51d9dbaf53bf4fe2a13917.png)
[machine learning] principle and code of mean shift

Kudu design tablet

Sign up now | oar hacker marathon phase III midsummer debut, waiting for you to challenge

leetcode:1206. 设计跳表【跳表板子】

即刻报名|飞桨黑客马拉松第三期盛夏登场,等你挑战

Come on developer! Not only for the 200000 bonus, try the best "building blocks" for a brainstorming
随机推荐
股票公司开户万一免五这是真的安全靠谱的吗
使用 replace-regexp 在行首添加序号
树形dp问题
uni-app
the loss outweighs the gain! Doctors cheated 2.1 million yuan and masters cheated 30000 yuan of talent subsidies, all of which were sentenced!
【集训Day3】section
【OpenCV 例程 300篇】240. OpenCV 中的 Shi-Tomas 角点检测
What is a test case? How to design?
2019 popularization group summary
二层管理型交换机如何设置IP
kudu设计-tablet
浅析接口测试
Diagram of seven connection modes of MySQL
【机器学习】Mean Shift原理及代码
Is it safe to open an account online now? Who do you want to open a stock account?
The diagram of user login verification process is well written!
如何通过学会提问,成为更加优秀的数据科学家
简述CUDA镜像构建
Sign up now | oar hacker marathon phase III midsummer debut, waiting for you to challenge
Is it safe for Huishang futures to open an account online? What is the account opening process?