Skip to main content
Mallory
Malware2 associated actors9 associated CVEs

Necro

Tracked since Dec 2, 2025 · Updated 2 months ago
Trending this weekNot trendingOutside this week’s top 100
Mention activity · 30 daysNo mention activity in the last 30 days.
Vulns9Associated
Actors2Associated
ATT&CK49Techniques
IOCs192Tracked
Type
Botnet
Capabilities
Session hijackingKeyloggingExfiltrationPersistenceLateral movementDefense evasionScanningBrute forceProcess injectionDDOSSpoofing
Delivery
Landing pageCracked software
Platforms
WindowsLinux

Necro is a Python-based botnet, also known as Necromorph, N3Cr0m0rPh, and FreakOut, that targets Windows and Linux systems. First identified in 2015, it is associated with the Keksec threat group. Its principal activities include distributed denial-of-service attacks, cryptocurrency mining, malware deployment, and traffic interception. It is distinct from the Android Trojan dropper also called Necro.

Necro propagates through network scanning, SSH and Telnet weak-password attacks, exploitation of vulnerable internet-facing applications, and SMB-based propagation. Exploited products include TerraMaster TOS, Zend Framework, Laravel, Oracle WebLogic, Liferay Portal, and VMware vCenter Server. Some Windows variants incorporate EternalBlue and EternalRomance exploits, while others use credential-based remote service creation. Payloads are distributed as Python scripts with standalone interpreters or as PyInstaller-packaged Windows and Linux executables.

Operators control Necro through IRC-based command-and-control communications. Variants use Tor proxies, domain generation algorithms, encrypted communications, and polymorphic Python code to resist detection and infrastructure blocking. Necro supports reverse shells, file download and execution, configurable scanning, packet sniffing, ARP spoofing, and multiple DDoS methods, including UDP, SYN, HTTP, Slowloris, and amplification attacks. It establishes startup persistence on both supported operating systems. Windows variants inject the r77 user-mode rootkit into other processes to conceal malicious activity.

Necro deploys XMRig miners and can install additional botnet payloads such as Gafgyt_tor. On compromised Linux web servers, it modifies web files to inject malicious JavaScript into pages served to visitors. Associated browser payloads support cryptocurrency mining, keylogging, form-data collection, cookie and clipboard theft, arbitrary JavaScript execution, and browser-based DDoS attacks. Its traffic-sniffing functionality also forwards captured network data to attacker infrastructure.

Is this in your environment?See whether this family's indicators match your telemetry and which of your assets are exposed to the CVEs associated with it.
Check your exposure
Associated CVEs

Associated vulnerabilities

9 CVEs Mallory has correlated with this family across public research and vendor advisories. Each card links to the full Mallory page for that vulnerability.

