Introduction to the course

Authors: Mikhail Zolotukhin and Timo Hämäläinen

1. Introduction

This tutorial is an introduction to the network security course. It explains how to start using VirtualBox and Linux terminal and interact with the course's tutorials and assignments. The remainder of the tutorial is organized as follows. Some preliminary tasks are given in Section 2. Section 3 discusses which kind of computer do you need to carry out the experiments described in the course's tutorials and assignments and how to use the course's dedicated servers in case you do not have such a computer. A brief introduction into VirtualBox is provided in Section 4. Section 5 explains how to work in Linux terminal. Advises how to ask for help in case of a problem are given in Section 6. Some dummy but mandatory assignments are listed in Section 7. Section 8 concludes the tutorial.

2. Preliminary questions

Look through the starting slides and the first lecture linked on the main page of the course and answer the following questions.

  • What is network security? Which parts of computer networks can be attacked? What is the main motive behind the majority of modern cyber attacks?
  • How will you learn network security in this course? How should you experiment with offensive security tools and methods presented in this course?

some test comment

22 Aug 23 (edited 28 Aug 23)

3. Host PC

The main idea of this course is that students carry out various experiments with a virtual network environment on their own. In particular, this means that each student (or group of students, if you chose to work in a group) should have a somewhat powerful computer that is able to run several virtual machines at the same time. Such a PC should have a more or less modern multi-core CPU and at least 24 GB of RAM. Theoretically, you can survive with 16 GB, but in this case in some tutorials you will probably need to substitute some of the VMs that use GUI with command-line-only alternatives, i.e. use Ubuntu Server instead of Ubuntu Desktop.

