Practical Web Penetration Testing
上QQ阅读APP看书,第一时间看更新

Installing Kali on VMware

If you have VMware and you want to install Kali Linux on it, then this section is for you. In the previous section, you saw how to install Kali from scratch, but you don't need to do that if you have VMware. All you need to do is download the image file and import it into VMware, and you're good to go:

  1. To download the VMware image file, go to https://www.kali.org/downloads and scroll down a little bit, until you see the following section:
  1. Follow the link to the Offensive Security Download Page. On this page, you will see a table that contains the virtual image copies of VMware:
  1. Choose either the 32- or 64-bit version, and download it locally to your machine. Then, you will need to import it into VMware, so locate the File menu (click on it) and then click on Open:
  1. A dialog window will show up, and you should select your downloaded image file. Once Kali is imported into VMware, you will need to alter its default settings. To accomplish that, click on Edit virtual machine settings:
  1. First, you need to check the Memory settings. Click on the Memory device, and make sure that you have at least 2,048 MB (2 GB) of memory. If you have a good host machine, it will be much better if you increase it to 4 GB:
  1. Next, click on the Processors device, and make sure that you have enough processing power for your Kali Linux host. Be generous with your new baby machine:
  1. Now, it's time to set the network settings. If you want to separate your virtual machine from your local area network (LAN), then you need to choose the NAT option. If you choose NAT, then your VM will automatically be assigned a dynamic IP address, using a virtual DHCP server (check the following section, Bridged versus NAT versus Internal Network, for more details):
  1. When you use a virtual machine, you need to share files between Kali Linux and your local machine. To accomplish this, you need a shared folder. To add one, click on the Options tab and select the Always enabled radio button. Then, click on the Add... button to point to your local machine folder. This setup is specific to Windows, but it looks very similar on macOS:
  1. Now, you can boot your Kali VM, but on the first boot, I recommend that you install the VMware tools. To do so, open your Terminal window and execute the following commands:
apt-get update && apt -y full-upgrade
reboot
# After reboot
apt -y install open-vm-tools-desktop fuse
reboot

Sometimes, shared folders do not work out of the box. To enable them, you need to execute the following script in your Terminal window:

cat <<EOF > /usr/local/sbin/mount-shared-folders
#!/bin/bash
vmware-hgfsclient | while read folder; do
vmwpath="/mnt/hgfs/\${folder}"
echo "[i] Mounting \${folder} (\${vmwpath})"
mkdir -p "\${vmwpath}"
umount -f "\${vmwpath}" 2>/dev/null
vmhgfs-fuse -o allow_other -o auto_unmount ".host:/\${folder}" "\${vmwpath}"
done
sleep 2s
EOF
chmod +x /usr/local/sbin/mount-shared-folders

If you wish to make it a little easier, you can add a shortcut to the desktop by executing the following script in your Terminal window:

ln -sf /usr/local/sbin/mount-shared-folders /root/Desktop/mount-shared-folders.sh
gsettings set org.gnome.nautilus.preferences executable-text-activation 'ask