CVE-2021-3129via netlab 360Exploited in the wildUnauthenticated RCE in Laravel Ignition debug modeNecro scans for and propagates through Laravel RCE (CVE-2021-3129); its exploit establishes a reverse shell that downloads a Bash script, Necro, Gafgyt_tor, and a mining program. | A new variant of Necro resumed spreading after a month of silence, adding Windows targeting, rootkit-based concealment, Tor C2 and Tor-based DDoS, subdomain-DGA C2 generation, and web-page JavaScript injection.View vulnerability →Source ↗
CVE-2021-3007via netlab 360Exploited in the wildInsecure Deserialization in Laminas HTTP and Zend FrameworkNecro resumed spreading using the previous Zend RCE (CVE-2021-3007) alongside other vulnerabilities. | A new variant of Necro resumed spreading after a month of silence, adding Windows targeting, rootkit-based concealment, Tor C2 and Tor-based DDoS, subdomain-DGA C2 generation, and web-page JavaScript injection.View vulnerability →Source ↗
CVE-2020-14882via netlab 360Exploited in the wildUnauthenticated Server Takeover in Oracle WebLogic Administration ConsoleNecro exploits WebLogic RCE (CVE-2020-14882) with separate Linux and Windows exploit chains that download and execute Necro and mining payloads. | A new variant of Necro resumed spreading after a month of silence, adding Windows targeting, rootkit-based concealment, Tor C2 and Tor-based DDoS, subdomain-DGA C2 generation, and web-page JavaScript injection.View vulnerability →Source ↗
CVE-2020-35665via netlab 360Exploited in the wildUnauthenticated OS Command Injection in TerraMaster TOS CSV CreationNecro resumed spreading using the previous TerraMaster RCE (CVE-2020-35665) alongside other vulnerabilities. | A new variant of Necro resumed spreading after a month of silence, adding Windows targeting, rootkit-based concealment, Tor C2 and Tor-based DDoS, subdomain-DGA C2 generation, and web-page JavaScript injection.View vulnerability →Source ↗
CVE-2020-28188via vblocalhostExploited in the wildUnauthenticated OS Command Injection in TerraMaster TOSThe three more popular exploits integrated by Necro can be seen in Figures 9–11... 1. TerraMaster RCE: CVE-2020-28188 | The year-long attack campaign can be divided into two phases; high-frequency attacks are maintained until December 2020, and resumed in January 2021, when Keksec starts spreading the brand new malware family Necro.View vulnerability →Source ↗
CVE-2021-21972via vblocalhostExploited in the wildUnauthenticated Remote Code Execution in VMware vCenter Server vROps Plugin2021.3.20 CVE-2021-21972 2021.2.27 VMware_vCenterServer Necro | The year-long attack campaign can be divided into two phases; high-frequency attacks are maintained until December 2020, and resumed in January 2021, when Keksec starts spreading the brand new malware family Necro.View vulnerability →Source ↗
CVE-2020-7961via vblocalhostExploited in the wildRemote Code Execution in Liferay Portal JSONWS2021.1.8 CVE-2020-7961 2020.7 Liferay Portal Necro | The year-long attack campaign can be divided into two phases; high-frequency attacks are maintained until December 2020, and resumed in January 2021, when Keksec starts spreading the brand new malware family Necro.View vulnerability →Source ↗
CVE-2017-0144via talosintelligence otherExploited in the wildEternalBlueThe version released on May 18 also included Python versions of EternalBlue (CVE-2017-0144) and EternalRomance (CVE-2017-0147) exploits with a Windows download command line as the payload. | A newly discovered malware campaign utilizing the Necro Python bot shows this actor is adding new functionality and improving its chances of infecting vulnerable systems.View vulnerability →Source ↗
CVE-2017-0147via talosintelligence otherExploited in the wildWindows SMB Information Disclosure VulnerabilityThe version released on May 18 also included Python versions of EternalBlue (CVE-2017-0144) and EternalRomance (CVE-2017-0147) exploits with a Windows download command line as the payload. | A newly discovered malware campaign utilizing the Necro Python bot shows this actor is adding new functionality and improving its chances of infecting vulnerable systems.View vulnerability →Source ↗
Threat actors

Associated threat actors

2 distinct threat actors Mallory has associated with this family across public reporting. Open in Mallory to see the full evidence chain and overlapping campaigns.

View more details →
Keksec

2021 – Spytech Necro is an updated version of Necro python malware with significant updates to the C2 protocol and additional exploits.

via cyfirma blogcyfirma.com
keksec group

Further analysis revealed that the family is closely related to the Necro family we made public in January, and is behind the same group of people, the so-called keksec group.

via netlab 360blog.netlab.360.com
MITRE ATT&CK

Techniques & procedures

49 distinct techniques documented for this family, organized by ATT&CK tactic.

Reconnaissance

1 technique
T1595.002Vulnerability ScanningEvidence1

We can see that Keksec launched scans and attacks on targets across the network almost non-stop. Our honeypots see new variants and exploits all the time, with the exception of some occasional breaks. When a new exploit is introduced, the scans increase significantly.

Initial Access

4 techniques
T1078Valid AccountsEvidence1

Once an IP address is generated, the bot will connect to a list of ports and attempt to spread either by using a hardcoded list of SSH credentials and issuing a remote command if a login attempt is successful.

T1189Drive-by CompromiseEvidence1

Necro’s goal in infecting web files is to spread JS Bot (Cloud9). The bot is loaded when the user accesses an infected page through a browser.

T1190Exploit Public-Facing ApplicationEvidence4

