Labels

Tuesday, May 21, 2019

Hack Lab #4 - Setting up Dradis for Tracking Hacking Activities

I have been using Kali Linux for a while since I started doing the OSCP labs.  Up to this point I had always used KeepNote to maintain my notes on what I did to what boxes and what I found in the labs.  However, I am now going to use Dradis to keep track of the same material.  I am doing this to ease the development of reporting - Dradis is capable of creating reports from its database.  This is going to be interesting since I have not used this tool before.  I have been playing around with it for a couple of days so I have a lot of junk in the database.  Since you are limited to one "project" at a time in Dradis-CE (community edition) I went on a hunt to find some way of being able to keep separate "project"s.  When I get back into the OSCP labs again, I want to keep separate databases of the exercises, the lab notes, and the challenge notes.

I was able to find a set of commands to reset the database at https://dradisframework.com/ce/documentation/reset.html.  I found out that using the following command

 "bundle exec thor dradis:reset"

while in the Kali Linux directory /usr/lib/dradis, I could reset everything and have a backup of what I had put into the archive.  So this led to a plan to keep things separate; I just have to remember to output a report of my findings before separating items out.  The sequence of steps is as follows:

  1. reset the database with "bundle exec thor dradis:reset" in the /usr/lib/dradis directory; note the backup file in a README file in the /usr/lib/dradis directory, what it contains and the date.
  2. change the .xml file that is used for initial project setup
  3. create a new project using the .xml file
  4. do what you do; take notes, add attachments, etc.
  5. perform periodic backups of the data, in case of system failure
  6. when complete, or at various times during the note taking, put out a report
  7. finish up with a database reset (#1 above) and start over

I may come back and update this information later.

Tuesday, May 14, 2019

Hack Lab #3 - Install Additional VMs to Give an Attack Surface

I ended up installing additional VMs from VulnHub to give me some practice before I get back into the OSCP labs.  I obtained the VMs from a list here and here.  The second list is a file from NetSecFocus on Google Drive and includes a list of OSCP like VMs and ones from HackTheBox.  The first ones that I installed were:

1. Kioptrix: Level 1 (#1): https://www.vulnhub.com/entry/kioptrix-level-1-1,22/
2. Kioptrix: Level 1.1 (#2): https://www.vulnhub.com/entry/kioptrix-level-11-2,23/
3. Kioptrix: Level 1.2 (#3): https://www.vulnhub.com/entry/kioptrix-level-12-3,24/
4. Kioptrix: Level 1.3 (#4): https://www.vulnhub.com/entry/kioptrix-level-13-4,25
5. Kioptrix: 2014: https://www.vulnhub.com/entry/kioptrix-2014-5,62/
6. FristiLeaks 1.3: https://www.vulnhub.com/entry/fristileaks-13,133/
7. Stapler 1: https://www.vulnhub.com/entry/stapler-1,150/
8. VulnOS 2: https://www.vulnhub.com/entry/vulnos-2,147/
9. SickOs 1.2: https://www.vulnhub.com/entry/sickos-12,144/

In addition, I installed the Kali VM from the OSCP class (new version based on Kali 2018.4 rolling).

Hack Lab #2 - Adding an OpenVPN Connection into the HomeLab

Strangely enough, I have a lot of equipment that is not being utilized all the time.  One thing that I wanted to do was to have a VPN connection into the house that I could use when I am on travel.  I just so happened to have a GL-AR300M laying around.  I also have both a GL-USB150 and a GL-AR750S-EXT as travel routers that I take with me.  I pretty much use the GL-USB150 to connect into my companies BYOD network.  Since it is a simple usb device, and can do WiFi relay, I use it as the main router for side projects when I am at work.  The GL-AR750S-EXT is also connected to my companies BYOD network, but is my main travel router when I am away.  I decided to add an OpenVPN connection to my house.

The main instructions for doing this are located at https://docs.gl-inet.com/en/3/app/openvpn/ for the Server portion and https://docs.gl-inet.com/en/2/app/openvpn/ for the client.  My server is going to be the GL-AR300M, I will attach it to an isolated vlan known as LAN5, and my client will be on the GL-AR750S-EXT.  I first set up LAN5 vlan throughout the network to keep it separate from anything else.  The LAN side of my server was connected to LAN5 and the WAN side was connected to my ISP router.  Right now while I do testing, I will not have it on my ISPs Router DMZ.  In fact I might isolate that out anyway.  No need to expose any more ports than necessary.  So the process is:

1. set up the server router in the home network
2. generate a .ovpn file using the GUI
3. download the .ovpn file (which is for the client)
4. at work, set up the client router
5. install the .ovpn file using the GUI
6. test out the connection
7. download the OpenVPN client to the personal laptop
8. install the .ovpn file on the personal laptop's OpenVPN client
9. test out the connection

Pretty simple, and it worked out just fine.

Hack Lab #1 - Installation of VMs on New Laptop with VirtualBox

So I went out and purchased a new laptop, an HP Pavillion, that I have been using as my travel personal laptop.  I usually carry both my work laptop and a personal laptop when I go on TDY.  I decided to try and setup a Hacking Lab on the new laptop using VirtualBox.  This is a bit of a change for me since I normally have done everything using VMWare. However, I have heard good things about the VirtualBox package, and since it is free I decided to give it a shot.  My version of VMWare Workstation is a bit out of date and I didn't want to spend the $140 or so to update it.  I have had great success with using KVM on Ubuntu (http://linuxweenie.blogspot.com/2016/07/wow-amazing-find-to-convert-vmware-to.html).

I am doing this primarily to get back into preparation for the OSCP labs.  I have been in the labs many times before, and I have taken the OSCP test but have not been completely successful at it.  So, I have added the Kali Linux VM by doing the following:

1. download the Kali Linux VM from https://cdimage.kali.org/kali-2019.1a/kali-linux-2019.1a-amd64.iso
2. launch VirtualBox and install Kali from the iso by following instructions on the screen; make sure to select encrypted drive for extra security (the reason that I did not install from the VirtualBox image)
3. set up a shared directory with the personal laptop and the Kali VM

I did have some issues with having a shared directory between the Kali VM and the laptop until I followed the instructions at https://docs.kali.org/general-use/kali-linux-virtual-box-guest.  I had forgotten that VMWare utilized not only the hypervisor parts but a small set of drivers that were loaded into the VM in order to perform all the functionality, including shared directories with the host.  So the following resolved the issue:

apt-get update
apt-get install -y virtualbox-guest-x11
reboot