P2PInfect
- Type
- Worm
- Capabilities
- Initial accessScanningBrute forceLateral movementPersistenceDefense evasion
- Delivery
- Exploit kit
- Platforms
- LinuxWindowsCloud
P2PInfect is a Rust-based, self-propagating worm that enrolls compromised systems into a decentralized peer-to-peer botnet. First discovered in July 2023, it supports Linux and Windows, with variants targeting x86-64, ARM, and MIPS architectures. Its principal targets are internet-exposed Redis deployments and poorly secured SSH services. Infections have also affected Google Kubernetes Engine clusters through exposed Redis instances.
Propagation mechanisms include exploitation of CVE-2022-0543, a Lua sandbox escape affecting Debian-packaged Redis and derived distributions, abuse of Redis replication and module-loading functionality, and SSH password brute-forcing or spraying. Later activity has also incorporated exploitation of CVE-2025-11953, known as Metro4Shell, against React Native Metro development servers. After compromise, infected hosts scan for additional targets, exchange peer information, and distribute binaries and updates through the botnet. Peer communications use encrypted connections and variable ports, reducing dependence on centralized infrastructure and complicating disruption.
P2PInfect employs monitoring components that update or revive its main payload. Defense-evasion features include UPX packing, obfuscated PowerShell, anti-debugging measures, disabled core dumps, runtime modification of auxiliary executables, and self-deletion of initial components. Some variants include user-mode rootkit functionality. Windows infections can modify firewall rules to restrict legitimate Redis access while permitting botnet communications.
The botnet has delivered Monero mining software and ransomware, although some infections remain dormant for extended periods without executing secondary payloads. Persistent infections in managed Kubernetes environments have lasted several months. No established attribution to a named threat actor is available.
Associated vulnerabilities
3 CVEs Mallory has correlated with this family across public research and vendor advisories. Each card links to the full Mallory page for that vulnerability.
Techniques & procedures
37 distinct techniques documented for this family, organized by ATT&CK tactic.
Initial Access
2 techniques
Initial Access
Then ... the script opens a communication port for the threat actor to access the compromised instance. This is a form of persistence, allowing the threat actors to maintain access to the infected host and keep it operable.
“P2PInfect activity targeting internet-exposed and exploiting misconfigured Redis instances... The campaign exploits CVE-2022-0543.”
Execution
6 techniques
Execution
“uses mechanisms such as cron jobs and SSH authorized keys for persistence.”
To infect new targets, P2PInfect executes a bruteforce attack against the device with the SSH server and, after a successful login, different commands are executed to download and run the malware.
“deploys ELF-based malware, establishes reverse shells.”
“attackers abusing Redis replication and module-loading capabilities to achieve remote code execution.”
The P2PInfect worm infects vulnerable Redis instances by exploiting the Lua sandbox escape vulnerability, CVE-2022-0543.
Attackers connect to the exposed service and issue the SLAVEOF command, turning the legitimate Redis node into a follower of a malicious server under their control. This tricks the node into loading arbitrary modules from attacker infrastructure...
Persistence
4 techniques
Persistence
“uses mechanisms such as cron jobs and SSH authorized keys for persistence.”
“uses mechanisms such as cron jobs and SSH authorized keys for persistence.”
Then ... the script opens a communication port for the threat actor to access the compromised instance. This is a form of persistence, allowing the threat actors to maintain access to the infected host and keep it operable.
P2Pinfect has been observed in the wild abusing the SLAVEOF command to turn discovered open nodes into followers of the attacker’s server, thereby gaining code execution.
Privilege Escalation
3 techniques
Privilege Escalation
“uses mechanisms such as cron jobs and SSH authorized keys for persistence.”
RediShell (CVE-2025-49844) is a critical RCE that allows an authenticated user to bypass the Lua sandbox by sending a maliciously crafted script to manipulate the garbage collector, thereby granting native code execution.
“uses mechanisms such as cron jobs and SSH authorized keys for persistence.”
Stealth
10 techniques
Stealth
Some variants of the P2Pinfect clients also have usermode rootkit capabilities.
The PowerShell script leveraged the encode command to obfuscate the communication initiation.
Interestingly, the latest variants of this malware tend to utilize a particular version of the UPX packer: 4.0.2.
Finally, lots of main ELF payloads are distributed inside wrapper ELF files that just print a famous “Hello, World!” message pretending this is its only functionality.
The firewall rule is named Microsoft Sync.
“The Rust-based P2PInfect worm further supports ... anti-forensics.”
The Monitor is dumped to C:\Users\username\AppData\Local\Temp\cmd.exe.
Once a node was enrolled in the P2P mesh, it stayed relatively quiet, a behavior the researchers described as dormant. The bots appeared to be waiting, ready to receive tasks from operators at any time.
Attackers connect to the exposed service and issue the SLAVEOF command, turning the legitimate Redis node into a follower of a malicious server under their control. This tricks the node into loading arbitrary modules from attacker infrastructure...
In addition to disabling core dumps through the 'setrlimit' syscall and the process debugging protection noted by Cado Security
Defense Impairment
1 technique
Defense Impairment
One of the first operations performed by the PowerShell command is to configure the local system firewall to block legitimate access to or from the compromised Redis application.
Credential Access
3 techniques
Credential Access
Once the device is infected it's ready to spread to other devices. To infect new targets, P2PInfect executes a bruteforce attack against the device with the SSH server and, after a successful login, different commands are executed to download and run the malware.
“The Rust-based P2PInfect worm further supports ... SSH brute force.”
P2Pinfect primarily spreads by exploiting Redis vulnerabilities and also includes a basic SSH password sprayer.
Discovery
5 techniques
Discovery
“The Rust-based P2PInfect worm further supports network scanning.”
The botnet used this network to distribute payloads, gather information about the infected environment, and maintain communication without relying on a centralized command server.
To find the memory to be modified inside the “template bash” executable to make it ready to be executed, P2PInfect looks for two markers “thisisport” and “password12345678” to dynamically replace them with two random values.
Once a node was enrolled in the P2P mesh, it stayed relatively quiet, a behavior the researchers described as dormant. The bots appeared to be waiting, ready to receive tasks from operators at any time.
In addition to disabling core dumps through the 'setrlimit' syscall and the process debugging protection noted by Cado Security
Lateral Movement
2 techniques
Lateral Movement
A version of this malware that utilizes SSH protocol for propagation was intercepted by our chain of globally distributed honeypots on November 6, 2023.
“The Rust-based P2PInfect worm further supports ... SSH brute force.”
Command and Control
6 techniques
Command and Control
The malware is capable of performing Peer-to-Peer (P2P) communications without relying on a single Command and Control server (C&C) to propagate attackers’ commands.
The malware is capable of performing Peer-to-Peer (P2P) communications without relying on a single Command and Control server (C&C) to propagate attackers’ commands.
P2Pinfect is a self-propagating malware strain that combines worm-like spreading capabilities with a decentralized botnet architecture. This peer-to-peer (P2P) architecture makes it highly resilient to sinkholing and infrastructure takedowns.
P2PInfect uses its P2P network to distribute follow-up malware to newly infected systems or cloud instances.
after a successful login, different commands are executed to download and run the malware
P2PInfect peers’ communication occurs over non-standard ports.
Impact
2 techniques
Impact
While our telemetry indicated that no second-stage payload was ever executed, this botnet has been observed in the wild to remain dormant for extended periods before delivering ransomware and crypto miners.
“The Rust-based P2PInfect worm further supports ... cryptocurrency mining.”
Observables
245 indicators attributed across vendor reports, sandbox runs, and researcher write-ups. Values are masked here and available in full in Mallory.
Recent activity
16 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.