Necro spreads by exploiting TerraMaster RCE (CVE-2020-35665), Zend RCE (CVE-2021-3007), Laravel RCE (CVE-2021-3129), and WebLogic RCE (CVE-2020-14882).

T1195Supply Chain CompromiseEvidence1

The case of CamScanner showed that an app’s legitimate behavior can be supplemented with malicious functions by updating its code for handling advertising.

Execution

6 techniques
T1059Command and Scripting InterpreterEvidence2

python .benchmark.py||python2 .benchmark.py||python2.7 .benchmark.py||./.benchmark||./.benchmark.py &

T1059.001PowerShellEvidence2

The Windows exploit uses Powershell, which first downloads the packaged Python 2.7 executable (py.exe), then downloads and executes Necro (setup.py).

T1059.004Unix ShellEvidence1

The Laravel exploit uses a reverse shell to first download a bash script. The WebLogic Linux exploit uses bash, which downloads and executes both Necro (setup.py) and the mining program.

T1059.006PythonEvidence2

Developed in Python to target dual systems: Necro

T1059.007JavaScriptEvidence1

Necro traverses '*.js', '*.html', '*.htm', '*.php' files and inserts code that loads campaign.js from ublock-referer.dev.

T1203Exploitation for Client ExecutionEvidence2

the other one utilizes an 1-day vulnerability (CVE-2020-35665)... Version 2 ... include the Zend Framework (known as CVE-2021-3007).

Persistence

5 techniques
T1037Boot or Logon Initialization ScriptsEvidence1

Persistence is ensured by modifying the /etc/rc.local script to include commands to launch the bot when the system is booted.

T1078Valid AccountsEvidence1

Once an IP address is generated, the bot will connect to a list of ports and attempt to spread either by using a hardcoded list of SSH credentials and issuing a remote command if a login attempt is successful.

T1543Create or Modify System ProcessEvidence1

The exploitation function of this sample does not contain EternalBlue and EternalRomance but attempts to connect over SMB (port 445) and create a service remotely to download and run the main bot file.

T1547.001Registry Run Keys / Startup FolderEvidence2

Finally, Necro will register the bootstrap item to SOFTWARE\Microsoft\Windows\CurrentVersion\Run.

T1556Modify Authentication ProcessEvidence1

On Linux, the bot first changes the DNS resolver configuration to point to Cloudflare DNS servers, 1.0.0.1 and 1.1.1.1, potentially to avoid the detection of its activity in the local DNS server logs.

Privilege Escalation

5 techniques
T1037Boot or Logon Initialization ScriptsEvidence1

Persistence is ensured by modifying the /etc/rc.local script to include commands to launch the bot when the system is booted.

T1055Process InjectionEvidence3

Necro will then load the rootkit using a piece of shellcode using process injection from another open source project, sRDI; the code calls OpenProcess, VirtualAllocEx, WriteProcessMemory, and CreateRemoteThread.

T1078Valid AccountsEvidence1

Once an IP address is generated, the bot will connect to a list of ports and attempt to spread either by using a hardcoded list of SSH credentials and issuing a remote command if a login attempt is successful.

T1543Create or Modify System ProcessEvidence1

The exploitation function of this sample does not contain EternalBlue and EternalRomance but attempts to connect over SMB (port 445) and create a service remotely to download and run the main bot file.

T1547.001Registry Run Keys / Startup FolderEvidence2

Finally, Necro will register the bootstrap item to SOFTWARE\Microsoft\Windows\CurrentVersion\Run.

Stealth

7 techniques
T1014RootkitEvidence4

Necro downloads x86.dll or x64.dll, corresponding to the open-source r77-rootkit project, which hides files, directories, processes, registry items, connections, and other entities.

T1027Obfuscated Files or InformationEvidence6

Necro implemented a code morphing algorithm based on the abstract syntax tree (AST), achieving randomized object names and broader obfuscation; samples had a reported VT detection rate of 0.

T1027.002Software PackingEvidence1

最新的2个版本为了确保能在没有Python2的受害机器上执行,会同时分发使用PyInstaller打包过的Python程序。

T1036MasqueradingEvidence2

