Post

Building a Virtual Security Home Lab: Part 9 - Tsurugi Linux (DFIR) Setup

A step-by-step guide for building your very own Cybersecurity Home Lab using VirtualBox

Banner Background by logturnal on Freepik
Hacker Image by catalyststuff on Freepik

In this module, we are going to set up Tsurugi Linux which is an OS that comes pre-configured with many of the commonly used Digital Forensics & Incident Response tools. Before deploying the VM we will create a new Interface in pfSense called Security that will have our DFIR VM and in the future other security tools.

Creating New Interface

As discussed in the last module using VirtualBox GUI we cannot create more than 4 interfaces but using the CLI we can create up to 8 Interfaces.

Creating new Interface

Before creating the interface we need the name of the pfSense VM. In my case, the VM is called “pfSense”. Also, ensure the VM is “Powered Off” before running the commands.

The last Adapter we created is called Adapter 5.

vbox-45

Launch PowerShell and run the following commands:

1
2
3
4
5
6
7
8
9
10
11
# Create a Internet Network
VBoxManage modifyvm "pfSense" --nic6 intnet

# Use the Paravirtualized Adapter
VBoxManage modifyvm "pfSense" --nictype6 virtio

# Give it the name LAN 3
VBoxManage modifyvm "pfSense" --intnet6 "LAN 4"

# Network Interface is connected by Cable
VBoxManage modifyvm "pfSense" --cableconnected6 on

In the above commands “pfSense” is the name of my VM.
In the 3rd command in place of “LAN 3” you can use a different name that matches your network name convention.

vbox-46

The pfSense VM will now have an Adapter 6.

vbox-47

Enabling the Interface

Start the pfSense VM. pfSense will not detect the new interface. We need to onboard the interface before it shows up.

pfsense-100

Enter 1 to select “Assign Interfaces”.
Should VLANs be set up now? n

pfsense-101

Enter the WAN interface name: vtnet0
Enter the LAN interface name: vtnet1
Enter the Optional 1 interface name: vtnet2
Enter the Optional 2 interface name: vtnet3
Enter the Optional 3 interface name: vtnet4
Enter the Optional 4 interface name: vtnet5

pfsense-102

Do you want to proceed?: y

pfsense-103

The new interface is onboarded. Now we need to assign it an IP address.

pfsense-104

Enter 2 to select “Set interface(s) IP address”. Enter 6 to select the OPT4 interface.

pfsense-105

Configure IPv4 address OPT3 interface via DHCP?: n
Enter the new OPT4 IPv4 address: 10.10.10.1
Enter the new OPT4 IPv4 subnet bit count: 24

For the next question directly press Enter. Since this is an LAN interface we do not have to worry about configuring the upstream gateway.

pfsense-106

Configure IPv6 address OPT4 interface via DHCP6: n
For the new OPT4 IPv6 address question press Enter.
Do you want to enable the DHCP server on OPT4?: y
Enter the start address of the IPv4 client address range: 10.10.10.11
Enter the end address of the IPv4 client address range: 10.10.10.243
Do you want to revert to HTTP as the webConfigurator protocol?: n

pfsense-107

Now interface OPT4 will have an IP address.

pfsense-108

Renaming the Interface

Launch the Kali Linux VM. Login to the pfSense web portal. From the navigation bar select Interfaces -> OPT4.

pfsense-109

In the description field enter SECURITY. Scroll to the bottom and click on Save.

pfsense-110

Click on Apply Changes in the popup that appears to persist the changes.

pfsense-111

Interface Firewall Configuration

From the navigation bar click on Firewall -> Rules.

pfsense-95

Select the SECURITY tab. Click on the “Add” button to create a new rule.

pfsense-112

Change the values as follows:
Action: Block
Address Family: IPv4+IPv6
Protocol: Any
Source: SECURITY subnets
Destination: WAN subnets
Description: Block access to services on WAN interface

Scroll to the bottom and click on Save.

pfsense-113

Ignore the popup for saving changes. Click on “Add” to create a new rule.

Change the values as follows:
Action: Block
Address Family: IPv4+IPv6
Protocol: Any
Source: SECURITY subnets
Destination: LAN subnets
Description: Block access to services on LAN

Scroll to the bottom and click on Save.

pfsense-114

Click on “Add” to create a new rule.

Change the values as follows:
Address Family: IPv4+IPv6
Protocol: Any
Source: SECURITY subnets
Description: Allow traffic to all subnets and Internet

Scroll to the bottom and click on Save.

pfsense-115

In the popup click on Apply Changes to persist the new rule.

pfsense-116

The final result will be as follows:

pfsense-117

Reboot pfSense

Now we need to restart pfSense to ensure that the firewall rules are propagated properly. From the navigation bar select Diagnostics -> Reboot.

pfsense-118

Click on Submit.

pfsense-119

