Welcome back. This is the last post in our seven part series on setting up our Security+ Pro hacking lab. Here's what we covered so far:
Each post has a detailed step-by-step walk through with tons of screenshots and a step-by-step video to help you along the way:
Now today I want to show you how to enable file sharing between your Kali Linux VM and your host; this is, your physical computer.
There are two techniques for doing this. Both are pretty easy but it took me a long time to figure this out for some reason.
The first step is to enable file sharing.
Select your Kali Linux VM in VMWare Workstation and then press Ctrl + d to open your Settings pane.
Choose the Options tab, select "Shared Folders" in the left pane and choose "Always enabled" in the right pane under "Folder Sharing"
Now we just need to click the "Add..." button to breeze through the shared folder wizard.
Click "Browse..." to browse to the folder on your host machine that you wish to share and then give it a meaningful name. I chose "Windows_Host_Share" for mine.
This name is the one you'll use when we execute the file sharing command later on in Kali Linux.
On the next screen make sure "Enable this share" is checked - or else the share won't work hehe.
Click "Finish" and then zoom into your VM to verify the folder share name.
We can do this with the vmware-hgfsclient. Type:
Copy that share name to the clipboard. We're going to need it in a moment.
Now this is how we can actually setup the share.
We need to make a new folder on the desktop. So right-click the desktop in Kali Linux and choose "New Folder" and name it "Shared".
Alternatively, you can just type:
cd ~ && sudo mkdir "Shared"
Next we need to type this:
vmhgfs-fuse -o auto_unmount .host:/Windows_Host_Share /root/Desktop/Shared
So you can see we are saying, unmount the share when the process terminates. That's what the "-o auto_unmount" option does.
The .host:/Windows_Host_Share is saying, "This is the folder name on the HOST machine I want to share".
And the /root/Desktop/Shared part specifies the path on the Guest (the Kali VM) where we can access the Host share.
Once this completes you'll be able to copy files and folders between both computers with ease.
In the graphic below, you can see I opened the "Shared" folder and can see all the files I was sharing on my Host machine.
If the first technique doesn't work for you, we can actually setup a Samba file share between your Host and Guest VM.
This technique is just as awesome - it requires a little more configuration but it might be your only shot if you can't get the first method to work.
First we need to get cifs-utils so open your terminal and type this:
sudo apt-get install cifs-utils -y
Once it downloads we'll start configuring the Windows folder we want to share.
Back on our Windows host machine, we need to right-click the folder we want to share, go to Properties, choose the Sharing tab and click the "Advanced Sharing..." button.
Place a checkbox in "Share this folder" and give it a meaningful share name.
I named mine: Windows_Host_Share_CIFS.
Try to avoid spaces because... well Linux isn't as forgiving with spaces as Windows is.
I also dropped in a little comment.
When you're done with that, click the "Permissions" button.
Grant the "Everyone" group:
We need to allow all these permissions for this to work. I know it looks insecure, but once we're done with the file share we can also remove sharing from the folder by reversing what we just did.
Click OK to all the windows and make sure you copy the Network Path to the clipboard. We're going to need this in a moment for Kali.
Now back in Kali we can setup the share.
First make a folder on the Kali desktop that you'll click to access the Windows share.
sudo cd ~ && mkdir Share
Now to use cifs-utils we type:
sudo mount.cifs "//DESKTOP-0402TK2/Windows_Host_Share_CIFS" ~/Desktop/Share -o user=Vonnie
Please note those are forward slashes not backslashes. You'll have to flip those around when you paste the network path into the Linux terminal window.
Also note you'll need to change the user=Vonnie to the username you use to login to your Windows computer.
After you type this command it'll ask you to enter the password, so just type in your Windows user password here.
And bam! That should do it.
You should see the Share folder on the desktop that you can click to access all your Shared files.
I know this tutorial is pretty technical and there's lots of room to make mistakes so if you run into any problems leave a comment below.
Also I put together this video that might help you work through some of the issues. Go ahead and watch this to see if it helps:
So we've finished our seven part series creating our Security+ hacking lab but we're not done with our Security+ training yet! Next week, we're going to dig into some important Windows command prompt commands. Then we'll look into some Linux commands you need for the test.
The awesome part is now that we have our lab setup - when we move into the hacking part of your training everything will be ready to go.
I hope you enjoyed this training and I hope to see you on my email list :)
Heheh, don't forget to sign up for that - I'll see you next week buddy.
Join our FREE mailing list to get FREE Security+ training online. You'll get tons of Security+ videos, braindump PDFs, lab simulations and more.
Pop in your first name and best email address and we'll send you:
The latest updates on the CompTIA Security+ SY0-501 exam
Proven tips and tricks for passing the exam
Hands on video labs with complete step-by-step walk-throughs
And don't forget to refresh your inbox. You should see us there in about 3 minutes.