Skip to main content
Mallory
CriticalExploited in the wildCISA KEVPublic exploitVulnerability

CVE-2017-7494: SambaCry (EternalRed)

Published May 30, 2017 · Updated 15 days ago
Trending this weekNot trendingOutside this week’s top 100
Mention activity · 30 daysNo mention activity in the last 30 days.
CVSS9.8Critical · v3.1
EPSS99.4%100th percentile
CISA KEVYesAdded Mar 30, 2023
In the wildActivePer CISA KEV
Vendors
Debian ProjectSamba
IdentifiersCVE-2017-7494CWE-749

CVE-2017-7494, also known as SambaCry or EternalRed, is a remote code execution vulnerability in Samba versions beginning with 3.5.0 and preceding the fixed releases 4.4.14, 4.5.10, and 4.6.4. A malicious SMB client can upload a shared library to a writable share and then cause the server to load and execute it. The vulnerability has been exploited by cryptocurrency-mining botnets and ransomware operators.

Do you run this?See affected versions in your environment and whether adversaries are exploiting this vulnerability against assets like yours.
Check your exposure
Analyst brief

Impact, mitigation & remediation

What it means and what to do now: patch path, interim mitigations, and the assume-compromise checklist.

Impact

What an attacker gets, and what they’ve been doing with it.

Successful exploitation permits arbitrary code execution on the Samba server, compromising the host and potentially the data it serves. Observed exploitation includes cryptocurrency-miner deployment and ransomware activity, including attacks associated with NamPoHyu. StorageCrypt infections have also been linked to SambaCry, although the associated analyzed artifacts demonstrated mining rather than ransomware behavior.

Mitigation

If you can’t patch tonight, do this now.

Until patches can be applied, restrict SMB access to trusted clients and remove unnecessary write access to shared directories, especially anonymous or guest write access. Block external SMB access on systems intended only for internal use. These controls reduce access to the writable-share prerequisite but do not replace patching.

Remediation

Patch, then assume compromise.

Upgrade Samba to a supported release containing the fix. The original fixed releases are 4.4.14, 4.5.10, and 4.6.4. For appliances that bundle Samba, including NAS devices, install the applicable vendor firmware or security update containing the Samba fix.

Public exploits

Exploits

12 exploits validated by Mallory's analysis. Hidden: 8 rejected by Mallory's analysis as not a working exploit; 1 not yet analyzed, such as Exploit-DB entries.

