Malicious Code Rewriting Pipeline for Function-Preserving Detection

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Generative AI tools are being misused by malicious actors to easily create obfuscated malicious code, which evades detection by existing cybersecurity systems, rendering current code obfuscation techniques ineffective.

Innovation Solution

A code sample rewrite pipeline that augments training data for malicious code detection models by rewriting malicious code samples with obfuscating transformations and evaluating their validity and functionality, incorporating only those that maintain original functionality into the training dataset.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Object-affected harmful factors

If code obfuscation techniques are applied to malicious code, then detection by cybersecurity systems is evaded, but the ability to maintain functionality while being obfuscated becomes difficult to ensure

Engineering Contradiction:
Improvedetection evasion capabilityVSAvoidfunctionality maintenance
Core Design Contradiction:
Object-affected harmful factorsVSReliability

Solution Approach 1:

The system implements a feedback mechanism where the language model generates obfuscated code, then validates it to ensure functionality is preserved. The validation results feed back into the generation process, allowing the model to learn and improve at maintaining functionality while obfuscating. This closed-loop approach ensures that obfuscation transformations do not break the malicious code's execution.

Inventive Principle:
Principle #23Feedback

Solution Approach 2:

A language model acts as an intermediary between the obfuscation process and the final malicious code output. Instead of directly applying transformations, the language model mediates the transformation process, generating obfuscated code that is then validated. This intermediary layer ensures smoother transitions and better preservation of functionality compared to direct transformation approaches.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Productivity

If generative AI tools are used for malicious code generation, then code creation efficiency is improved, but detection capability of cybersecurity systems deteriorates

Engineering Contradiction:
Improvemalicious code generation efficiencyVSAvoiddetection evasion
Core Design Contradiction:
ProductivityVSObject-affected harmful factors

Solution Approach 1:

The system performs preliminary validation of obfuscated code before it is finalized or deployed. By validating functionality upfront, the system ensures that generated malicious code maintains its purpose while being obfuscated. This preliminary action prevents the need for later corrections and ensures detection evasion effectiveness.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The language model changes various parameters of the malicious code including variable names, code structure, formatting, and syntax while maintaining the core functionality. By transforming multiple parameters simultaneously, the system efficiently generates highly obfuscated code that is difficult to detect while preserving malicious behavior.

Inventive Principle:
Principle #35Parameter changes

3Adaptability or versatility

If existing code obfuscation tools are used, then transformation capability is provided, but effectiveness against modern detection systems becomes insufficient

Engineering Contradiction:
Improveobfuscation transformation capabilityVSAvoidevasion effectiveness
Core Design Contradiction:
Adaptability or versatilityVSReliability

Solution Approach 1:

The system replaces traditional mechanical code obfuscation tools with a language model-based approach. Instead of rule-based transformations, the language model uses learned patterns and contextual understanding to generate obfuscated code. This substitution enables more sophisticated and adaptable obfuscation that can effectively evade modern detection systems while maintaining functionality.

Inventive Principle:
Principle #28Mechanics substitution (Replace mechanical system)

Data Source

PatentUS20250291918A1Pipeline for rewriting and validating malicious code with generative artificial intelligence
Publication Date: 2025.09.18 PALO ALTO NETWORKS INC
  • US20250291918A1 patent drawing
  • US20250291918A1 patent drawing
  • US20250291918A1 patent drawing

AI summary

A code sample rewrite pipeline has been created that augments training data for training malicious code detection models to learn functionality/execution behavior of malicious code and increase detection capability despite evasion techniques. The code sample rewrite pipeline ingests a set of malicious code samples. For each of the malicious code samples, the code sample rewrite pipeline prompts a language model to rewrite the malicious code sample with obfuscating transformations. The code sample rewrite pipeline evaluates output of the language model to determine whether the output is valid program code and whether it maintains functionality of the original malicious code sample. If the rewritten malicious code sample is valid and maintains functionality of the original malicious code sample, then the rewritten malicious code sample can be incorporated into training data for malicious code detection models.