Alternatively, you may start using the faculty's servers dedicated for this course. Below are the instructions how to connect to "tieskybs0X.it.jyu.fi" servers. Here "X" is equal to "1", "2", "3", "4", "5", "6", "7" or "8", i.e. there are 8 different servers in use.

  1. First, you need to download a VNC client:

    https://courses.it.jyu.fi//TIES327/TigerVNC_1.13.1/

    There are Linux, MacOS and Windows client versions. It is recommended to use the latest version, i.e. 1.13.1.

    Users of old Windows computers also need an SSH client such as Putty:

    https://courses.it.jyu.fi//TIES327/Putty/
  1. After downloading and installing TigerVNC (and Putty, if needed), connections are created in such a way that an SSH tunnel is established first:

    • On Windows 10 (and probably 11, not tested), Linux and MacOS workstations:

      • To create an SSH tunnel from the localhost of the client workstation to the tieskybs0X's VNC port, simply run in a terminal (command window):

        $ ssh -L 5900:tieskybs0X.it.jyu.fi:5950 Anonymous@tieskybs0X.it.jyu.fi

        where substitute "X" with "1", "2", "3", "4", "5", "6", "7" or "8". It is recommended for students to use different numbers here, in order to balance the servers' loads. In other words, simply pick the number between 1 and 8 you like the most and substitute "X" with this number in both places in the command. Use your JyU account's password to login.

    • On older Windows workstations which do not have SSH clients built-in (or in the case the method above for some reason does not work), start Putty and configure the SSH tunnel as follows:

      • In the "Session" tab, fill in the "Hostname (or IP address)" box with "Anonymous@tieskybs0X.it.jyu.fi", where "X" is "1", "2", "3", "4", "5", "6", "7" or "8" (it is recommended for students to use different numbers here, in order to balance the servers' loads).

      • In column "Category", go to "Connection -> SSH -> X11", check box "Enable X11 Forwarding".

      • The tunnel should be defined on "Connection -> SSH -> Tunnels" page. The source port should be 5900, and destination - "tieskybs0X.it.jyu.fi:5950" where substitute "X" with the correct server number (also note that the ports are different: 5900 and 5950). Then, press "Add" button.

      • After that, go back to "Session", where the tunnel markings have been made. Here, you can also save your configuration so you can use it later. Finally, click "Open", to open the SSH tunnel, and then use JyU account's password to login.

  2. Once the tunnel has been opened, start the VNC client and configure it as follows:

    • Set "VNC server" as "localhost:5900"
    • Open "Options -> Security" tab; in "Encryption" part there should be "None" and "TLS with Anonymous certificates" options on, i.e. tick these two boxes
    • Also turn on all the options given in "Authentication" section: "None", "Standard VNC" and "Username and password"

    After that, just click "Connect" and the login screen of the tieskybs0X server selected should open in which you can enter your JyU credentials.

4. VirtualBox

VirtualBox is a cross-platform virtualization application. It extends the capabilities of your existing computer so that it can run multiple operating systems (inside multiple virtual machines) at the same time. You can install and run as many virtual machines as you like - the only practical limits are disk space and memory.

If you are using your own computer, download and install the latest version of VirtualBox and Extension Pack for your operating systems from here or there. If you are using the course's dedicated servers, Virtualbox can be found in "Applications -> System Tools". Online user manual for Oracle VirtualBox can be found here.

In VirtualBox, create a new virtual machine as follows:

  1. Go to menu "Machine" at the top of the VirtualBox Manager window and press "New" (in some versions of VirtualBox there is just button "New" at the top). A wizard will pop up to guide you through setting up a new virtual machine (VM).
  1. On the first page, select name and operating system of your new VM. The VM name will be shown later in the VM list of the VirtualBox Manager window, and it will be used for the VM's files on disk. For example, enter name "test". Select "Linux" as OS type and "Ubuntu (64-bit)" as its version. It is worth noticing that the operating system selected here will not be magically installed on the VM! This menu is simply used to tell VirtualBox which OS you are planning to install later so that it can adjust some of its default settings. Press "Next".
  1. On the next page, select the memory (RAM) that VirtualBox should allocate every time the virtual machine is started. For example, select 1024 MB. As with the other settings, you can change this one later, after the VM has been created.
  1. Next, you must specify a virtual hard disk to be used for your VM. Here, simply select "Create a virtual hard disk now" and press "Create". In the next menu, select "VDI" as the disk type and then "Dynamically allocated". VirtualBox supports two types of image files. A fixed-size file incurs less overhead and may therefore be slightly faster than a dynamically allocated one, however it will immediately occupy the file specified, even if only a fraction of the virtual hard disk space is actually in use. A dynamically allocated file will only grow in size when the guest actually stores data on its virtual hard disk. For this reason, it is recommended to use the dynamically allocated disk file.
  1. To prevent your physical hard disk from running full, VirtualBox limits the size of the image file. Still, it needs to be large enough to hold the contents of your operating system and the applications you want to install - for a modern Windows or Linux guest, you will probably need several gigabytes for any serious use. In normal circumstances, a dynamically allocated image file with size limit of 25-30 GB should be enough to create a virtual appliance used in the tutorials of this course. Thus, select "25,00 GB" as the hard disk size and click "Create".
  1. Once the new virtual machine has been created, find it in the list on the left side of the Manager window.
  1. In order to use this VM, you first have to install an operating system. In this course, we will use Ubuntu most of the time. Download Ubuntu Server from Official Ubuntu web page.
  1. Once the image has been downloaded, insert it into CD/DVD drive of your new VM as follows. Select the VM created earlier. In the right-top panel find menu "Settings", press it, and select "Storage" in the list on the left. In "Storage devices" under "Controller: IDE" select CD/DVD drive (the button that looks like a CD/DVD disk and is by default called "Empty"). On the right panel, click the button that looks like a disk with a tiny arrow, select "Choose a disk file..." in drop-down menu and browse to the ISO-image of Ubuntu Server you have downloaded. Click "OK".
  1. Select the VM and click "Start" in the top-right panel. In the case of success, you will see the OS installation menu. If this is the case, select "Install Ubuntu" or "Try and install Ubuntu" or something similar to that (these always change in different Ubuntu versions), and move to the next step.

    If you have never run VirtualBox or other virtualization software on your computer, there is a high probability, that virtualization is disabled in your computer's BIOS. You will notice that if you try to start your test-VM and see an error message of kind "VT-X is disabled..." or "Virtualization is disabled..." or something similar. In this case, you should enable it in BIOS. For this purpose, close the VM and open a browser. The easiest way to find out how to enable virtualization on your PC is to google "How to enable virtualization on" and add the model of your computer. In general the process is similar to the following. Restart PC and, when it is starting up, enter BIOS by pressing the required key. The key can be F2 or F10 or F12 or something else depending on your computer manufacturer. Once you have entered the BIOS menu, try to find "VT-X" or "Virtualization" or something similar to that in "Device Configuration" (menu title also can be different in your case) and enable it. Once virtualization has been enabled, save changes and exit BIOS. After reboot, you should be able to start your VM.

    One more error message that you might see when staring your VM for the first time looks as follows: "Kernel driver not installed (rc=-1908). The VirtualBox Linux kernel driver (vboxdrv) is either not loaded or there is a permission problem with /dev/vboxdrv". In this case, you have to disable "Secure boot" in your computer's BIOS. This error is obviously specific to Linux, but on other OSs you can sometimes see something similar. If this is the case, disabling "Secure boot" can be a solution.

  1. Once the VM has started, install Ubuntu on it. The process is quite straightforward as most of the time you should just select a default option. If you are not sure what to do, there are tons of existing guides in the Internet that you can read. Below are just some key points.

    Select the correct layout of your keyboard so you do not have to struggle in the future. Select full (default) installation, not the "minimized" one. Select default network adapter, proxy and mirror address (make sure that the mirror passes the test, if there is one). Select "use an entire disk" when choosing the storage layout and then default partition scheme, i.e. do not change anything just press "Done". For the name, server's name and password use something simple, e.g. "test". When asked about services you want to install, just skip for now as this is a test VM and we will not really use it during the course.

    In the case of success, the installation process will start. Once it has completed, you will be asked to restart the VM. After the restart, login using the credentials entered during the installation.

5. Linux terminal

Once you have logged in to your new VM, you will be able to enter commands into the terminal. It is worth saying that 95% of the time at this course you will work in a Linux terminal. If you are not familiar with it, here is a mini crash course.

  1. In the terminal, you type a command and then execute it by pressing "Enter". Some of the popular commands frequently used throughout the course's tutorials are:

    • pwd - print the current cirectory
    • cd - change directory
    • ls - list content of a directory
    • cp - copy a file or a directory
    • rm - remove a file or directory

    More commands can be found in our tutorial on Linux terminal or other numerous tutorials on the Internet.

    For example, enter the following command into the terminal of your new VM:

    $ pwd

    In the command below, "$" is not part of the command, but just an indicator that this is a command you enter in the terminal. Sometimes, we will use "#" for the same purpose. It will indicate that at this point you are logged in as a superuser.

    The command above will print your current directory, if you have not changed anything by this point, it should be "/home/test". Instead of "test" it can be another username, more specifically the one you entered during Ubuntu installation.

  1. Speaking of superusers, some commands are required to be executed using superuser privileges. This can be achieved by adding "sudo" at the beginning of the command.

    For example, execute the following command:

    $ apt install unzip

    to install Unzip which is a tool to extract files from archives. The result will be "Permission denied".

    Add "sudo" to the command and try again. It is worth saying, that you do not have to type the same command again. Instead just press arrow-up button on your keyboard. This will enter the command previously executed, i.e. "apt install unzip". Edit it by adding "sudo":

    $ sudo apt install unzip

    and press "Enter". This should install the tool successfully. You can also press arrow-up (as well as arrow-down) button several times in order to go through the commands previously executed.

  1. To edit files, we will often use Nano which is a simple text editor which should be available on Ubuntu by default. For example, if we want to edit file "/etc/netplan/00-installer-config.yaml", we can execute "sudo nano" followed by the entire file path ("sudo" is required here because the file is located in a system configuration directory "/etc").

    There is one simple trick that will save you a lot of time in cases like that. Well, it is not anything special, but turns out it is not common knowledge especially for students coming from non-IT background. First, enter:

    $ sudo nano /etc/netplan/

    and then press "Tab" on your keyboard. This will automatically complete the command with the correct file name, because there are no other files in directory "/etc/netplan/".

    Execute the complete command. As a result, you should see file with network configurations opened in the text editor. For the sake of demonstration, just add a line starting with "#" at the very end of the file, e.g.:

    # test 123

    Here "#" is used to comment, i.e. the line added will not affect the network settings of the VM in any way.

    Press "Ctrl + X" and then "Y" to save the modified file. You can then print the file as follows (use "Tab" for faster typing):

    $ cat /etc/netplan/00-installer-config.yaml

    As a result, you should see that your modifications have been saved in the file.

    It is worth noticing, that pressing "Tab" can be used to complete other Linux terminal commands as well. For example, enter:

    $ sudo apt install net-

    and press "Tab" two times. You will see that there are several options available: "net-acct", "net-tools" and may be something else. As mentioned above, using "Tab"-trick is very useful as it can save you a lot of time when typing long commands in the terminal.

  1. When going through a tutorial of the course, you will often copy commands from the tutorial to Linux terminal of one of your VMs. Judging from past experience, this is not always an easy task :) Problems usually arise when there is a long command that cannot fit on the same line, and therefore it is written on several ones in the tutorial for the sake of better readability. Check for example the following command:

    $ wget -O intro.txt http://student:Ties327_2023@users.jyu.fi/%7Emizolotu/teaching/
    files/intro.txt

    It will use tool Wget to download file "intro.txt" and save it under the same name. You will not be able to copy the command to the terminal of your VM with Ubuntu Server installed, but further in the course we will use VMs with GUI in which you can copy-paste the commands from the tutorials to the terminal.

    For now, we can use TIM's own shell plugin instead for our experiments. Copy the command above to the TIM's terminal below. Since the command is written on two lines, there will be a line break between "teaching/" and "files". "Fix" it and execute the command by pressing "Enter". Make sure that the correct file has been successfully downloaded. If you see "ERROR 403: Forbidden", it is forbidden for you to continue with this course :)

    In the case of success, check the content of file "intro.txt" using command "cat" as demonstrated earlier.

    Finally, it is worth mentioning that such behavior (a line break in long commands) will be observed in many places throughout the course, therefore, please be careful when copy-pasting commands from the tutorials.

