Mozi
- Type
- Botnet
- Capabilities
- DDOSBrute forceInitial accessPersistencePrivilege escalationDefense evasionExfiltrationSpoofing
- Delivery
- Phishing
- Platforms
- LinuxIOTNetwork device
Mozi is a peer-to-peer botnet first disclosed in December 2019 that compromises Linux-based Internet of Things and networking devices, particularly SOHO routers, gateways, cameras, and digital video recorders. ARM and MIPS variants are documented. It propagates through weak or default Telnet credentials and exploitation of vulnerable device services, including command-injection flaws that enable payload download and execution.
Mozi uses a custom protocol built on Distributed Hash Tables, resembling BitTorrent DHT communications, to discover peers and distribute commands without relying on a conventional centralized command-and-control server. Infected devices receive instructions, attempt to compromise additional devices, and can serve malware payloads over HTTP. Its capabilities include HTTP, TCP, and UDP DDoS attacks, spam distribution, brute-force attacks, password spraying, data exfiltration, and arbitrary command or payload execution. Later variants also incorporated cryptocurrency-mining functionality.
Mozi implements device-specific persistence on Netgear, Huawei, and ZTE gateways through startup-script modification and other configuration changes. It can attempt privilege escalation through CVE-2015-1328, disable remote-management services, and alter firewall rules to restrict competing access. On devices with IPv4 forwarding enabled, its traffic-interception functionality supports DNS-response spoofing, HTTP redirection, and JavaScript injection. Some binaries deliberately corrupt UPX metadata to obstruct automated unpacking and analysis. Mozi activity declined sharply in 2023.
Associated vulnerabilities
15 CVEs Mallory has correlated with this family across public research and vendor advisories. Each card links to the full Mallory page for that vulnerability.
3 more CVEs associated with this family tracked in Mallory.
Associated threat actors
1 distinct threat actor Mallory has associated with this family across public reporting. Open in Mallory to see the full evidence chain and overlapping campaigns.
"...alongside NETGEAR-MOZI and other router-related flaws. This pattern suggests that the actor was focused on building or expanding botnets..."
Techniques & procedures
35 distinct techniques documented for this family, organized by ATT&CK tactic.
Initial Access
2 techniques
Initial Access
“the botnet spreads via the use of weak and default remote access passwords for targeted devices”
“the botnet spreads via the use of weak and default remote access passwords for targeted devices as well as through multiple public exploits.”
Execution
3 techniques
Execution
[rn] Execute specified command
"A script executes a shell command on the targeted server... downloads and executes malware"; "An injected command directly writes the binary payload to a file and then executes it"
Bot deployment : this is where the bot is deployed into a target system member of the network, for instance through an exploit... Alternatively, DDG uses exploits against Redis, Nexus Repository Manager and Supervisord... Additionally, a number of exploits affecting IoT devices such as CCTV, DVR, NVR and routers are included as a supplemental infection method.
Persistence
4 techniques
Persistence
It places the script file named S95Baby.sh in these folders. The script runs the files /usr/networks or /user/networktmp . It adds the script to /etc/rcS.d and /etc/rc.local in case it lacks privileges.
“the botnet spreads via the use of weak and default remote access passwords for targeted devices”
This part of the MITM functionality is responsible for hijacking HTTP sessions... Some of the spoofing occurs via redirection using the HTTP Location header
Execution of the following commands changes the password and disables the management server for Huawei modem/router devices
Privilege Escalation
3 techniques
Privilege Escalation
It places the script file named S95Baby.sh in these folders. The script runs the files /usr/networks or /user/networktmp . It adds the script to /etc/rcS.d and /etc/rc.local in case it lacks privileges.
In this case, it will try to exploit CVE-2015-1328. Successful exploitation of the vulnerability will grant the malware access to the following folders
“the botnet spreads via the use of weak and default remote access passwords for targeted devices”
Stealth
7 techniques
Stealth
“the observed anti-analysis technique used by the analyzed Mozi samples consists solely of zeroing out the 8 bytes after the ‘UPX!’ magic bytes.”
“Right away we see that we have a UPX packed ELF binary” and “the p_info section of the file appears to be corrupted.”
Change the process name to sshd or dropbear to confuse the victim
“the botnet spreads via the use of weak and default remote access passwords for targeted devices”
Where the automatic unpacking does not work with upx –d tool, even after fixing all the mentioned discrepancies and modified fields, we may attempt to manually extract the unpacked executable image from memory
This part of the MITM functionality is responsible for hijacking HTTP sessions... Some of the spoofing occurs via redirection using the HTTP Location header
Execute system or custom commands
Defense Impairment
4 techniques
Defense Impairment
Execution of the following commands changes the password and disables the management server for Huawei modem/router devices
Some of the most common modifications include: Rewriting the UPX! magic headers ELF magic bytes are modified Copyright string is modified Section header names are modified Extra junk bytes added throughout the binary
It deletes the file /home/httpd/web_shell_cmd.gch ... deleting it prevents future attacks. It executes the following commands. These disable Tr-069 and its ability to connect to auto-configuration server (ACS).
Strings from the unpacked sample include commands such as “iptables -I OUTPUT -p udp ... -j ACCEPT” and NAT/INPUT rules permitting UDP traffic.
Credential Access
5 techniques
Credential Access
“The Mozi botnet has been leveraging vulnerable Internet of Things (IoT) devices to launch campaigns that can take advantage of the force multiplication provided by a botnet (... brute-force, password spraying, etc.).”
“The Mozi botnet has been leveraging vulnerable Internet of Things (IoT) devices to launch campaigns that can take advantage of the force multiplication provided by a botnet (... brute-force, password spraying, etc.).”
Execution of the following commands changes the password and disables the management server for Huawei modem/router devices
By infecting routers, they can perform man-in-the-middle (MITM) attacks—via HTTP hijacking and DNS spoofing
DNS spoofing Mozi receives a very simple list of DNS names which are then spoofed... Each DNS request is answered with the spoofed IP.
Discovery
4 techniques
Discovery
perform reconnaissance, and then move laterally to compromise higher value targets
Adversaries can search the internet for vulnerable devices via scanning tools like Shodan
The main instructions include: ... Collecting Bot Information ... [idp] report bot info
A specific check is conducted for the existence of the /overlay folder... A specific check is conducted for the existence of the /usr/local/ct folder... It scans for .sh files in the filesystem
Lateral Movement
2 techniques
Lateral Movement
Mozi uses weak Telnet credential brute-forcing as a way to propagate... DDG’s method of infection involves brute-forcing the root user password against SSH servers... FritzFrog... relies on SSH credential brute-forcing as its propagation mechanism.
"attacks attempting to exploit a Realtek Jungle SDK remote code execution vulnerability (CVE-2021-35394)... Remote unauthenticated attackers could leverage this vulnerability to achieve arbitrary command execution"
Collection
2 techniques
Collection
By infecting routers, they can perform man-in-the-middle (MITM) attacks—via HTTP hijacking and DNS spoofing
DNS spoofing Mozi receives a very simple list of DNS names which are then spoofed... Each DNS request is answered with the spoofed IP.
Command and Control
6 techniques
Command and Control
The Mozi botnet communicates using a Distributed Hash Table (DHT) which records the contact information for other nodes in the botnet. This is the same serverless mechanism used by file sharing peer-to-peer (P2P) clients.
"Advanced URL Filtering and DNS Security can block the command and control (C2) domain and malware hosting URLs"; "The botnet client can accept the following command and control (C2) channel commands"
“The Mozi botnet communicates using a Distributed Hash Table (DHT) which records the contact information for other nodes in the botnet.”
Threat actors use peer-to-peer (P2P) botnets like these to build a platform that can later be used to carry out malicious operations... The need for increased takedown resistance eventually drove botnet operators to adapt and explore peer-to-peer approaches. | The Mozi malware family makes use of a custom P2P protocol built on top of Distributed Hash Tables (DHT) in order to build a network of infected nodes.
“The compromised device starts an HTTP server that hosts a Mozi payload on a random TCP port.”
This part of the MITM functionality is responsible for hijacking HTTP sessions... Some of the spoofing occurs via redirection using the HTTP Location header
Impact
3 techniques
Impact
killall i .i mozi.m Mozi.m mozi.a Mozi.a kaiten Nbrute minerd /bin/busybox || pkill -9 -f i .i mozi.m Mozi.m mozi.a Mozi.a sora phantom zero kaiten Nbrute minerd /bin/busybox
Mozi started out as a P2P family performing DDoS attacks for profits, and later added a mining component.
“The Mozi botnet has been leveraging vulnerable Internet of Things (IoT) devices to launch campaigns that can take advantage of the force multiplication provided by a botnet (Distributed Denial of Service (DDoS)...)”
Observables
89 indicators attributed across vendor reports, sandbox runs, and researcher write-ups. Values are masked here and available in full in Mallory.
Recent activity
47 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.