View more in app →
is_known_pipename.rbThis repository contains a single Metasploit module (is_known_pipename.rb) that exploits the Samba is_known_pipename() arbitrary module load vulnerability (CVE-2017-7494). The exploit targets Linux systems running vulnerable versions of Samba (3.5.0 to 4.4.14, 4.5.10, and 4.6.4) and allows remote code execution by uploading a malicious shared library to a writeable SMB share and triggering its execution via the Samba service. The module requires valid credentials (or anonymous access with a writeable share), and knowledge of the server-side path to the share. The exploit supports multiple Linux architectures and can deliver various payloads, including interactive shells and command execution. The module is weaponized, as it is part of the Metasploit framework and provides automated exploitation capabilities. The only code file is a Ruby script structured as a standard Metasploit exploit module, with options for specifying the SMB share and folder, and logic for checking Samba versions, uploading payloads, and cleaning up after exploitation.Disclosed Mar 24, 2017 · Framework: metasploit · ruby · networkWeaponizedexploit-CVE-2017-7494This repository provides a full exploit environment for CVE-2017-7494 (SambaCry), a remote code execution vulnerability in Samba. The structure includes: - `exploit.py`: The main exploit script (Python) that authenticates to a vulnerable Samba server, uploads a malicious shared object (payload), and triggers its execution via a crafted named pipe. It supports arguments for target host, credentials, share, remote path, and shell port. - `bindshell-samba.c` and `bindshell-samba.h`: C source code for a bind shell payload. When compiled as a shared object and loaded by Samba, it spawns a shell on TCP port 6699. - `Dockerfile` and `docker-compose.yml`: Provide a vulnerable Samba environment for testing, exposing SMB ports (137/udp, 138/udp, 139/tcp, 445/tcp) and the bind shell port (6699/tcp). - `smb.conf`: Samba configuration with a writable share (`/data`) accessible to the user `sambacry`. - `README.md`: Detailed usage instructions, including how to build the payload, run the exploit, and test against the provided Docker environment. - `src/`: Contains the full Samba source code and build system, used to create the vulnerable environment. The exploit is operational and weaponized, providing a working remote code execution chain against vulnerable Samba servers. The main attack vector is network-based, requiring SMB access and the ability to upload files to a writable share. The exploit is not part of a framework but is a standalone, full-featured exploit with a customizable payload. The repository is well-structured for both exploitation and testing, including all necessary components to simulate and exploit the vulnerability.opsxcq · Disclosed May 26, 2017 · python · c · networkOperationalSambaHunterThis repository contains a Python exploit script (sambahunter.py) and a README.md for exploiting the Samba remote code execution vulnerability CVE-2017-7494. The exploit targets Samba versions 3.5.0 through 4.5.4, 4.5.10, and 4.4.14 on Linux systems. The script works by generating a malicious C shared object (.so) file that executes an arbitrary shell command provided by the attacker. It uploads this payload to all writeable shares it can find on the target server, then attempts to trigger the payload via the Samba IPC$ share, exploiting the vulnerability to achieve remote code execution. The script requires the target server's address and the command to execute. The README provides usage instructions and example output. The exploit is operational and automates the process of finding writeable shares, uploading the payload, and triggering the exploit. The main attack vector is network-based, requiring access to the target's Samba service. The script fingerprints and attempts to use a variety of common file paths for payload upload, which are useful for detection and defense.brianwrf · Disclosed May 30, 2017 · python · c · networkOperationalCVE-2017-7494This repository is a full exploit implementation for CVE-2017-7494, a remote code execution vulnerability in Samba. The main exploit script is cve_2017_7494.py, which automates the process of compiling a malicious shared object payload (implant.c, built as libimplantx32.so or libimplantx64.so), uploading it to a writable share on the target Samba server, and triggering the vulnerability to load the payload. The payload, when executed, provides a root reverse shell to the attacker's specified host and port. The exploit supports various options for targeting different Samba versions, architectures, and custom payloads. The repository includes a large number of supporting files from the impacket library, which are used for SMB and DCE/RPC communication. The attack vector is network-based, requiring access to the Samba service and a writable share. The exploit is operational and provides a working root shell if the target is vulnerable and properly configured.joxeankoret · Disclosed Jun 5, 2017 · python · c · networkOperationalnoSAMBAnoCRY-CVE-2017-7494This repository is an operational exploit for CVE-2017-7494, a remote code execution vulnerability in Samba (3.5.0 and above, up to 4.6.4, 4.5.10, 4.4.14). The exploit works by compiling a malicious shared object (.so) payload for various architectures, uploading it to a writable SMB share on the target, and then instructing Samba to load the library, resulting in arbitrary code execution. The payload, as defined in config.h, typically spawns a shell or reverse shell to the attacker's host and port. The exploit is reliable if the target is vulnerable and the payload matches the target's architecture. The repository includes both the exploit script (noSAMBAnoCRY.py) and the payload source (implant.c/config.h), as well as supporting files from the impacket library for SMB communication. The attack vector is network-based, targeting SMB (TCP port 445 or custom). Fingerprintable endpoints include the reverse shell IP/port and the path to the shell binary. The exploit is not part of a framework but is a standalone operational exploit with customizable payloads.0xm4ud · Disclosed May 9, 2021 · python · c · networkOperationalBIT-EternalBlue-for-macOS_LinuxThis repository is a functional exploit for CVE-2017-7494, a remote code execution vulnerability in Samba (the open-source SMB server) affecting versions 3.5.0 to 4.6.3 on Linux and macOS. The exploit consists of a Python script (exploit.py) that automates the attack: it compiles a malicious shared object (payload.so) with attacker-specified IP and port, uploads it to a writable share on the target via SMB, and then triggers Samba to load the module using the vulnerable code path. The payload, written in C, forks a process and executes a Python command to connect back to the attacker's machine, providing a reverse shell. The repository also includes a Makefile for building the payload, a shell script to install dependencies (including a modified impacket library for SMB communication), and configuration files. The README provides detailed usage instructions, including how to set up a listener and how to use precompiled payloads for macOS. The exploit requires network access to the target's SMB service and a writable share. The main attack vector is network-based, and the exploit is operational, providing a working reverse shell if successful.I-Rinka · Disclosed May 15, 2021 · python · c · networkOperationalCVE-2017-7494_SambaCryThis repository provides a working exploit for the SambaCry vulnerability (CVE-2017-7494) affecting Samba servers. The exploit consists of a C source file (bindshell-samba.c) that compiles into a shared object (libbindshell-samba.so), which, when uploaded to a writable Samba share and loaded via the exploit, opens a bind shell on TCP port 6699. The Python script (exploit.py) uses the impacket library to trigger the vulnerability by instructing the Samba server to load the malicious shared object from a specified path. The README.md provides detailed instructions for compiling the payload, uploading it to the target, and executing the exploit, including guidance for path guessing using paths.txt. The exploit requires the attacker to have write access to a Samba share and knowledge (or a good guess) of the absolute path to the uploaded file on the server. The main attack vector is network-based, targeting vulnerable Samba services. The repository is operational and provides all necessary components for exploitation, including payload source, exploit script, and usage documentation.d3fudd · Disclosed Nov 1, 2022 · c · python · networkOperationalCVE-2017-7494This repository contains a fully operational exploit for CVE-2017-7494, a remote code execution vulnerability in Samba. The exploit consists of a Python script (cve_2017_7494.py) that automates the process of compiling a malicious shared object payload (implant.c, built as libimplantx32.so or libimplantx64.so), uploading it to a writable share on the target Samba server, and triggering its execution via the Samba module loading mechanism. The payload, when loaded, spawns a reverse shell as root to the attacker's specified host and port. The repository also includes a large number of files from the impacket library, which are used to handle SMB and DCE/RPC communication. The main entry point is cve_2017_7494.py, which provides various options for targeting different Samba versions, architectures, and custom payloads. The exploit is reliable as long as the target is vulnerable and a writable share is available. Notable fingerprintable endpoints include the default reverse shell IP (202.124.201.135), the shell binary (/bin/sh), and the uploaded .so files. The exploit is not part of a framework and is a standalone operational exploit.sudlit · Disclosed Dec 2, 2025 · python · c · networkOperationaljoxeankoret__CVE-2017-7494.daee8372Repository contains an operational remote root exploit for Samba CVE-2017-7494. The primary entry point is cve_2017_7494.py (Python 2), which uses an embedded copy of the Impacket library to: (1) optionally compile a malicious shared object payload (libimplantx32.so/libimplantx64.so) via Makefile by generating config.h with attacker rhost/rport and shell path; (2) authenticate to the target Samba server over SMB (default TCP/445, optional 139); (3) enumerate shares via SRVSVC (\\srvsvc) and attempt to upload the .so to a writable share with a randomized filename; and (4) trigger the vulnerability by connecting to a crafted named pipe path (ncacn_np:<target>[\pipe\<module>]) causing Samba to load the uploaded library, yielding code execution as root and a reverse shell back to the attacker. Key files: - cve_2017_7494.py: exploit logic, options for credentials (-u/-P), target (-t/-p), reverse shell callback (--rhost/--rport), architecture (-x), old Samba entrypoint handling (-o), skip compilation (-n), and custom .so (--custom). - Makefile + config.h: build system for the implant shared objects; config.h is overwritten by the script unless compilation is disabled. - README.md: usage instructions (netcat listener, running exploit, reusing uploaded module path). - impacket/: large vendored Impacket codebase and examples; mostly unrelated to the CVE exploit but provides additional tooling code (e.g., ntlmrelayx, secretsdump) if executed separately. Overall purpose: deliver and load a malicious Samba module from a writable share to achieve reliable remote root RCE with a reverse shell callback.swesmith-repos · Disclosed Jan 27, 2026 · python · c · network (SMB/DCERPC over named pipes) remote code execution via Samba module loading (CVE-2017-7494)Operationalauditoria-ciberseguridad-ypfThis is an educational IT/OT audit laboratory rather than a validated multi-product exploit suite. The supplied inventory contains 29 files: 20 Python files, one Bash script, seven documentation/text files and .gitignore. HTML, CSS and JavaScript are embedded in the presentation generator. No repository URL, git reference or archive size was supplied; the empty metadata and zero size are placeholders, not measured values. Several large files, including the victim server, are truncated, limiting verification. The principal attack entry point is laboratorio_kali/3_ataque_y_explotacion.py. It makes three sequential socket-based tests: authenticates to FTP using embedded demonstration credentials, sends an Apache CVE-2021-41773-style encoded traversal for /etc/passwd, and reads three Modbus holding registers without authentication. It contains fixed, basic request payloads, making OPERATIONAL the appropriate code-maturity classification, not a claim of confirmed exploitation against real products. It does not actually sniff credentials, test anonymous FTP, trigger the vsFTPd backdoor, exploit SSH, exploit Samba/MySQL, or modify industrial registers. HTTP output is printed without validating a successful disclosure, and limited response handling can produce incomplete results. The laboratorio_kali directory provides the five-stage exercise: network setup, a threaded Python victim emulator, periodic operator traffic, the attacker script and a defensive log analyzer. The emulator exposes seven services and uses Paramiko for SSH. Its visible command helper explicitly describes a simulated Alpine environment, contradicting documentation that presents the SSH service as an actual OpenSSH Alpine container. The claimed '*sshole' identifier CVE-2026-123158, its proposed crypt() behavior and OpenSSH 10.6p2 remediation are unverified repository assertions; this material does not establish a genuine OpenSSH vulnerability. Similarly, the documentation describes vsFTPd 2.3.4 and a port-6200 backdoor, whereas the visible FTP implementation advertises 3.0.3 and has no smiley-trigger behavior. Samba and MySQL listeners are generic banner emulations, not demonstrated vulnerable installations. CVE identifiers listed in targeting therefore include documentary claims, not seven independently implemented exploits. The root documentation consists of Spanish-language lab instructions, an editable audit report, study material and oral-defense notes; datos_grupo.py supplies author/course configuration. The 15 scripts under scripts/ primarily produce charts, screenshot panels, PDF/DOCX reports and an interactive HTML presentation using Cairo/Pango and python-docx. Their paths are heavily tied to the author's workstation. Referenced evidence images and final deliverables are not present in the supplied 29-file inventory, so claims about real screenshots and measured risk reduction cannot be independently corroborated. No external command-and-control or exfiltration endpoint is visible. Important operational findings: setup flushes firewall rules, sets INPUT ACCEPT, stops existing services and assigns all simulated hosts to one interface; the victim also flushes iptables and defaults to all-interface binding. This does not itself create network isolation and can expose services on unintended interfaces. Logs record credentials and are made world-writable. The defensive component applies inventory and service-count heuristics to application logs, rather than performing packet-level SYN-scan detection, and substitutes a fixed MAC when lookup fails. These limitations support treating the repository as a staged training environment, not production-grade detection or proof of the documented real-product compromises.TheoCerveraLede · Disclosed Nov 20, 2026 · python · bash · network · webOperationalcve-2017-7494This repository is a proof-of-concept exploit for CVE-2017-7494, a remote code execution vulnerability in Samba (version 4.5.9). The exploit consists of a Python script (exploit.py) that connects to a target Samba server using the DCERPC protocol and attempts to load a user-supplied shared object (.so) file onto the server. The payload is a simple C shared object (libpoc.so) that, when loaded, prints a message to demonstrate code execution. The repository includes a build script for compiling the payload, a requirements file for a patched version of Impacket, and setup instructions. The exploit requires the attacker to upload the shared object to a writable share on the Samba server and then trigger its loading via the exploit script. The main attack vector is network-based, targeting exposed Samba services. The repository is structured with clear separation between the exploit script, payload source, and build instructions, and is intended for demonstration and research purposes.betab0t · Disclosed May 25, 2017 · python · c · networkPoCCVE-2017-7494This repository is a compact, standalone SambaCry exploit for CVE-2017-7494. It contains one main Python script (exploit.py), a README with usage and affected versions, a docker-compose lab definition, and a minimal requirements file listing Impacket. The exploit implements a full attack chain in three stages: build, upload, and trigger. In the build stage, exploit.py generates C source code for a malicious shared library and compiles it with gcc as a position-independent .so. The embedded payload uses a constructor function so code executes immediately when Samba loads the library; it connects back to an attacker-supplied IPv4 address and port, redirects standard streams to the socket, and launches /bin/sh -i, yielding a reverse shell. In the upload stage, the script invokes smbclient with supplied SMB credentials to place the compiled payload onto a writable SMB share. In the trigger stage, it uses Impacket DCERPC/SMB functionality to send a crafted named-pipe request referencing an absolute server-side path to the uploaded .so. The script includes a monkey-patch wrapper around impacket.smb3 path handling so absolute Unix paths are preserved instead of normalized away, which is central to exploiting the Samba path-validation flaw. The target is Samba on Linux/Unix-like systems, specifically versions documented in the README: 3.5.0-4.4.13, 4.5.0-4.5.9, and 4.6.0-4.6.3. The included docker-compose.yml spins up a vulnerable lab container exposing Samba port 445 on local port 1445. This is a real exploit rather than a detector: it performs authenticated upload plus remote code execution and delivers a working reverse shell payload. The code is operational but not highly modular or framework-integrated, so OPERATIONAL is the best maturity fit.YonLiud · Disclosed Aug 15, 2026 · python · c · network · webPoC
Exposure surface

