Even Moar Pentest Lab: Installing VMWare 6.0

So after setting up the NAS yesterday my goal for today was to get back into python. As an update on that, my python is coming along, I finished Python Crash Course and most of the way through Automate the Boring Stuff with Python. I’ve been through the first 4 chapters of Penetration Testing, and have learned a lot of cool stuff.

first_shell_zomg

This summer has been very productive for me, all things considered. But it is drawing to an end, sadly, and with school starting up this week I’ll have less time for my side projects. So I should have been pressing ahead with working the python projects from the books or working the pentesting chapters… but instead ADD won the day and I am finishing out building my lab.

I installed ESXi to run from a USB on my Dell Poweredge 1950. After upgrading it to now have 32 GB of RAM, more than enough for my purposes. Right now I’m just running the pentest lab, which should only consist of a few machines at any given time, but I have other projects in mind down the line that this will be useful for.

The installation was painless. Download the software, available for a free trial from VMWare, or get it licensed from another source. I am still with George Mason University, so we have a deal where we get licensed VMWare products for free. The download, at least in the case of mine, comes with two files. One is a .iso file that will be the server installation files. The other is the management client for Windows.

Burn the .iso file to  disc, it could also be burned to a USB if you aren’t from the ancient past, but I went with the disc because I am a wasteful American, and because I wasn’t sure how the server would react loading the software from USB to USB similar to the NAS4Free install. Probably would work fine though. Insert the “destination” USB into the back of the server. Power the server on, insert the disc, navigate to the boot menu, and boot from disc. The installation to USB is quite easy, follow the prompts and when instructed remove the disc and reboot.

Upon reboot, bring up the BIOS menu and set the boot order. This will differ from server to server.  On my server, the rear USB interface is treated as a hard drive for boot order purposes, and the individual hard drives can be sorted for boot order, so I set the USB drive as the main “hard drive” for boot and set the boot priority for hard drive to 1. This will differ from server to server.

Once the server comes up, navigate in a web browser to the listed IP (assuming you have DHCP configured and the server was automagically assigned an IP, if not….). If the webpage for ESXi displays, then you’ve won. You can download the vSphere client from the link of the webpage or use the file from the initial software download. Install this software on your Windows client, following the default prompts. Once installed, start the software and navigate to the server’s IP. Authenticate using the username root and the password you set up during installation.

Open the NAS management console, in this case I used NAS4Free of course. Navigate to the Services>NFS menu. First head to the Shares tab and input the name of the share and the network to which the share should be accessible. Then select Save and Apply Changes. Remember that every time you do anything with NAS4Free, you have to select Apply Changes.

create_nfs

Once complete navigate back to the Settings tab. Ensure that Enable is selected. I chose to enable NFSv4, I don’t know what the difference is really beyond what was immediately available on Wikipedia, so that’s a problem for future me. But it seems like the smart move. Select Save and Restart to bring the share up. You have to repeat this step and the previous one for each disk to be shared.

restart_nfs

Back in vSphere, navigate to the Inventory tab. You should see a prompt to create a data store, if not go to the Configuration tab. Select Add Storage and then select NFS Store and then Next.

mount_nfs

On the next window, input the IP of the NAS server and the path, not the name, of the share you are adding. Give it a unique name and hit next.

mount_nfs2

Repeat this process for each disk you have to mount on the NAS. Once completed, you should see each disk attached to VMWare within vSphere.

nfs_success

Since I had already created several VMs on my laptop, in order to get them onto the datastore I will have to export them from VMWare Workstation and then import into vSphere. In order to export the VMs, in VMWare Workstation select the VM to be exported and then go to File>Export to OVF. In vSphere, g to File>Deploy OVF Template and select the template in order to import the VM into vSphere.

ovf_deploy

Once imported, navigate to the system in vSphere and console in to change the IP and hostname, if necessary. Pretty easy stuff, minimal surprises or roadblocks. This is basically an enterprise deployment of VMWare, minus the STIGing and other concerns. Which will come in a future update I am sure!

Moar Pentesting Lab – Setting up a NAS

First off, errata from the last post. Working through the Weidman book, the copy of Windows XP SP 3 I listed doesn’t work for the exploits listed in the book and the security updates applied can’t be uninstalled. Windows XP SP2 does work, however I have yet to find a good, clean source for this.

Time to move on and set up the home NAS that will support my VMWare infrastructure. I decided on NAS4Free, since FreeNAS no longer supports x86 systems and my intent is to repurpose an old 32 bit system to support this. This isn’t necessarily the “right” or “best” way to do this, but it is what it is. And it works, very well. We’re doing an embedded USB install here, for ease of use and (hopefully, we’ll see) updating.

Use Win32 Disk Imager, located here to place the NAS4FREE image onto a USB. The image depends on the type of system, I’m using an old 32 bit system so I picked the 32 bit image for version 10.3.0.3. Pick the appropriate image from here and download that. Using the tool to load the image is pretty painless.

Once that is complete, set the system to boot from USB in the BIOS setting and reboot, with your USB attached. Connect a second USB stick to the system. Once the system completes booting, select the first option in order to create an embedded USB install. The system will then prompt you to select a “source” disk, you should pick the USB with the image loaded onto it. The system will then prompt you for a “destination” disk, select the second USB drive. The install will then complete and the server will become available on 192.168.1.250 on your local network. This can be changed from the console if needed.

From a desktop, navigate in a web browser to http://192.168.1.250 and login using the username admin and the password nas4free. Once logged in you can change these values in the System>General menu. Navigate to the Disks>Management menu.

In order to manage the disk, they must first be imported. This walkthrough assumes the disks have no data on them. Select Import Disks under the HDD Management tab. Once completed, switch to the HDD Format tab. It defaults to ZFS Storage Pool, but since ZFS is incompatible with Windows I switched this to UFS. Select UFS, select all disks, and select Next to continue to the next menu. The Minimum Free Space setting defaults to 8%, leave that at the default and input a volume name. Select Next again and begin the formatting process. Once that is complete, it is time to mount the drives.

import

There is an option to create a RAID, after some deliberation I decided against it. RAIDs are really useful for fault tolerance, which isn’t a requirement in my home lab. If you aren’t running real-time backups suited for a home network (ie crashplan, carbonite, custom solution, etc) then this may be a consideration.

Navigate to the Services>CIFS/SMB menu. Select the Shares tab and create shares for each disk, using a custom name for each. Once complete, navigate back to the Settings tab and ensure that Enable is selected under CIFS (it is on the right side). Once this is complete, save and restart. The shares will not be accessible until you select Save and Restart.

nocomment

Once this is complete, map the drives under Windows and they should be accessible. Map them as the name, so \\192.168.1.250\mount_1 from my example picture would map the first disk. Step 1 was setting up the VMs. Step 2: Make a NAS is complete. Now to get the ESXi server up…