A very traditional technique on Linux systems is to use random strings to override argv parameters and prctl(PR_SET_NAME,buf) to change the process name and start parameters in order to disguise the process.

T1055Process InjectionEvidence3

Necro will then load the rootkit using a piece of shellcode using process injection from another open source project, sRDI; the code calls OpenProcess, VirtualAllocEx, WriteProcessMemory, and CreateRemoteThread.

T1078Valid AccountsEvidence1

Once an IP address is generated, the bot will connect to a list of ports and attempt to spread either by using a hardcoded list of SSH credentials and issuing a remote command if a login attempt is successful.

T1564.001Hidden Files and DirectoriesEvidence1

Necro calls SetFileAttributesW on USERPROFILE\$6829.exe with FILE_ATTRIBUTE_HIDDEN.

Defense Impairment

1 technique
T1556Modify Authentication ProcessEvidence1

On Linux, the bot first changes the DNS resolver configuration to point to Cloudflare DNS servers, 1.0.0.1 and 1.1.1.1, potentially to avoid the detection of its activity in the local DNS server logs.

Credential Access

9 techniques
T1040Network SniffingEvidence5

Packet sniffing is one of the more favoured features of Keksec, and the code can be seen in all three families. The basic function is to capture TCP traffic after filtering out some specified ports and IPs, and to send the remaining data to the C2.

T1056Input CaptureEvidence1

Apart from installing miner code, the JavaScript-based bot contains additional functionality to accept commands from the C2 server and it may be used to steal data from the clipboard, by logging keystrokes and launching DoS attacks.

T1056.001KeyloggingEvidence1

The malicious JavaScript monitors events and reports data through /l.php to upload keyboard records.

T1110Brute ForceEvidence5

The scanners used by Keksec are mainly telnet and SSH weak password scan and exploit scan.

T1110.001Password GuessingEvidence1

After receiving the scan command, the built-in weak password brute force starts... SSH weak passwords are constantly updated by version upgrades, and new weak passwords are added to replace some of the less effective ones.

T1539Steal Web Session CookieEvidence1

The JavaScript command "cookie" sends back cookie data through /c.php.

T1556Modify Authentication ProcessEvidence1

On Linux, the bot first changes the DNS resolver configuration to point to Cloudflare DNS servers, 1.0.0.1 and 1.1.1.1, potentially to avoid the detection of its activity in the local DNS server logs.

T1557Adversary-in-the-MiddleEvidence1

比较有意思的Necro还支持ARP投毒和网络流量嗅探。ARP欺骗是为了把受害者机器伪装成网关

T1557.002ARP Cache PoisoningEvidence1

Necro also supports ARP spoofing and network traffic sniffing. ARP spoofing is designed to disguise the victim machine as a gateway

Discovery

2 techniques
T1040Network SniffingEvidence5

Packet sniffing is one of the more favoured features of Keksec, and the code can be seen in all three families. The basic function is to capture TCP traffic after filtering out some specified ports and IPs, and to send the remaining data to the C2.

T1046Network Service DiscoveryEvidence3

Necro first tries to install the paramiko library on the device, and if it succeeds, it adds port 22 to the list of scanned ports... Necro added the SMB scan code in one of its versions to achieve the function of horizontal propagation in the intranet.

Lateral Movement

3 techniques
T1021Remote ServicesEvidence1

...brute-forcing passwords over SSH... the bot will try to use one of the built-in exploits or log in using a hardcoded list of SSH credentials.

T1021.002SMB/Windows Admin SharesEvidence1

Necro added the SMB scan code in one of its versions to achieve the function of horizontal propagation in the intranet.

T1570Lateral Tool TransferEvidence1

Keksec not only enriches it functionality with a lot of references to third-party code, but also delivers the complete open-source project directly to the target device to complete the corresponding functionality.

Collection

5 techniques
T1056Input CaptureEvidence1

Apart from installing miner code, the JavaScript-based bot contains additional functionality to accept commands from the C2 server and it may be used to steal data from the clipboard, by logging keystrokes and launching DoS attacks.

T1056.001KeyloggingEvidence1

The malicious JavaScript monitors events and reports data through /l.php to upload keyboard records.

T1115Clipboard DataEvidence1

