The "SQL Injection Activity" detection focuses on identifying attempts to exploit SQL injection vulnerabilities within an organization's applications. SQL injection is a code injection technique where attackers insert malicious SQL queries into input fields, aiming to execute unauthorized SQL commands on a database. Successful SQL injection attacks can lead to unauthorized data access, data manipulation, and potentially full control over the affected database.
Adversaries may attempt to take advantage of a weakness in an Internet-facing computer or program using software, data, or commands in order to cause unintended or unanticipated behavior. The weakness in the system can be a bug, a glitch, or a design vulnerability. These applications are often websites, but can include databases (like SQL), standard services (like SMB or SSH), network device administration and management protocols (like SNMP and Smart Install), and any other applications with Internet accessible open sockets, such as web servers and related services. Depending on the flaw being exploited this may include Exploitation for Defense Evasion.
If an application is hosted on cloud-based infrastructure, then exploiting it may lead to compromise of the underlying instance. This can allow an adversary a path to access the cloud APIs or to take advantage of weak identity and access management policies.
For websites and databases, the OWASP top 10 and CWE top 25 highlight the most common web-based vulnerabilities.
For this example, we’re going to pivot from a detection, if you come across an SQL Injection Activity detection you can follow these steps to investigate further. First identify active SQL Injection Activity detections within the detect platform that are not triaged, navigate to Detections > Advanced Search and type the following query into the search field:
detection.detection_type:”SQL Injection Activity” AND detection.is_ triaged:false AND NOT detection.state:inactive
Pick one of the detections and review the details, note the source, target, the X-Forwarded-For header, port used and bytes received. If the bytes received is large it could indicate a successful SQL injection and database information was returned to the adversary, review the pcap to see what response data the requests were being met with. The response codes are not reliable here for SQL Injection, a server could respond to the clients request with an error code and yet still return valid data as the SQL statement was successful.
Next review the X-Forwarded For header IP, it’s likely your web server will be behind a proxy or load balancer and the source IP will not be the true source. With the X-Forwarded For header configured it will append the true public source as a header to the HTTP request allowing the Vectra AI-driven platform to parse this information and present it within the UI.
Pivot into Vectra Recall and under Discover > metadata_httpsessioninfo* search for the X-forwarded-For IP using the proxied field and review all requests from this source. Start with a small window of maybe 10 to 20 minutes and gradually expand out your search time. Review the user-agent, targeted uri and bytes sent/received. These fields can help identify if this activity was an automated tool and if any of the requests were successful.
Scenario 1: An attacker uses an automated tool to perform SQL injection attacks on a company's public-facing web application. The detection is triggered by unusual SQL queries and errors logged by the database server.
Scenario 2: During a penetration test, the security team runs a series of SQL injection tests on the organization's web applications to evaluate their security. The detection is triggered, and the activity is verified as part of the scheduled assessment.
If this detection indicates a genuine threat, the organization faces significant risks:
Attackers can alter, delete, or insert data, leading to data integrity issues.
SQL injection attacks can lead to application downtime or degraded performance.
Breaches involving personal or financial data can result in non-compliance with regulations such as GDPR, HIPAA, and others.