US 12,273,385 B2
Systems and methods for automated malicious code replacement
Igor Seletskiy, Palo Alto, CA (US); and Andrey Kucherov, Tula (RU)
Assigned to Cloud Linux Software Inc., Estero, FL (US)
Filed by Cloud Linux Software Inc., Estero, FL (US)
Filed on Jan. 24, 2022, as Appl. No. 17/582,369.
Prior Publication US 2023/0239323 A1, Jul. 27, 2023
Int. Cl. H04L 9/40 (2022.01)
CPC H04L 63/1491 (2013.01) [H04L 63/1416 (2013.01); H04L 63/1466 (2013.01)] 19 Claims
OG exemplary drawing
 
1. A method for automated malicious code replacement, the method comprising:
analyzing, using a trained machine learning (ML) algorithm for identifying malicious content, a file comprising a script written in an interpretable programming language, wherein the malicious content triggers malicious activity on a computing device that stores the file, and wherein a training dataset for the ML algorithm includes a plurality of scripts and labelled malware injections in the scripts;
detecting a malware injection in the file based on the ML analysis, wherein the malware injection comprises at least one code fragment that enables the malicious activity, and identifying at least one malicious activity trigger operator in the code fragment;
selecting, using a trained ML algorithm for selecting a replacement code, a benign code fragment that can replace the at least one code fragment to prevent execution of the malicious activity without causing a syntax error, wherein the benign code fragment includes a benign operator that accepts the same inputs as the malicious activity trigger operator, and wherein a training dataset for the ML algorithm includes a plurality of malicious activity operators and corresponding benign code fragments with the benign operators; and
updating the file by replacing at least the malicious activity trigger operator in the at least one code fragment with the selected benign code fragment.