Research notes on artificial intelligence, systems, cybersecurity, and applied mathematics.
by Sanskar Pandey
This article is part of an ongoing research exploration into geometric and topological approaches to behavioral malware detection.
Modern malware detection is largely built around the idea of recognizing malicious artifacts. Traditional antivirus systems rely on signatures: patterns within binaries that uniquely identify known malware families. Even many modern approaches extend this idea by building increasingly sophisticated classifiers over static features extracted from files.
This approach works well when malware remains stable. Unfortunately, modern malware is explicitly designed not to.
Polymorphic and metamorphic malware routinely mutate their code, reorder instructions, encrypt payloads, or dynamically generate new variants. In these environments, the underlying functionality remains the same while the observable binary structure constantly changes. The result is a cat-and-mouse game where defenders chase an ever-growing collection of slightly modified samples.
Even behavioral detection systems often fall into a similar trap. They replace static byte signatures with static behavioral features:
While these features capture more information about runtime behavior, they still treat execution as if it were a static snapshot.
But software execution is not static.
Programs do not simply produce isolated events. They evolve through sequences of states over time.
Figure 1: Conceptual view of behavioral malware detection based on trajectories in behavioral space.
When a program runs, it interacts with the operating system continuously:
These interactions form a temporal sequence of actions rather than a single feature vector.
Instead of representing program behavior as a static point in feature space, we can think of execution as tracing a path through behavioral space over time.
Formally, we can imagine a behavioral state vector:
\[x(t) \in \mathbb{R}^n\]Here, t represents execution time and each dimension of the vector captures a measurable aspect of system activity. That is, each dimension represents some measurable property of system behavior such as system calls, file operations, memory events, network activity, and so on.
For example, a simplified behavioral state vector could look like:
\[x(t) = \begin{bmatrix} \text{process spawn rate} \\ \text{memory execution events} \\ \text{file write count} \\ \text{outbound connections} \\ \text{registry modifications} \end{bmatrix}\]In practice, these dimensions can be derived from system telemetry such as system calls, kernel audit logs, or endpoint monitoring data.
As the program executes, this state changes. Over time, the program traces a trajectory through this space.
This perspective shifts the focus from what the program looks like to how the program moves through behavioral space.
This view suggests a different way to think about malware detection.
Instead of asking:
Does this binary match a known malicious pattern?
we can ask:
Does the trajectory of this program resemble the behavior of malicious systems?
Benign applications tend to exhibit relatively stable behavioral patterns. Web browsers repeatedly perform network requests, rendering tasks, and user interaction loops. System services operate within predictable operational ranges.
Malware, on the other hand, often follows characteristic behavioral chains:
process start
→ document execution
→ script interpreter spawn
→ memory allocation
→ code injection
→ outbound network connection
Example behavioral trace (simplified):
t0: WINWORD.exe start
t1: spawn powershell.exe
t2: powershell allocates RWX memory
t3: powershell injects into explorer.exe
t4: explorer opens outbound TCP connection
Even if the malware binary changes across variants, the behavioral progression often remains structurally similar. In behavioral space, sequences like this form characteristic trajectories usually associated with document-based infection chains.
Even when the underlying code mutates, the structure of the behavior tends to remain similar. The program still needs to escalate privileges, inject processes, establish command-and-control channels, or exfiltrate data.
This observation motivates a simple but powerful idea:
Malware can mutate its code, but it is much harder to mutate the geometry of its behavior.
If we can model and analyze these behavioral trajectories, detection becomes a question of geometric structure rather than static signatures.
If many malware samples produce trajectories with similar behavioral structure, those trajectories may lie on characteristic regions or manifolds within behavioral space.
Small variations in implementation, i.e., instruction reordering, encryption, or code obfuscation, may slightly perturb these trajectories, but the underlying structure often remains similar.
This observation suggests that we should study not just individual behavioral events, but the shape of behavioral trajectories themselves.
Instead of simple classifiers over feature vectors, we can study:
This naturally leads to geometric and topological methods that analyze the shape of behavior, not just the presence of individual events. Topological methods are particularly appealing in adversarial environments because they focus on structural properties of data that remain stable under small perturbations.
In the context of malware, this means that minor variations in execution, introduced intentionally by attackers, may change individual events but often preserve the overall structure of the behavioral trajectory.
In this series, we will explore an architecture for malware detection built around this idea.
At a high level, the approach combines:
Together, these components form a system that treats malware detection as the problem of identifying malicious dynamical systems rather than malicious files.
The perspective of modeling program behavior as trajectories is closely related to several research directions in security and machine learning.
Behavior-based malware detection has long explored modeling execution traces such as system call sequences, process trees, and network activity. Many approaches treat these signals as sequential data and apply statistical or machine learning models to classify malicious activity.
More recently, researchers have begun exploring geometric and topological representations of complex data, particularly in domains where the structure of the data is more informative than individual measurements. Techniques from Topological Data Analysis (TDA), such as persistent homology, provide tools for extracting structural signatures from high-dimensional trajectories and dynamical systems. [4]
These methods have been applied successfully in areas such as dynamical systems analysis, biological data modeling, and anomaly detection in complex systems. The central idea explored in this series is that similar techniques may help characterize the structural geometry of malicious behavior.
Rather than focusing only on individual events, we can analyze the shape of behavioral evolution over time, treating malware as a dynamical process embedded in behavioral space.
At a high level, the detection pipeline can be viewed as a transformation from raw execution telemetry into structural representations of behavior.
Binary Sample
│
▼
Runtime Execution
│
▼
System Telemetry
(process events, system calls, memory activity, network activity)
│
▼
Behavioral Time Series
│
▼
Trajectory in Behavioral Space
x(t) ∈ ℝⁿ
│
▼
Behavioral Manifold Representation
│
▼
Geometric / Topological Analysis
(persistent homology, trajectory structure)
│
▼
Predictive Trajectory Modeling
│
▼
Adaptive Detection & Response
(RL policy / human feedback)
Rather than treating malware detection as a classification problem over files or feature vectors, this architecture treats software execution as a dynamical system whose trajectories can be analyzed geometrically. Each stage progressively transforms low-level system activity into higher-level representations of program behavior, enabling detection systems to analyze the structure of behavioral evolution rather than individual artifacts.
This post introduces the core intuition behind topology-based behavioral detection. In the next parts of this series, we will gradually build the full architecture.
In particular, we will explore:
By the end of the series, we will assemble these ideas into a complete architecture for topology-based malware detection systems.
The central premise remains simple:
Instead of detecting malicious code, we detect the geometry of malicious behavior.
Christos Faloutsos et al. “On the behavior of system call sequences for anomaly detection.” IEEE Symposium on Security and Privacy.
Forrest, Stephanie et al. “A Sense of Self for Unix Processes.” IEEE Symposium on Security and Privacy, 1996.
Edelsbrunner, Herbert and John Harer. Computational Topology: An Introduction. American Mathematical Society, 2010.
Carlsson, Gunnar. “Topology and Data.” Bulletin of the American Mathematical Society, 2009.
Chazal, Frédéric and Michel Glisse. The Structure and Stability of Persistence Modules. Springer, 2016.