Wednesday, January 31, 2018

OSCP Journey 001 - VM prep for Kioptrix Level 1

One of my goals for 2018 is to get the OSCP and OSCE certifications. I have been looking at OSCP study guides and getting a feel of what to review before signing up for the certification. WIth that, I’ve seen these multiple guides (Jaspher, abatchy, and Andrew Hilton) with suggestions for vulnerable virtual machines that are similar to the OSCP labs. I’ll be going through the list like the guide from Jaspher and honing the skills I need for the PWK/OSCP starting with Kioptrix Level 1.

Here’s what we’ll need for this post:
  1. VirtualBox installed (I'm using 5.2.6)
  2. Kali (or another machine with similar tools)
  3. Kioptrix Level 1 VM
For Kali, I’m going to assume you’ve already got that set up and it’s fully up to date (e.g. sudo apt-get update; sudo apt-get upgrade). Next we will set up our internal network that only our virtual machines can use.

VirtualBox internal network setup:
  1. In VirtualBox, click “File” and select “Host Network Manager”.
  2. Click “Create”
  3. Click the checkbox next to “Enable” for DHCP Server
  4. Click “Close”

Kali VM prep:

After you’ve updated the VM with all of the updates and made sure it’s ready to go, change the network adapter to “Host-only Network” and click “Ok”

Kioptrix VM prep:
  1. Download the Kioptrix Level 1 virtual machine from here

  2. Extract the VM contents to produce

  3. In VirtualBox, click “New”

  4. Type in the name of the VM to "Kioptrix Level 1", change the type to “Linux”, change the version to “Other Linux (32-bit)”, and click “Continue”

  5. Change the memory to 1024 (if possible with your system constraints) and click “Continue”

  6. Choose “Do not add a virtual hard disk” and click “Create”

  7. Click “Continue” at the warning. We’re going to add the hard disk very soon.

  8. Click “Settings” with the “Kioptrix Level 1” VM selected

  9. Click “Storage” at the top.

  10. You should only see “Controller: IDE” in here. We need to add the hard drive on the IDE controller and not SATA. This VM won’t work (at least didn’t for me) when it was attached to SATA.

  11. Click the hard drive with a plus sign icon

  12. Click “Choose existing disk

  13. Click “Kioptrix Level 1.vmdk” and click “Open”

  14. Click “Network”

  15. Uncheck the network adapter

  16. It should now look like this

  17. Click “Audio”

  18. Uncheck the sound card

  19. It should now look like this

  20. Click “Ok” to save all of the changes

  21. Click “Start” on the Kioptrix Level 1 VM

  22. You should see the boot loader screen show a bunch of text. Next you should see the configuration screen, “Kudzu”.

  23. Press any key to enter the configuration wizard

  24. Your next options may be different, but in my scenario, the network card was the first option. We want to remove the network card from the virtual machine (the VM didn't automatically pick up network settings and work out of the box, this is my workaround).

  25. In the “Hardware Removed” screen for the network card, select “Remove configuration” and press the Enter key.
  26. The next option may be for the USB controller.

  27. Make sure “Do nothing” is selected and press the Enter key.

  28. If you have additional options for hardware, choose “Do nothing” and proceed out of this configuration wizard

  29. After everything continues to load and start, you should now be at the text login window for Kioptrix! We are not done yet with our prep though!

  30. You need to either:

    1. Shutdown the virtual machine by closing the virtual machine window

    2. Start a reboot sequence (Input > Keyboard > Insert Control+Alt+Delete), watch the system gracefully shut down the system, and then close the window before the VM starts up again

  31. With the VM powered off, go into “Settings” for the Kioptrix Level 1 VM

  32. Go to “Network”

  33. Check the box to enable the network adapter

  34. Choose “Host-only Adapter” with a “PCnet-PCI II Adapter” type

  35. Optionally, you can click the “refresh” button to generate a new MAC address

  36. Take note of the MAC address for future reference

  37. Click “Ok”

  38. Start the Kioptrix Level 1 VM

  39. Press any key on the Kudzu configuration wizard screen to enter the wizard

  40. The first screen for you should hopefully be the network card configuration wizard. You can click the X for the two VirtualBox messages at the top of the screen to make it easier to see.

  41. On the network card configuration screen, make sure “Configure” is selected and press the Enter key

  42. Click “Yes” to the “Migrate existing network configuration” question and press the Enter key

  43. Select “Do nothing” for the USB controller option and press the Enter key. You should now be done with the Kudzu configuration wizard and back to the black screen.

  44. We’ll need to verify we are able to successfully get the network card enabled and “Ok”.

  45. Keep an eye for the third line for “eth0” and make sure it says, “Ok”. That should be enough to make sure the network card was successfully attached to the virtual machine and was provided an IP address from the VirtualBox DHCP server.

  46. If all is well, you should be back at the Kioptrix login screen!



In the next post, we will go about assessing the virtual machine to see what we have.