To mount a share to your working machine, use the following command. There are some prerequisites for CIFS mount and for mounting the .VHD files. Normally comes preinstalled with you Kali/Linux Distro. However, i am listing it down.
- apt-get install libguestfs-tools
- apt-get install cifs-utils
Now to mount a remote share,
#sudo mount -t cifs //<Remote_Machine_IP>/<Path>/ <Mount_Path> -o rw
eg: mount -t cifs //10.10.10.1/Backups/ /mnt/nfs -o rw
To check the .VHD filesystem, we can use guestfish.
sudo guestfish --ro -a <file.vhd>
><fs> run
><fs> list-filesystems
/dev/sda1: ntfs
Guestfish shell runs only specific commands. However, run and list-filesystems commands are enough to get you the required information.In the above example, we can identify that the filesystem is NTFS and the partition /dev/sda1.
Now mount the .VHD file using guestmount.
#guestmount -a <File.vhd> -m <device_file_partition> --ro <Mount_Path>
--ro = readonly
example: guestmount -a file.vhd -m /dev/sda1 --ro /mnt/vhd/
Now you can able to access the mounted partition.
Note : This method is used for hacking the HTB Bastion machine.