# shell

6. Help

In the case you have a difficulty with one of the course's tutorials and/or assignments, there are several options how you can ask for some help. Below is the list of these options sorted starting with the best one:

  1. Create a post with detailed description of the problem in the chat page. This is the best option in our opinion, because the answers are visible to everyone, and since the questions asked by students are often very similar, this will save a lot of time for the teachers and the students. The teachers promise to check the chat page on a daily basis, so you will receive an answer relatively quickly. Other students can also reply to your posts.
  2. Add a comment under the tutorial with which you have a difficulty. This method has the same advantages as the previous one. It is less efficient, because the questions are spread over different documents so there is a small probability that your comments will be missed and therefore answered with a delay.
  3. Add a side comment in the place of the tutorial where you have a problem. This is less efficient than the previous method, because the space on the side is limited, and the comments often start overlapping with each other making the whole thing unreadable. Also the comments are spread even more so there is no guaranty that your comments will be noticed by the teachers in time.
  4. You can also send an email to the course teachers. However, please do not do it unless there is an "emergency". There are more than 100 students, and if everybody starts sending emails it will saturate the teachers' email box very quickly. From the past experience, students often ask the same questions, thus, it makes more sense to use the chat and/or the comments so that the questions and answers are visible to everybody.

In addition to these four methods, there will be one or two Zoom sessions every week during which the assignments can be done together. These can be attended by students in order to solve the problems in an "interactive" mode in real time. More information on these sessions can be found on the main page.

