![]() |
EpiRootkit
By STDBOOL
|
The rootkit integrates a complete file transfer mechanism between the attacking machine and the victim machine. This system allows exfiltrating and injecting files quickly, simply, and discreetly. The whole system is controllable with a few clicks from the graphical interface. Two functionalities are offered:
Files can be downloaded from the victim machine to the attacker.
The system relies on two complementary components:
Files can be uploaded from the attacker to the victim machine.
The protocol is simple:
upload or download),## ProtocolREADY,Transfers use hexadecimal format to ensure maximum network compatibility while simplifying analysis and processing.
The upload part of the file transfer system allows choosing a local file and specifying its target path on the victim. Once validated, the Flask web interface:
upload <remote_path> <size> command,READY keyword from the rootkit.Each step is controlled and confirmed via a message system.
Upon receiving the upload command, the rootkit:
READY to the Flask interface,handle_upload_chunk() in several pieces until the announced size is reached.Once the file is complete, it's written to disk, and resources are automatically cleaned up.
Reverse upload (download) is triggered from the graphical interface through the file explorer. Once launched:
SIZE <bytes> message,READY,downloads).During a download, the rootkit:
READY command to launch transfer to the attacker.Everything is done silently, without visible logs or traces in user file systems.
The /explorer page of the web interface allows remotely navigating the victim's file system, relying on successive ls commands sent via the rootkit. Navigation is not persistent: at each request, a command is sent to the rootkit to list the current directory content. It's only when using the reverse shell that command sending becomes persistent.
The current path is maintained on the interface side (frontend) to reconstruct a coherent navigation experience. Each click on a folder sends a new ls <path> command to the rootkit, which returns the list of files or subdirectories present at that location.
This functionality allows the attacker to:
download) or upload to a specific directory,A history of successive file transfers is also available.
All network exchanges occur via the already encrypted TCP channel (AES). Using hexadecimal format avoids binary transport problems while simplifying processing on the rootkit side. Transfers are atomic: one file at a time, with size control, acknowledgment of receipt, and strict memory management.