# US 8,578,487 B2 · System and method for internet security

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 8,578,487 B2
- Document ID: US8578487B2
- Status: Granted
- Kind: B2
- Application number: 12/939,766
- Filed: 2010-11-04
- Published: 2012-05-10
- Granted: 2013-11-05
- Earliest claimed: 2010-11-04
- Assignees: Cylance Inc.
- Applicants: Derek A. Soeder
- Inventors: Derek A. Soeder
- Web page: https://patentgrep.com/patent/US8578487B2

## CPC

- G06F 21/554: {involving event detection and direct action}
- G06F 21/6227: {where protection concerns the structure of data, e.g. records, types, queries}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A computer implemented method for preventing SQL injection attacks comprises intercepting a web request associated with a web service at a first software hook in a first web service execution context, persisting at least a portion of the intercepted web request in a storage location associated with the first software hook and accessible to at least one additional execution context, intercepting a database query generated by at least one web service processing operation at a second software hook associated with the execution of the query, wherein the query is generated in response to the intercepted web request and the second hook retrieves the persisted portion of the intercepted web request, comparing a portion of the persisted portion of the intercepted web request with at least a portion of the intercepted database query, and determining, prior to the query being executed, whether the query corresponds to a potential SQL injection attack.

## Claims

### Claim 1

A computer implemented method performed by one or more processors for preventing SQL injection attacks, the method comprising the following operations:
intercepting, at a first software hook, a web request associated with a web service, the first software hook associated with a first execution context of the web service;
persisting at least a portion of the intercepted web request in a storage location associated with the first software hook, wherein the portion of the intercepted web request persisted in the storage location is made accessible to at least one additional execution context associated with the web service and the at least a portion of the intercepted web request is appended to one or more messages transmitted between one or more execution contexts, the intercepted web request comprising at least one string;
intercepting a database query generated by at least one web service processing operation at a second software hook, the second software hook associated with execution of the generated database query, wherein the database query is generated in response to the intercepted web request, and wherein the second software hook retrieves the persisted portion of the intercepted web request;
comparing at least a portion of the persisted portion of the intercepted web request with at least a portion of the intercepted database query by tokenizing the intercepted database query and comparing portions of the intercepted database query corresponding to each token to each string captured in the intercepted web request; and
determining, prior to the intercepted database query being executed, whether the intercepted database query corresponds to a potential SQL injection attack if a string of the intercepted web request matches a portion of the intercepted database query and such string comprises a character that modifies a syntax of the intercepted database query.

### Claim 2 (depends on 1)

The method of claim 1 further comprising the following operations:
preventing the execution of the intercepted database query if the intercepted database query is determined to correspond to a potential SQL injection attack.

### Claim 3 (depends on 1)

The method of claim 1 further comprising the following operations:
allowing the execution of the intercepted database query if the intercepted database query is determined not to correspond to a potential SQL injection attack.

### Claim 4 (depends on 1)

The method of claim 1, wherein intercepting the web request at the first software hook includes at least one of modifying or diverting the web request from the first execution context of the web service.

### Claim 5 (depends on 1)

The method of claim 1, wherein persisting at least a portion of the intercepted web request in the storage location associated with the first software hook includes storing at least a portion of the intercepted web request in memory.

### Claim 6 (depends on 1)

The method of claim 1, wherein the first execution context and the second execution context are distinct processes associated with the web service, and further wherein the first execution context and the second execution context do not share a memory address space.

### Claim 7 (depends on 1)

The method of claim 1, wherein the first software hook comprises a detour software hook.

### Claim 8 (depends on 1)

The method of claim 1 further comprising the following operations: prior to intercepting the web request:
identifying a set of predefined locations within the web service for installation of software hooks; and
installing software hooks at each of the set of predefined locations, where each software hook is associated with a security application.

### Claim 9 (depends on 8)

The method of claim 8, wherein installing software hooks at each of the set of predefined locations further includes:
dynamically identifying an additional location associated with at least one of the set of predefined locations, where the additional location is dynamically identified when a new process associated with the predefined location is initiated.

### Claim 10 (depends on 8)

The method of claim 8, wherein the set of predefined locations includes at least one known dynamic linked library (DLL).

### Claim 11 (depends on 8)

The method of claim 8, where at least one of the set of predefined locations corresponds to a location on an execution path for the web service associated with executing database queries.

### Claim 12

