The primary goal of this specific syntax is to returned by the original, legitimate database query.
Once an attacker knows there are 8 columns, they can replace the NULL values with commands to extract sensitive data, such as usernames, passwords, or database versions. SQL injection UNION attacks | Web Security Academy
: Attackers use NULL because it is compatible with almost every data type (integers, strings, dates), making it the "safest" way to avoid syntax errors while testing column counts.
: An attacker starts with one NULL and keeps adding more (e.g., NULL, NULL , then NULL, NULL, NULL ).