
1. XSS là gì?
XSS (Cross-Site Scripting) là một lỗ hổng bảo mật phổ biến trong các ứng dụng web, cho phép kẻ tấn công chèn mã JavaScript độc hại vào trang web. Khi người dùng truy cập trang web bị nhiễm, mã độc sẽ chạy trên trình duyệt của họ, có thể đánh cắp thông tin, chiếm quyền điều khiển tài khoản hoặc thực hiện các hành vi nguy hiểm khác.
2. Các loại tấn công XSS
Có ba loại tấn công XSS chính:
a) Stored XSS (XSS lưu trữ)
Trong Stored XSS, mã độc được lưu trữ trên máy chủ và được tải về khi người dùng truy cập trang web. Ví dụ:
<form action="/submit-comment" method="POST">
<input type="text" name="comment" placeholder="Nhập bình luận">
<button type="submit">Gửi</button>
</form>Nếu không có cơ chế lọc đầu vào, kẻ tấn công có thể nhập:
Learn Python syntax easily with this beginner-friendly guide. Understand basic syntax rules, variables, loops,...
Struggling with the “Key is already in use” error when adding an SSH key to GitHub? This guide walks you through the...
Learn how to get URL segments in Laravel using Request::segment() and segments() methods. Step-by-step examples and best...
Struggling with the “Key is already in use” error when adding an SSH key to GitHub? This guide walks you through the...
Learn how to clear cache in Laravel 12 for Routes, Views, Config, Events, and more. Detailed guide on Artisan commands...
Learn how to install Python quickly and easily with this step-by-step guide for Windows, macOS, and Linux. Start your...
Learn Python syntax easily with this beginner-friendly guide. Understand basic syntax rules, variables, loops,...
Learn how to use CSS offset-path, offset-position, offset-distance, and offset-rotate properties to create smooth and...
