
SQL Injection là gì? Tìm hiểu chi tiết về mối đe dọa tiềm ẩn của mọi website
What is SQL injection?
SQL Injection (or SQLi) is a long-standing web application attack technique. It occurs when a web application fails to handle user input correctly, allowing an attacker to inject and execute malicious SQL code against the database.
This can lead to serious consequences such as unauthorized access to the database and the reading, modification or deletion of sensitive data. The steps involved in a SQL Injection attack are typically as follows:
– Attackers try to feed malicious input (usually modified SQL queries) into the web application through data fields such as forms, URLs, headers and cookies,…
– Ứng dụng web không authentication hoặc lọc đầu vào đó đúng cách, khiến câu truy vấn SQL độc hại được thực thi trên cơ sở dữ liệu.
– Attackers can read, modify or delete data in the database, and may even be able to execute other server commands.
To understand how SQL injection is prevented, developers should apply preventive measures such as using parameterized queries, avoiding dynamically built queries, and always validating and filtering all user input.
What types of SQL injection attacks are there?
SQL injection is one of the most common attack methods against database-driven web applications. Below are some of the most common types of SQL injection attack:
– In-band SQLi (Classic):This is the classic form of SQLi: the result of the injected query is returned as part of the web application's response. A typical example is an attack through input fields such as forms.
– Inferential (Blind) SQLi:When sensitive data is retrieved from the database but not shown directly in the web application, an attacker has to infer it from other responses, such as the HTTP response code.
– Out-of-band SQLi: Tin tặc có thể truyền dữ liệu nhạy cảm trực tiếp từ cơ sở dữ liệu tới một máy chủ khác thông qua kỹ thuật như DNS hoặc ghi vào một tệp.
– Union-based SQLi:Combining several SQL queries with the UNION statement to extract more data.
– Error-based SQLi:Exploiting error messages generated by the database to extract information about its contents and structure.
– Time-based Blind SQLi:When the application returns no visible result from the SQL injection, an attacker can infer the data from delays in response time.
Because there are several types of SQLi, each needs its own countermeasures to protect a web application comprehensively.
Common techniques for preventing SQL injection
To protect a user’s web application against SQL Injection attacks, it is essential to implement effective prevention techniques. Common approaches include:
Using the parameter
Instead of passing data directly into an SQL query, use parameterized queries with the parameters supplied separately. The database then treats that data as raw data rather than as part of the query.
Input filtering and validation
Validate and filter all user input, stripping the special characters and dangerous strings that can be used in SQLi. Apply measures such as allowlisting, blocklisting and escaping special characters.
WAF security
Doanh nghiệp cũng có thể cân nhắc, triển khai Web Application Firewall (WAF) để giám sát và chặn các hoạt động đáng ngờ, bảo vệ ứng dụng web khỏi những cuộc tấn công SQLi.
Monitor and log activity
Monitoring and logging activity is another widely adopted defense against SQL Injection. Executed SQL queries should be logged and monitored so that suspicious activity can be detected, with regular auditing and log analysis.
Ngoài ra, người dùng cần phải giữ các phần mềm liên quan cập nhật bản vá bảo mật mới nhất để vá lỗ hổng bảo mật được phát hiện, đào tạo nhân viên để hiểu SQL Injection là gì cũng như xây dựng một kịch bản Backup dữ liệu phòng trường hợp bị tấn công website.
Protect your data proactively with Viettel Cloud Backup from Viettel IDC
To keep company data safe and stay ahead of possible attacks, an organization should consider adopting backup solutions suited to its own environment.
If you are looking for a flexible, secure data backup solution to protect critical data, Viettel Cloud Backup is the first option worth considering.
WithHi-Tech Cloud Backup,businesses can store data securely in the Viettel IDC cloud infrastructure, schedule automatic backups and restore data quickly in the event of hardware failure, software error or disaster.
Hi-Tech Cloud Backup uses AES-256 encryption to keep data secure, runs automatic daily, weekly, monthly or annual backups, and retains multiple data versions so customers can restore to an earlier point in time.
Overall, Hi-Tech Cloud Backup is a comprehensive option for businesses of any size that want to protect their data and maintain business continuity.

Using backup services lets a business protect its data proactively and limit potential losses




























































































