Once pfSense boots up you will be redirected to the login page.

Tsurugi Linux Setup

Download Image

Go to the following URL: Tsurugi Linux - Downloads. Select one of the Mirror Links.

tsurugi-1

Download the ISO image. As of writing the latest version of Tsurugi Linux is 2023.2.
The ISO is ~16GB. It will take a while to download.

tsurugi-2

After the download is complete we will have a .iso file.

tsurugi-29

Creating the VM

Select Tools from the sidebar and then select New.

tsurugi-3

Give the VM a name and then select the downloaded ISO image. Click on Next.

tsurugi-4

Increase the Base Memory to 4096MB and then click on Next.

tsurugi-5

Increase the Hard Disk size to 150GB.

Tsurugi Linux installation will not work if we provide less than 110GB of storage.

tsurugi-6

Click if all the settings look right and then click on Finish.

tsurugi-7

Adding VM to Group

Right-click on the VM name and then select “Move to Group” and then choose New.

tsurugi-8

Right-click on the group name, select “Rename Group” and call it “Security”.

tsurugi-9

Right-click on the group name, select “Move to Group” and then select “Home Lab”.

tsurugi-10

The final result should match the following:

tsurugi-11

Configuring the VM

Select the VM and then from the toolbar select “Settings”.

tsurugi-12

Go to System -> Motherboard. In Boot Order ensure that Hard Disk is on top followed by Optical. Uncheck Floppy.

tsurugi-13

Go to Network -> Adapter 1. For the Attached to option select Internal Network. For name select LAN 4. Click on OK to save the changes.

tsurugi-14

Installing Tsurugi Linux

Select the VM and from the toolbar select Start.

tsurugi-15

Press Enter to start the Tsurugi Linux in GUI mode.

tsurugi-16

Once on the desktop double-click on Displays.

tsurugi-17

In the Resolution window select 1600x1050 and click on Apply.

tsurugi-18

Click on “Keep This Configuration” to confirm the changes.

Without changing the resolution of the screen you will not be able to see the buttons that are present at the bottom of the Installer.

tsurugi-19

Double-click on the “Install Tsurugi Linux 2023.2” icon to start the installer.

tsurugi-20

Once the installer starts. Use the scrollbar on the right side of the VM display and scroll to the bottom. Select your language and click on Continue.

tsurugi-21

Select Keyboard and click on Continue.

tsurugi-22

Enable “Install third-party software for graphics and Wi-Fi hardware and additional media features” and click on Continue.

tsurugi-23

Click on Install Now.

tsurugi-24

Click on Continue.

tsurugi-25

Select your location/timezone using the map and click on Continue.

tsurugi-26

Provide a username, computer name and password then click on Continue.

tsurugi-27

tsurugi-28

After the installation is complete click on “Restart Now”.

tsurugi-30

When the VM reboots you might get the following screen. VirtualBox should automatically remove this disk when the screen appears. Press Enter to continue.

tsurugi-31

Login using the password that was configured.

tsurugi-32

Post-Install Configuration

Guest Additions Installation

Click on Devices -> Inert Guest Additions CD Image. This will insert the ISO image.

tsurugi-33

You might be prompted for credentials. Enter the password and click on Authenticate.

tsurugi-34

From the top right corner click on the CD icon then select Mount VBox_GAs.

tsurugi-35

The ISO image will not be visible on the desktop. Double-click on the Image icon.

tsurugi-36

From the toolbar select Tools -> Open Current Folder in Terminal.

tsurugi-45

Run the following command to install Guest Additions.

1
sudo ./VBoxLinuxAdditions.run

tsurugi-46

Once the installation is complete. Press Right Ctrl+F to enter Fullscreen mode. The same key can be used to exit Fullscreen the VM will scale to fit the window size. From the top right corner select Eject VBox_GAs to remove the ISO image.

tsurugi-38

To Shutdown the system click on the power icon beside the clock then select “Shut Down”.

tsurugi-39

Select “Shut Down

tsurugi-40

Updating the System

Open the terminator app from the desktop and run the following command:

1
sudo apt update && sudo apt full-upgrade

tsurugi-44

If there are any updates click Enter to start the installation. Provide your password when prompted.

Creating VM Snapshot

Shut down the VM before creating a Snapshot. Use the Hamburger menu beside the VM name to access the Snapshot page.

tsurugi-41

Click on Take to create a Snapshot.

tsurugi-42

Give the Snapshot a descriptive name and click on OK.

remnux-12

Use the Hamburger menu and click on Details to return to the main page.

tsurugi-43

In the next module, we will install Ubuntu and then download and set up Splunk. We will also install the Splunk Universal Forwarder on the Domain Controller in our Active Directory Lab. This will allow us to capture the events that are generated on the Domain Controller.

Part 10 - Splunk Setup & Configuration

This post is licensed under CC BY 4.0 by the author.