# US 2023/0273990 A1 · Code modification for detecting abnormal activity

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

- Number: US 2023/0273990 A1
- Document ID: US20230273990A1
- Status: Published application
- Kind: A1
- Application number: 17/680,977
- Filed: 2022-02-25
- Published: 2023-08-31
- Earliest claimed: 2022-02-25
- Assignees: Shape Security, Inc.
- Applicants: Shape Security, Inc.
- Inventors: Justin D. Call; Xiaoming Zhou; Xiaohan Huang; Subramanian Varadarajan; Roger S. Hoover
- Web page: https://patentgrep.com/patent/US20230273990A1

## CPC

- G06F 21/52: during program execution, e.g. stack integrity {; Preventing unwanted data erasure; Buffer overflow}
- H04L 63/1441: {Countermeasures against malicious traffic (countermeasures against attacks on cryptographic mechanisms H04L9/002)}
- G06F 21/54: by adding security routines or objects to programs
- G06F 21/56: Computer malware detection or handling, e.g. anti-virus arrangements
- G06F 21/566: {Dynamic detection, i.e. detection performed at run-time, e.g. emulation, suspicious activities}
- H04L 63/1416: {Event detection, e.g. attack signature detection}
- H04L 63/168: {above the transport layer}
- H04L 67/02: based on web technology, e.g. hypertext transfer protocol [HTTP]
- H04L 2463/144: Detection or countermeasures against botnets
- 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

Techniques for code modification for detecting abnormal activity are described. Web code is obtained. Modified web code is generated by changing a particular programmatic element to a modified programmatic element throughout the web code. Instrumentation code is generated configured to monitor and report on one or more interactions with versions of the particular programmatic element. The instrumentation code is caused to be provided in association with the modified web code to the first client device in response to the first request from the first client device. Report data generated by the instrumentation code is received. The report data describes abnormal activity at the first client device, the abnormal activity comprising an interaction with a version of the particular programmatic element that does not exist in the modified web code. Based on the report, it is determined that the first client device is likely controlled by malware.

## Claims

### Claim 1

A non-transitory computer readable medium having stored thereon instructions comprising executable code which when executed by one or more processors, causes the processors to:
obtain web code corresponding to content to be served to a first client device in response to a first request from the first client device;
generate modified web code based on the web code by changing a particular programmatic element to a modified programmatic element throughout the web code;
generate instrumentation code configured to monitor and report on one or more interactions with versions of the particular programmatic element when the modified web code executes on the first client device;
cause the instrumentation code to be provided in association with the modified web code to the first client device in response to the first request from the first client device;
receive report data generated by the instrumentation code, the report data describing abnormal activity at the first client device, the abnormal activity comprising an interaction with a version of the particular programmatic element that does not exist in the modified web code; and
determine, based on the report, that the first client device is likely controlled by malware.

### Claim 2 (depends on 1)

The non-transitory computer readable medium of claim 1, wherein the instructions further comprise executable code which when executed by one or more processors, causes the processors to:
add the instrumentation code to the modified web code.

### Claim 3 (depends on 1)

The non-transitory computer readable medium of claim 1, wherein the instructions further comprise executable code which when executed by one or more processors, causes the processors to:
receive a second request from the first client device corresponding to the interaction with the version of the particular programmatic element, wherein the second request includes the report data.

### Claim 4 (depends on 1)

The non-transitory computer readable medium of claim 1, wherein the particular programmatic element is a function name and the modified programmatic element is a second function name that includes a randomized string of characters.

### Claim 5 (depends on 1)

The non-transitory computer readable medium of claim 1, wherein the instrumentation code monitors and reports on a function call that does not match function calls that are permissible for the modified web code.

### Claim 6 (depends on 1)

The non-transitory computer readable medium of claim 1, wherein modification made to the particular programmatic element differs from modifications made in response to one or more other client devices requesting the content comprising the first web code.

### Claim 7 (depends on 1)

The non-transitory computer readable medium of claim 1, wherein the particular programmatic element is a function name for a function that makes changes to a document object model (DOM) corresponding to the content.

### Claim 8 (depends on 1)

The non-transitory computer readable medium of claim 1, wherein the report data describes a call to a non-transitory computer readable medium and metadata that characterizes the call.

### Claim 9 (depends on 8)

The non-transitory computer readable medium of claim 8, wherein determining that the first client device is likely controlled by malware comprises and using the metadata to determine whether the abnormal activity is malicious or benign.

### Claim 10 (depends on 8)

The non-transitory computer readable medium of claim 8, wherein the metadata includes information about an entity making the call at the first client device.

### Claim 11

A management system, comprising one or more client devices or server devices, the system comprising memory comprising programmed instructions stored thereon and one or more processors configured to be capable of executing the stored programmed instructions to:
obtain web code corresponding to content to be served to a first client device in response to a first request from the first client device;
generate modified web code based on the web code by changing a particular programmatic element to a modified programmatic element throughout the web code;
generate instrumentation code configured to monitor and report on one or more interactions with versions of the particular programmatic element when the modified web code executes on the first client device;
cause the instrumentation code to be provided in association with the modified web code to the first client device in response to the first request from the first client device;
receive report data generated by the instrumentation code, the report data describing abnormal activity at the first client device, the abnormal activity comprising an interaction with a version of the particular programmatic element that does not exist in the modified web code; and
determine, based on the report, that the first client device is likely controlled by malware.

### Claim 12 (depends on 11)

The system of claim 11, wherein the one or more instructions, when executed by the one or more hardware processors, cause the one or more hardware processors to:
add the instrumentation code to the modified web code.

### Claim 13 (depends on 11)

The system of claim 11, wherein the one or more instructions, when executed by the one or more hardware processors, cause the one or more hardware processors to:
receive a second request from the first client device corresponding to the interaction with the version of the particular programmatic element, wherein the second request includes the report data.

### Claim 14 (depends on 11)

The system of claim 11, wherein the particular programmatic element is a function name and the modified programmatic element is a second function name that includes a randomized string of characters.

### Claim 15 (depends on 11)

The system of claim 11, wherein the instrumentation code monitors and reports on a function call that does not match function calls that are permissible for the modified web code.

### Claim 16 (depends on 11)

The system of claim 11, wherein modification made to the particular programmatic element differs from modifications made in response to one or more other client devices requesting the content comprising the first web code.

### Claim 17 (depends on 11)

The system of claim 11, wherein the particular programmatic element is a function name for a function that makes changes to a document object model (DOM) corresponding to the content.

### Claim 18 (depends on 11)

The system of claim 11, wherein the report data describes a call to a non-transitory computer readable medium and metadata that characterizes the call.

### Claim 19 (depends on 18)

The system of claim 18, wherein determining that the first client device is likely controlled by malware comprises and using the metadata to determine whether the abnormal activity is malicious or benign.

### Claim 20 (depends on 8)

The system of claim 8, wherein the metadata includes information about an entity making the call at the first client device.
