Appearance
π SMB - 445 β
π Enumeration β
bash
# Anonymous Listing
smbclient -L //TARGET_IP/ -U "" -N
smbclient //TARGET_IP/ -N
# Enum
enum4linux-ng -A TARGET_IP # Complete enumeration (Linux)
smbclient -L //TARGET_IP/ -U user # With a user
crackmapexec smb TARGET_IP --shares # List shares (Pentest)π Connecting to SMB shares β
bash
# Interactive connection
smbclient //TARGET_IP/SHARE -U user
# Execute an command without opening a shell
smbclient //TARGET_IP/SHARE -U user -c "ls"
# Mount SMB shares
sudo mount -t cifs //TARGET_IP/SHARE /mnt/smb -o user=user,password=passποΈ Files and Directories β
bash
# List files of a share
smbclient //TARGET_IP/SHARE -U user -c "ls"
# Download file
smbclient //TARGET_IP/SHARE -U user -c "get file.txt"
# Download all files into folder
smbclient //TARGET_IP/SHARE -U user -c "mget *"
# Upload file
smbclient //TARGET_IP/SHARE -U user -c "put localfile.txt"
# Read file
smbclient //TARGET_IP/SHARE -U user -c "more file.txt"