An article comprising a non-transitory, machine-readable storage device storing instructions operable to cause at least one processor to perform operations comprising: intercepting, at a first software hook, a web request associated with a web service, the first software hook associated with a first execution context of the web service;
persisting at least a portion of the intercepted web request in a storage location associated with the first software hook, wherein the portion of the intercepted web request persisted in the storage location is made accessible to at least one additional execution context associated with the web service and the at least a portion of the intercepted web request is appended to one or more messages transmitted between one or more execution contexts, the intercepted web request comprising at least one string;
intercepting a database query generated by at least one web service processing operation at a second software hook, the second software hook associated with execution of the generated database query, wherein the database query is generated in response to the intercepted web request, and wherein the second software hook retrieves the persisted portion of the intercepted web request;
comparing at least a portion of the persisted portion of the intercepted web request with at least a portion of the intercepted database query by tokenizing the intercepted database query and comparing portions of the intercepted database query corresponding to each token to each string captured in the intercepted web request; and
determining, prior to the intercepted database query being executed, whether the intercepted database query corresponds to a potential SQL injection attack if a string of the intercepted web request matches a portion of the intercepted database query and such string comprises a character that modifies a syntax of the intercepted database query.

### Claim 13 (depends on 12)

The article of claim 12, the operations further comprising:
preventing the execution of the intercepted database query if the intercepted database query is determined to correspond to a potential SQL injection attack.

### Claim 14 (depends on 12)

The article of claim 12, the operations further comprising:
allowing the execution of the intercepted database query if the intercepted database query is determined not to correspond to a potential SQL injection attack.

### Claim 15 (depends on 12)

The article of claim 12, wherein intercepting the web request at the first software hook includes reading a set of information associated with the web request from the first execution context of the web service.

### Claim 16 (depends on 12)

The article of claim 12, wherein persisting at least a portion of the intercepted web request in the storage location associated with the first software hook includes storing at least a portion of the intercepted web request in memory.

### Claim 17 (depends on 12)

The article of claim 12, wherein the first execution context and the second execution context are distinct processes associated with the web service, and further wherein the first execution context and the second execution context do not share a memory address space.

### Claim 18 (depends on 12)

The article of claim 12, wherein the first software hook comprises a detour software hook.

### Claim 19 (depends on 12)

The article of claim 12, the operations further comprising:
prior to intercepting the web request:
identifying a set of predefined locations within the web service for installation of software hooks; and
installing software hooks at each of the set of predefined locations, where each software hook is associated with a security application.

### Claim 20 (depends on 19)

The article of claim 19, wherein installing software hooks at each of the set of predefined locations further includes:
dynamically identifying an additional location associated with at least one of the set of predefined locations, where the additional location is dynamically identified when a new process associated with the predefined location is initiated.

### Claim 21 (depends on 19)

The article of claim 19, wherein the set of predefined locations includes at least one known dynamic linked library (DLL).

### Claim 22 (depends on 19)

The article of claim 19, where at least one of the set of predefined locations corresponds to a location on an execution path for the web service associated with executing database queries.

### Claim 23

A system comprising:
a web server including:
at least one processor adapted to execute at least one web service operable to interact with at least one database, and
at least one memory device served by the web server, the memory device storing instructions associated with at least one web service; and
a security software module, integrated with the web server and a first web service and adapted to:
identify a set of predefined locations within the first web service for installation of a set of software hooks;
install the set of software hooks at each of the set of predefined locations;
intercept, at a first software hook from the set of software hooks, a web request associated with the first web service, the first software hook associated with a first execution context of the first web service, wherein the at least a portion of the intercepted web request is appended to one or more messages transmitted between one or more execution contexts, the intercepted web request comprising at least one string;
persist at least a portion of the intercepted web request in a storage location associated with the first software hook, wherein the portion of the intercepted web request persisted in the storage location is made accessible to at least one additional execution context associated with the first web service;
intercept a database query generated by at least one web service processing operation at a second software hook, the second software hook associated with execution of the generated database query, wherein the database query is generated in response to the intercepted web request, and wherein the second software hook retrieves the persisted portion of the intercepted web request;
compare at least a portion of the persisted portion of the intercepted web request with at least a portion of the intercepted database query by tokenizing the intercepted database query and comparing portions of the intercepted database query corresponding to each token to each string captured in the intercepted web request; and
determine, prior to the intercepted database query being executed, whether the intercepted database query corresponds to a potential SQL injection attack if a string of the intercepted web request matches a portion of the intercepted database query and such string comprises a character that modifies a syntax of the intercepted database query.
