arXiv:2608.30383cs.CRAug 2026

Manuscript Offprint

arXiv:2608.30383

Using Hyper-V Sockets for Real-time Data Extraction from a Malware Analysis Sandbox

István-Attila Császár, Radu-Marian Portase, Adrian Coleşa, Adrian Groza

István-Attila CSÁSZÁR

Technical University of

Cluj-Napoca,

Bitdefender

Cluj-Napoca, Romania

istvan.csaszar@cs.utcluj.ro

Radu-Marian PORTASE

Technical University of

Cluj-Napoca,

Bitdefender

Cluj-Napoca, Romania

rportase@bitdefender.com

Adrian COLESA

Technical University of

Cluj-Napoca,

Cluj-Napoca, Romania

adrian.colesa@cs.utcluj.ro

Adrian GROZA

Technical University of

Cluj-Napoca,

Cluj-Napoca, Romania

adrian.groza@cs.utcluj.ro

Abstract—We present how Hyper-V sockets can be used as a real-time communication channel for a malware analysis sandbox. We show that, compared to WinSock TCP sockets, Hyper-V sockets are not subject to TCP/IP-layer blocking and are not enumerated by common TCP connection listing tools. We compare the throughput of the two communication channels as a function of buffer size.

Index Terms—real-time, sandbox, malware, monitoring

I. INTRODUCTION

According to the AV-Test institute, more than 120.000 new Windows malware samples registered every day [1]. Without automated analysis, researchers have no chance of keeping up with the constant stream of new malware. Malware sandboxes have a critical role in analyzing today's huge amount of malware, allowing researchers to quickly triage new samples and focus their attention on the ones which present novel behavior and/or lack detection.

A malware analysis sandbox provides an isolated environment in which malware samples can be executed to record their behavior for analysis. Examples of recorded behavior include processes created, modules loaded, file system activity (files opened, created, read, written, etc.), registry activity (Windows specific), network activity and relevant system APIs called.

Ransomware continues to remain a significant threat, accounting for over 83% of malware types in ENISA's 2025 report [2]. Due to the nature of ransomware, analyzing it in a sandbox presents some unique challenges: encryption of trace files and system tampering.

Since the main goal of ransomware is to encrypt files, there is a significant chance that the behavior trace files that are saved inside the virtual machine (i.e. to be extracted later) will be encrypted by the ransomware. While trace files can be protected from encryption, for example, by blocking destructive file operations that target them, the correct implementation of such protection mechanisms is not trivial. If the sandbox runs the ransomware with an active internet connection, the ransomware might also exfiltrate the contents of the trace files, which may be undesirable.

Recent trends also show that ransomware may tamper with the system in order to maximize the chances of successful encryption and hinder recovery. Common techniques include: termination of backup and security services, using vulnerable drivers to terminate security solutions, forcing the system to reboot in safe mode, encrypting recovery or even boot partitions. This means that a sandbox that relies on saving behavior traces files in the virtual machine and copying them post-execution might experience data loss because of system tampering (i.e. the file transfer component of the sandbox is stopped by the ransomware).

We initially built a sandbox based on Hyper-V, a type 1 hypervisor that is part of the Microsoft Windows operating system. To copy files to and from the sandbox virtual machine, we used Powershell Direct, a feature of Hyper-V which allows running arbitrary Powershell commands on a Windows guest virtual machine (VM) without attaching a virtual network adapter [3].

When running ransomware with the Powershell-based setup, we found that in some cases the ransomware encrypted the trace files, making them unusable, and in others stopped the Powershell Direct service, making it impossible to retrieve the files. Knowing that Powershell Direct works without relying on a network connection, we started to investigate the communication channel Powershell Direct uses and whether it could be used as a real-time communication method to retrieve events from the guest agent without writing them to disk.

The main insight is that Powershell Direct is implemented through a service running on each Windows guest VM that uses a Hyper-V socket to communicate with a Powershell instance on the host. Once we found out that the Hyper-V sockets are available for any application to use [4], we set out to investigate if this could be a suitable method to implement communication between the guest agent and the host for a malware sandbox. More precisely, we set out to evaluate the following aspects:

RQ1RQ_{1} Throughput - Can the connection sustain real-time communication between the guest and the host?

RQ2RQ_{2} Visibility - What methods are available to detect Hyper-V socket connections?

RQ3RQ_{3} Resilience - Can the connection be blocked, redirected or closed?

The contributions are:

• We show how to build a malware sandbox using Hyper-V that does not rely on traditional data extraction methods (disk based or network based).

• We measure the throughput of Hyper-V sockets and WinSock TCP sockets as a function of the buffer size used to send data, showing that Hyper-V sockets are also suitable for real-time communication.

• We show how to detect the presence of Hyper-V and WinSock TCP based connections, and the effect of starting the agent as a PPL (Protected Process Light) on the visibility of sockets.

• We systematize known methods that can be used to disrupt WinSock TCP socket based communication and show that they don’t affect Hyper-V sockets.

The remainder of the paper is structured as follows. Section II presents the key aspects to consider when building a malware sandbox. Section III presents the design and key aspects of implementation. Section IV shows the results of the throughput, visibility, and resilience evaluations. Section V shows related work, comparing our solution with the most relevant papers. Section VI concludes the paper.