black electronics

Mount

Common mount and unmount commands for attaching NFS and CIFS shares during pentests.

The mount command connects storage devices or file systems (like EXT4, NTFS, or FAT32) to directories known as mount points. Once mounted, everything inside that mount point reflects the contents of the attached storage. As a pentester testing from either Kali, Parrot, or another security-focused distro (99% of the time Linux-based) you will use mount very often to attach open file shares or other storage.

Mount

Use the following to mount NFS shares. Network File System (NFS), a protocol commonly used for sharing files between Linux/Unix systems over a network.

Terminal window
sudo mount -t nfs 10.1.1.1:/dir/file /home/mrnobody/Desktop/testing # Mounts a NFS share volume called file on a remote system to a folder called testing on your local system
sudo mount -t nfs 10.1.1.1:/homedirs/administrator /root/testing -o nolock

Unmount

Use the following to unmount NFS shares

Terminal window
sudo umount /home/mrnobody/Desktop/testing

Mount a Windows share drive on Linux

Use the following to mount CIFS shares. If you are connecting to a Windows Server, a Windows desktop share, or a consumer NAS device, you need to log in with a username and password. CIFS is best used for Windows-to-Windows or Linux-to-Windows.

Terminal window
mount -t cifs //10.1.1.1/NETLOGON /root/mount/ -o username=admin,domain=domain.local # Enter username's password when prompted

Unmount all CIFS shares

Use the following to unmount all CIFS shares.

Terminal window
sudo umount -a -t cifs -l
Useful LinksPentest PayloadsCheat Sheets