Affected products & vendors

Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.

VendorProductType
Debian ProjectDebian Linuxoperating_system
SambaSambaapplication
FAQ

Frequently asked questions

Is CVE-2017-7494 exploited in the wild?
Yes. As of Nov 9, 2026, Mallory has reports of exploitation in the wild, and CISA added it to KEV on Mar 30, 2023.
Is there a public exploit for CVE-2017-7494?
Yes. Mallory tracks 12 public exploits or proofs of concept for CVE-2017-7494, the earliest disclosed Mar 24, 2017.
Is there a patch for CVE-2017-7494?
Upgrade Samba to a supported release containing the fix. The original fixed releases are 4.4.14, 4.5.10, and 4.6.4.
What products are affected by CVE-2017-7494?
Samba and Debian Project Debian Linux.
How severe is CVE-2017-7494?
CVE-2017-7494 has a CVSS v3.1 score of 9.8 (Critical) and an EPSS score of 99.4% (100th percentile) as of Nov 9, 2026.
Activity feed

Recent activity

6 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.

View more in app →
Do you run this?See affected versions in your environment and whether adversaries are exploiting this vulnerability against assets like yours.
Check your exposure
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 are affected, which adversaries are exploiting it right now, and which detections to deploy tonight.
Exposure mappingQuery your assets running an affected version, and investigate the blast radius.
Threat actor evidenceEvery report linking this CVE to a named adversary.
Associated malware4Malware families linked to this CVE, with evidence and IOCs.
Detection signatures4YARA, Sigma, Snort, and vendor rules, auto-deployed to your SIEM.
Vendor-by-vendor mappingCross-references every affected SKU, including bundled OEM variants.
Social activity1Community discussion across Reddit, Mastodon, and other social sources.