While it comes to SMB shares/files enumeration inside Linux we can make use of tools i.e. nmap, smbclient. However there is a new addition to the group of SMB shares mapping tools. Its being named as SMBMap and is totally based on Python as the source language. Plus its GPL v3 based which is again cool. The tool uses impacket library as its core dependency plus you need to have python-asn1 libary installed on your host. If you don't have the required dependencies then you might want to execute the following set of commands:
* python-pyasn1 * impacket
$sudo apt-get update $sudo apt-cache search python-pyasn1 # Package must be available on your apt source $sudo apt-get install python-pyasn1 $cd /tmp/ $wget https://github.com/CoreSecurity/impacket/archive/master.zip -O impacket.zip #Recently they git'd $unzip -d . impacket.zip $cd impacket-master $sudo python setup.py install $wget https://raw.githubusercontent.com/ShawnDEvans/smbmap/master/smbmap.py $chmod a+x smbmap.py && cp smbmap.py /usr/local/bin/smbmap.py *#Optional step, PS: You may create softlink if you want* $cd /usr/local/bin/ $python smbmap.py *#You should come acorss with its paramater usages if its all good above*
#View Remote SMB shares and their permissions in a tabular format $python smbmap.py -u <username> -p <password> -H <ip_addr> #View directory contents along with permissions details recursively $python smbmap.py -u <username> -p <password> -H <ip_addr> -r
Hope it helps!