# US 2019/0243964 A1 · System and method for exploiting attack detection by validating application stack at runtime

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

- Number: US 2019/0243964 A1
- Document ID: US20190243964A1
- Status: Published application
- Kind: A1
- Application number: 15/889,208
- Filed: 2018-02-06
- Published: 2019-08-08
- Earliest claimed: 2018-02-06
- Inventors: JAYANT SHUKLA; ABHAY KANHERE; KIRAN THIRUMALAI
- Web page: https://patentgrep.com/patent/US20190243964A1

## CPC

- G06F 21/54: by adding security routines or objects to programs
- G06F 2221/033: Test or assess software
- H04L 63/02: {for separating internal from external traffic, e.g. firewalls}
- H04L 63/0263: {Rule management}
- H04L 63/20: {for managing network security; network security policies in general (filtering policies H04L63/0227)}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- H04L: TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION (arrangements common to telegraphic and telephonic communication H04M)

## Abstract

In one aspect, a computer-implemented method for monitoring and validating execution of an executable binary code, includes the step of, prior to beginning execution of the executable binary code, disassembling the executable binary code, listing all of application programming interfaces (API) or function calls in the executable binary code, generating a validation table for a type of each of the APIs or each of the function calls, a location of each of the APIs or each of the function calls, and a return address of each of the APIs or each of the function calls in the executable binary code, and listing in the validation table the type of each of the APIs or each of the function calls

## Claims

### Claim 1

A computer-implemented method for monitoring and validating execution of an executable binary code, comprising the steps of:
prior to beginning execution of the executable binary code:
disassembling the executable binary code,
listing all of application programming interfaces (API) or function calls in the executable binary code,
generating a validation table for a type of each of the APIs or each of the function calls, a location of each of the APIs or each of the function calls, and a return address of each of the APIs or each of the function calls in the executable binary code, and
listing in the validation table the type of each of the APIs or each of the function calls, the location of each of the APIs or each of the function calls;
for every function in the executable binary code in the executable binary code:
scanning the executable binary code for a stack setup,
unwinding a set of instructions in the stack setup, and
determining an effect of the set of instructions on the stack of the stack setup and a set of instruction pointers of the stack setup;
creating a rule set for an unwinding of the stack frame operation for each function call in the executable binary code;
storing the rule set for the unwinding of the stack frame operation in an unwind table;
inserting a monitoring and validation hook, wherein monitoring and validation hook performs validation of the runtime stack of the stack setup during execution of executable binary code and after receiving a specified signal;
at runtime, the monitoring and validation hook:
waits for the specified signal to perform stack validation, wherein the specified signal comprises a system call,
obtaining a set of values for the stack and the set of instruction pointers,
obtains, from the unwind table, the unwind arithmetic for the function being executed based on the value of the instruction pointer,
unwinds a stack frame of the stack,
obtains a value of the return address from the function call,
uses the validation table to validate the return address as being consistent with a call to and return from the function associated with the stack frame, and
taking a default action when a rule violation is detected for a frame on the stack during the execution of the binary code.

### Claim 2 (depends on 1)

The method of claim 1, wherein the executable binary code is an application, a dynamic loaded library, a kernel module, a hypervisor, a firmware, or a memory page.

### Claim 3 (depends on 1)

The method of claim 1,
wherein the binary executable code attributes are reported to a rule server, and
wherein the corresponding validation and unwind map rule lists are received.

### Claim 4 (depends on 1)

The method of claim 1, wherein the stack frames on the stack are unwound until an initiator of the function call is in a specific module.

### Claim 5 (depends on 1)

The method of claim 1, wherein an observed API call location is validated by verifying an argument used via analysis of a disassembled structure of the binary executable code.

### Claim 6 (depends on 1)

The method of claim 1, wherein the rule list is downloaded from the rule server and used for validating the stack of the application at runtime.

### Claim 7 (depends on 1)

The method of claim 1, wherein a validation code executes at a remote location.

### Claim 8 (depends on 1)

The method of claim 1, wherein an additional information about a system state is reported to the rule server.

### Claim 9 (depends on 1)

The method of claim 1, where a trigger event is obtained via a probe inserted at a specific address into the application.

### Claim 10

A method useful for validating execution of an application through runtime validation of a stack of an executable binary code in a computer system, comprising the steps of:
prior to initiating execution of the executable binary code:
disassembling the executable binary code,
listing all of application programming interfaces (API) or a function calls in the executable binary code,
generating a validation table for a type of each API or a function call type, a location of each API or a function call type, and a return address in the executable binary code of each API or a function call type, and
listing the type and locations of each API or a function call type in the executable binary code;
for every function in the executable binary code:
scanning a code for a stack setup,
unwinding a set of instructions, and
computing an effect of the set of instruction on the stack and an associated set of instruction pointers;
creating a rule set for unwinding a stack frame for each function call in the executable binary code;
inserting a monitoring and validation hook, wherein the monitoring and validation hook performs validation of the runtime stack during execution of executable binary code, after receiving a specified signal;
in monitoring mode:
executing an application binary code,
sampling an associated application stack when triggered by the specified signal,
sequentially unwinding a set of stack frames of the application stack until the stack frame returns an address pointing to a specific memory region is reached,
determining an offset from a stack pointer to a location of the return address in a last stack frame, and
generating an unwind table for recording an offset from the current stack pointer to the location of return address to the code in a specific memory region; and
at runtime, with the monitoring and validation hook:
waiting for the specified signal to perform a stack validation operation, wherein the specified signal comprises a system call;
obtaining a stack value and an instruction pointer value;
obtaining an unwind table to obtain the offset for the return address from a call to a function;
unwinding the stack frame and obtaining a value of the return address from the function call;
looking up an API call location in a lookup table to validate the return address as being consistent with a call to the stack frame; and
implementing a default action when a rule violation is detected for a frame on the stack during the execution of the binary code.

### Claim 11 (depends on 10)

The method of claim 10, wherein the validation of the stack of the application is performed in a kernel in the computer system.

### Claim 12 (depends on 10)

The method of claim 10, wherein the validation of an observed stack of the application is performed in the hypervisor.

### Claim 13 (depends on 10)

The method of claim 10, wherein the validation of the observed stack of the application is performed in a firmware of the computer system.

### Claim 14 (depends on 10)

The method of claim 10, wherein the specified signal to perform stack validation is a system call made by the application.

### Claim 15

A method for creating and updating a rule list for use in validating a stack of an executable binary code comprising steps of:
in an analysis environment:
monitoring an execution of one or more applications;
receiving a specified trigger to initiate a validation process;
collecting an application stack and a system state at the time of the specified trigger;
transmitting a collected information to a rule server; and
at the rule server:
disassembling a set of application binaries;
building a list of functions in the application and arithmetic used in stack setup and unwind,
the rule server building the rule list for a function call location, a function call target, and a function call return address,
unwinding one or more frames on the application stack,
validating the one or more frames on the application stack, and
returning the validation results to a client computing device.

### Claim 16 (depends on 15)

The method of claim 15, wherein the rule list for an application is obtained by the client computing device from the rule server.

### Claim 17 (depends on 15)

The method of claim 15, wherein the application stack and an application attribute are reported by the client computing device.
