Characteristics of a stored procedure attack

A malicious stored procedure is a block of code designed to evade detection, and to perform complex attacks over a period of time. The exact attack can be repeated, or it can change its characteristics over time. The stored procedure can be dormant for an extended period of time, making it harder to identify as suspicious. Even if unusual activity was noticed in a previous audit, by the time the next audit occurs the previous activity has been forgotten. A malicious stored procedure can be used to disguise a drop of an important table, or to extract the contents of a table.

Examples of suspicious activity are: the creation of a stored procedure with a DROP statement with sensitive objects; a DROP verb; SQL exceptions caused by missing objects; a procedure that is modified after being dormant for an extended period of time.

Guardium tracks the activity around individual stored procedures, and together with Outlier mining data correlates the various symptoms and users. Guardium can detect these typical symptoms of this malicious stored procedure use case (presented in the order they typically occur):

  1. A database administrator creates a malicious Procedure A, which deletes data from the customer table
  2. A month later the database administrator changes a commonly used Procedure B to call Procedure A
  3. A different user calls the modified Procedure B, such that the customer table data is deleted by that innocent user