7. Assignment

At the end of each tutorial, there are several assignments that are automatically graded by the system. Based on the number of attempts you have, the assignment questions can be divided into three categories:

  1. The first category contains only simple test-like questions with a single correct answer; the number of attempts for questions from this category is usually 1.
  2. The second category includes the following question types: a single test-like question with multiple correct answers, a block of test-like questions each with one single correct answer, and a block of test-like questions each with multiple correct answers; as a rule, the number of tries you have to answer questions from this category is 2.
  3. The last category includes a single open question and a block of open questions. The number of attempts for questions from this category is 5.

This tutorial is not an exception, but, since this is an introduction, the number of tries you have for each question in this tutorial is 1000 times greater than the number of tries for the same question type in the future real assignments. However, to be able to continue with the course you must answer all the questions given below correctly, i.e. score 10 out of 10!

Check the first block of questions below. As you can notice, each question in the block has radio-buttons, this basically means that there is only one correct answer. Read the main question in the header and select the option that in your opinion is correct for each line in the block. The answers given will be evaluated once you click "Save". After that, the number of points granted and the number of tries left for this block of questions will be shown in the top-left corner of the block.

# intro1

Check the next question. Similarly to the ones in the block above, the options are radio-buttons meaning that there is again only one correct answer.

Answer the question below based on the information given in the tutorial about asking for help in case you have difficulties with the course's tutorials and/or assignments.

# intro2

In the next two questions, the options are check-boxes. This means that there can be multiple correct answers and you have to select them all in order to earn some points.

In the VirtualBox Manager, inspect network settings of your test-VM. For this purpose, click "Settings" and then "Network". Which networking modes are available for selection for the network adapter enabled?

# intro3

Try to execute the following commands in the terminal of your test-VM:

$ echo test123 > tmp.txt
$ apt install net-tools
$ cat /etc/sudoers
$ cp /etc/hostname /tmp

Which of these work correctly without sudo and which require superuser privileges?

# intro4

The last two assignments are open, meaning there are no options to choose from.

Download file "intro.txt" using wget in TIM's terminal as described in Section 5 and print its content, e.g. using "cat". Copy-paste the result to the answer box below.

Content of file "intro.txt" (1 point).

# intro5

Similarly, download file "keylog_reader.sh" using the TIM's terminal given in Section 5:

$ wget -O keylog_reader.sh http://student:Ties327_2023@users.jyu.fi/%7Emizolotu/
teaching/files/keylog_reader.sh

Copy-paste the first and the last line of this file to the corresponding answer boxes below. As previously you can use "cat". Another option is using "head" and "tail" commands to respectively print the first few and the last few lines of the file.

# intro6

As mentioned above, you must answer all the questions correctly to pass, i.e. score 10 out of 10, otherwise your points for the future (real) assignments will not be awarded. Therefore, make sure that you have obtained maximum possible number of points in each assignment.

8. Conclusion

Well, there is nothing to conclude yet. So just jump to the first assignment and have a good time. Good luck!

9. Comments (click here to comment)

another test comment

22 Aug 23 (edited 22 Aug 23)

test comment

11 Sep 23

These are the current permissions for this document; please modify if needed. You can always modify these permissions from the manage page.