The JavaScript command "clipboard" sends back clipboard content through /cb.php.

T1557Adversary-in-the-MiddleEvidence1

比较有意思的Necro还支持ARP投毒和网络流量嗅探。ARP欺骗是为了把受害者机器伪装成网关

T1557.002ARP Cache PoisoningEvidence1

Necro also supports ARP spoofing and network traffic sniffing. ARP spoofing is designed to disguise the victim machine as a gateway

Command and Control

10 techniques
T1071Application Layer ProtocolEvidence3

Keksec’s malware mainly uses Gafgyt and IRC protocols to send commands.

T1071.001Web ProtocolsEvidence2

The IRC protocol is the most widely used protocol in Keksec, and is supported by the Tsunami, Necro and DarkIRC families.

T1090ProxyEvidence2

We found Tor proxy being used to communicate with the C2 in both Gafgyt and Necro.

T1090.003Multi-hop ProxyEvidence1

Necro supports Tor for C2; its code includes multiple Tor proxy IP addresses and an onion-service C2 address.

T1105Ingress Tool TransferEvidence7

Downloaded bash scripts download and execute another script malware.sh, Gafgyt_tor, and a mining program; Windows PowerShell downloads py.exe and setup.py.

T1219Remote Access ToolsEvidence1

This threat demonstrates several techniques of the MITRE ATT&CK framework, most notably ... Remote Access Software - T1219.

T1568Dynamic ResolutionEvidence2

In its historical versions Necro used DGA to evade C2 interception.

T1568.002Domain Generation AlgorithmsEvidence3

The new version of Necro updated the DGA mechanism, using DGA to generate subdomains, and then with dynamic domain names to generate the final C2 domain name.

T1571Non-Standard PortEvidence1

This threat demonstrates several techniques of the MITRE ATT&CK framework, most notably ... Non-Standard Port - T1571.

T1573Encrypted ChannelEvidence2

On January 20, 2021, in the latest version 3 sample the authors made another change to the DGA algorithm, modifying the seeds from 3 to 4096, and also started using SSL to encrypt the communication data.

Exfiltration

1 technique
T1041Exfiltration Over C2 ChannelEvidence2

The malware's core functionality enables operators to... sniff and exfiltrate network traffic...

Impact

4 techniques
T1496Resource HijackingEvidence3

Necro tampers with web service pages to perform browser mining; the injected page loads a mining JavaScript script from cloud-miner.de.

T1498Network Denial of ServiceEvidence4

Necro integrates a Tor proxy-based DDoS attack method, torflood; other JavaScript commands issue repeated POST requests, image loads, and iframe loads to DDoS targets.

T1499Endpoint Denial of ServiceEvidence2

从这些命令串可以看出Necro是一个用于DDoS攻击的botnet,C2协议基于IRC,支持的攻击方式既包括常见的udpflood、synflood、slowloris、httpflood这些,也包括在botnet中不常见的amp反射攻击。

T1565Data ManipulationEvidence2

We found that Necro can infect web files (.js, .html, .htm, .php) on the target device... After receiving the infection command, it inserts a JS code, hxxp[:]//ublock-referer.dev/campaign.js, into the file.

Indicators of compromise

Observables

192 indicators attributed across vendor reports, sandbox runs, and researcher write-ups. Values are masked here and available in full in Mallory.

View all in app →
Indicator values are available in Mallory. Pivot on every hash, domain, URL, and IP, or pipe them straight into your SIEM.View all in Mallory
Mallory platform

The version that knows your environment.

This page is what’s public. Mallory adds the parts that aren’t: which of your assets match these IOCs, which detections are missing, which campaigns to expect next, and what to do in the next 30 minutes.
IOC matching192Match every observed IP, domain, and hash against your live telemetry.
Associated threat actors2Groups linked to this family, with evidence pinned to each claim.
Associated vulnerabilities9CVEs linked to this family, with the reporting behind each link.
Detection signaturesYARA, Sigma, Snort, and vendor rules, auto-deployed to your SIEM.
MITRE ATT&CK mapping49Every documented technique, ranked by evidence weight.
Researcher chatterReddit, Mastodon, and CTI community discussion around this family.