impacket-smbserver
Simulate an SMB server
TLDR
View documentation for the original command
SYNOPSIS
impacket-smbserver sharename path [-debug] [-comment COMMENT] [-smb2support] [-ip IP] [-port PORT]
PARAMETERS
-debug
Enables verbose DEBUG output for troubleshooting connections and errors.
-comment COMMENT
Sets server description comment, limited to 48 characters, visible in network browsers.
-smb2support
Enables experimental SMBv2 protocol support alongside SMBv1.
-ip IP
Binds server to specific IP address; defaults to all available interfaces.
-port PORT
Specifies TCP listening port; defaults to standard SMB port 445.
DESCRIPTION
Impacket-smbserver is a lightweight Python-based SMB/CIFS server from the Impacket toolkit, designed for quick file sharing from Linux/Unix systems to Windows clients. It exposes a local directory as an SMB share, supporting anonymous access by default with read/write permissions. Ideal for penetration testing, red teaming, and temporary file drops during security assessments, it avoids the complexity of full Samba installations.
Key features include binding to specific IPs/ports, optional SMBv2 support (experimental), and server comments for identification. Run it with a share name and path, e.g., impacket-smbserver share /tmp/files, and connect via \\IP\share from clients. Debug mode aids troubleshooting. While powerful for its simplicity, it's not production-grade—lacks advanced features like ACLs or encryption. Widely used in cybersecurity for payload delivery and lateral movement simulations. Supports recent Impacket versions with auth options for NTLM/Kerberos.
CAVEATS
Anonymous shares allow unrestricted read/write access, posing security risks.
SMB2 support is experimental and unstable.
Not suitable for production; vulnerable to exploits without hardening.
Requires Impacket installation via pip or git.
BASIC EXAMPLE
impacket-smbserver public /tmp/share
Shares /tmp/share as \\IP\public; access anonymously from Windows Explorer.
INSTALLATION
pip3 install impacket
Or git clone https://github.com/fortra/impacket && cd impacket && pip3 install .
HISTORY
Developed as part of Impacket by SecureAuth (now Fortra) since ~2010; evolved from basic SMB tools for pentesting. Gained popularity post-2016 for red team ops, with auth enhancements in v0.9+. Maintained on GitHub with community contributions.
SEE ALSO
smbclient(1), mount.cifs(8), samba(8), impacket-smbclient


