Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/documentation/modules/exploit/linux/samba/is_known_pipename.md
Views: 11789
Vulnerable Application
This module exploits Samba from versions 3.5.0-4.4.14, 4.5.10, and 4.6.4 by loading a malicious shared library. Samba's download archives are here. There are some requirements for this exploit to be successful:
Valid credentials
Writeable folder in an accessible share
Server-side path of the writeable folder
However, in some cases anonymous access with common filesystem locations can be used to automate exploitation.
A vulnerable Samba config may have a share similar to the following in smb.conf
. This is a setup for 'easy' exploitation where no SMB options are required to be set:
Verified on:
Synology DS412+ DSM 6.1.1-15101 Update 2 (Samba 4.4.9)
Synology DS412+ DSM 6.1.1-15101 Update 3 (Samba 4.4.9)
Synology DS1512+ DSM 6.1.1-15101 Update 2 (Samba 4.4.9)
Synology DS1512+ DSM 6.1.1-15101 Update 3 (Samba 4.4.9)
Synology DS2415+ DSM 6.1-15047 (Samba 4.3.11)
Ubuntu 14.04.5 x64 (Samba 4.3.9)
Ubuntu 15.04 (Samba 4.1.13)
Ubuntu 16.04 (Samba 4.3.11)
1:4.3.11+dfsg-0ubuntu0.16.04.3 and older are vulnerable, fixed in 2:4.3.11+dfsg-0ubuntu0.16.04.7
Fedora 24 (Samba 4.4.13)
Currently not working against:
QNAP NAS Samba 4.4.9 on armv71
WD MyClous NAS Samba 4.0.0rc5 armv71
SELinux
Fedora (and possibly Redhat) are not exploitable in their default installation. SELinux must be adjusted to allow nmbd to use net_admin, and smbd to exec the payload.
Verification Steps
Start msfconsole
Do:
use exploit/linux/samba/is_known_pipename
Do:
set rhost [ip]
Do:
set target [target #]
Do:
exploit
Options
SMB_SHARE_NAME
The name of the SMB share containing a writeable directory. Shares are automatically scanned for, and if this variable is non-blank, it will be preferred.
SMB_SHARE_BASE
The remote filesystem path correlating with the SMB share name. This value is preferred, but other values are brute forced including:
/volume1
/volume2
/volume3
/shared
/mnt
/mnt/usb
/media
/mnt/media
/var/samba
/tmp/home/home/shared
SMB_FOLDER
The directory to use within the writeable SMB share. Writable directories are automatically scanned for, and if this variable is non-blank, it will be preferred.