If you can see this check that

Main Page


Gentle Revision

User:
Password:

Authors: Rich Macfarlane, Gordon Russell

Objectives

To reset all the check buttons from a previous attempt click here

Question 1: Access

To access Kali you need to start the image (remember this is Kali 2020-4 and not some other version or a different operating system). You then need to log into the image remotely using a variety of methods. You should try to use ssh, plus the graphical interface VNC. You need to allow java applets, and have ssh installed (e.g. putty.exe).

On some highly secured networks, you may not be able to use java or ssh, but give all of the methods a go and try to get both a command prompt "terminal" interface and VNC working.

The username is "root" and the password is "kali".
The terminal is started within the graphical interface by clicking on the terminal application in the main menu.

Tests - not attempted
Logged in via VNC UNTESTED
Running a terminal in VNC UNTESTED
Running a non-vnc connection (ssh) UNTESTED

Question 2: Create and Navigate Directories

The "cd" command changes your current directory. On its own it changes it to your HOME directory, otherwise you need to specify a parameter which either is an absolute directory (such as cd /home) or a relative directory (such as cd dir1 which takes you to dir1 in your current working directory).

Type

cd
pwd
This will take you to your home directory and then Print Working Directory.

What is your current working directory? :

Tests - not attempted
Correct cwd UNTESTED

Make three directories in your HOME directory. Name these directories "magic", "happy", and "sad".

Tests - not attempted
Three directories created UNTESTED

Change your working directory into "magic". Create two more directories in this directory called "dir1" and "dir2". If you create them in the wrong place delete them using "rmdir".

Tests - not attempted
Two directories created UNTESTED
Not accidentally created in HOME UNTESTED

Change directory into dir2.

What is your current working directory? :

Tests - not attempted
Correct cwd UNTESTED

Change your current working directory to /root. You can either "cd /root" or "cd ..", as ".." means the directory above the current directory in your directory tree. Check with pwd to make sure you are in the right directory. Then try to delete the data directory using "rmdir magic". What message to you get back?

Tests - not attempted
Error message displayed UNTESTED

Use the more powerful and dangerous command

rm -rf magic
This deletes all files and directories in the data directory, including the data directory itself. Obviously getting the parameter wrong means you can lose a lot of stuff in one go!

Tests - not attempted
Two directories left... UNTESTED

Question 3: The ls command

The "ls" command on its own shows you the contents of the current working directory. However it can also take a number of useful parameters.

Filenames which begin with a "." character do not usually appear when you use "ls". These are called "hidden" files, and they are used for things like application configuration and some GUI state information. They are rarely needed so this is the reason they are hidden from normal "ls".

Use the option "-a" to see the hidden files. View the hidden files in your HOME directory (i.e. /root). The file list starts with "." (which is a directory that you can use to describe the current directory in commands) and ".." (which describes the directory above this one in the tree).

What is the third file or directory (in alphabetical order) which appears when you use "-a" in your HOME directory. You should consider "." as the first file and ".." as the second file. :

Tests - not attempted
Third file when using -a UNTESTED

Use the "-l" option to see a long listing of a file. Get a long listing of "/etc/group" and identify its size in bytes. :

Tests - not attempted
Size of /etc/group UNTESTED

Use the "-F" option to see identification information about files. The "type" appears as a single character at the end of each filename. Use this option and identify the type of /vmlinuz :

Tests - not attempted
Type character of /vmlinuz UNTESTED

Use the "man" command to see the man page for "ls", i.e. "man ls". Use the cursor keys to move around, and find the option which makes ls give its output in human readable form for sizes. Use that in combination with the "-l" option to get the human readable size of "/bin/ls". Include the units, so if in human readable form the size is "10M" type "10M" (case sensitive). :

Tests - not attempted
Human readable size of /bin/ls UNTESTED

Question 4: Relative and Absolute

Demonstrate your understanding of relative, absolute, and the use of ".." and "/" and "." in the "cd" command by answering these questions. Try to answer them in your own head, and use the command line only if you are confused. Remember paths beginning with "/" are relative to the top level directory, whereas others are relative to the current directory. ".." takes you up a directory, and things can be seperated with "/" such as "../.." taking you up 2 directories. "." indicates the current directory, and is really only useful where you really need to specify a parameter but you mean to say the current directory. Always supply the SHORTEST solution, remember the answers are CASE SENSITIVE, and if you type spaces in an answerbox where no space should be entered then it will be marked incorrectly.

Do not type the command in unless really stuck. Do these in your head!

Consider these commands:

cd /usr/share/doc
cd ..
pwd
What is the current directory:

Tests - not attempted
Correct cwd UNTESTED

Consider these commands:

cd /usr/share
cd vim
pwd
What is the current directory:

Tests - not attempted
Correct cwd UNTESTED

Consider these commands:

cd /usr
cd lib
cd xorg
pwd
What is the current directory:

Tests - not attempted
Correct cwd UNTESTED

Consider these commands:

cd
cd ../.. 
pwd
What is the current directory:

Tests - not attempted
Correct cwd UNTESTED

Consider these commands:

cd
cd ../home
pwd
What is the current directory:

Tests - not attempted
Correct cwd UNTESTED

Consider these commands:

cd /usr/share
cd vim/../../lib/xorg
pwd
What is the current directory:

Tests - not attempted
Correct cwd UNTESTED

Consider these commands:

cd /usr/share
cd /etc/vim
cd ..
pwd
What is the current directory:

Tests - not attempted
Correct cwd UNTESTED

Consider these commands:

cd 
cd ../../usr/share/doc
pwd
What is the current directory:

Tests - not attempted
Correct cwd UNTESTED

Consider these commands and fill in the blank:

cd
cd ../
pwd
Where the "pwd" command prints "/usr/local/lib".
Note this is an example of a RELATIVE pathname parameter to cd, as the parameter does not start with a "/".

Tests - not attempted
Correct blank UNTESTED

Consider these commands and fill in the blank:

cd /usr/share/doc
cd /
cd nfs
pwd
Where the "pwd" command prints "/var/lib/nfs"
Note this is an example of an ABSOLUTE pathname parameter to cd, as the parameter starts with a "/".

Tests - not attempted
Correct cwd UNTESTED

Consider these commands and fill in the correct blank using a RELATIVE pathname. It should be the SHORTEST possible solution.

cd /usr/share/python
cd 
pwd
Where the "pwd" command prints "/usr/share/perl5/Encode".

Tests - not attempted
Correct cwd UNTESTED

Consider these commands and fill in the correct blank using a RELATIVE pathname. It should be the SHORTEST possible solution.

cd /usr/share/perl
cd 
pwd
Where the "pwd" command prints "/etc"

Tests - not attempted
Correct cwd UNTESTED

Consider these commands and fill in the correct blank using a RELATIVE pathname. It should be the SHORTEST possible solution.

cd /etc
cd 
pwd
Where the "pwd" command prints "/etc"

Tests - not attempted
Correct cwd UNTESTED

Question 5: Nano Editing

Use nano to create a file /root/edit1. Cut and paste the following text into edit1 and save the file. Remember you cannot easily cut and paste to a vnc terminal, so use ssh. Do not insert additional lines (even blank lines) or extra space characters.

asdaslkalsdklnnnne lazy dog quick frog
6f2d9937604b8422abc7493a7ff0c884 /etc/host.conf
This is an exercise!
Up, down,
left, right,
build your terminal's
muscles bit by bit

In all the editor questions you must WRITE the file in order to pass the question.

Tests - not attempted
Line 1 found somewhere UNTESTED
Line 2 found somewhere UNTESTED
Line 3 found somewhere UNTESTED
Line 4 found somewhere UNTESTED
Line 5 found somewhere UNTESTED
Line 6 found somewhere UNTESTED
Line 7 found somewhere UNTESTED
All edits complete UNTESTED

Delete the word "an" from line 3, plus one of the spaces. The line left should read "This is exercise!".

Tests - not attempted
line check UNTESTED

Add " and byte by byte" to the end of the line "muscles bit by bit".

Tests - not attempted
line check UNTESTED

Append to the end of the file a new line which reads:

123456789 123456789
Tests - not attempted
All edits complete UNTESTED

Using mark (^^ i.e. CTRL and ^) mark the whole of the first line of the file and then cut (^K) that line out. Move that line and paste it back in (^U) so that the line is now line 2 in the file. Edit afterwards to make sure there is not a blank line left at the start.

Tests - not attempted
All edits complete UNTESTED

Now cut out the long hex word on line 1 (beginning 6f2 and ending 884) Leave this first line with a leading space. Now put this hex number at the end of the last line (after 6789) making sure to put a space between the 6789 and the 6f2. Save the file.

Tests - not attempted
All edits complete UNTESTED


Centos 7 intro: Paths | BasicShell | Search
Linux tutorials: intro1 intro2 wildcard permission pipe vi essential admin net SELinux1 SELinux2 fwall DNS diag Apache1 Apache2 log Mail
Caine 10.0: Essentials | Basic | Search | Acquisition | SysIntro | grep | MBR | GPT | FAT | NTFS | FRMeta | FRTools | Browser | Mock Exam |
Caine 13.0: Essentials | Basic | Search | Acquisition | SysIntro | grep | MBR | GPT | FAT | NTFS | FRMeta | FRTools | Browser | Registry | Mock Exam |
CPD: Cygwin | Paths | Files and head/tail | Find and regex | Sort | Log Analysis
Kali: 1a | 1b | 1c | 2 | 3 | 4a | 4b | 5 | 6 | 7a | 8a | 8b | 9 | 10 |
Kali 2020-4: 1a | 1b | 1c | 2 | 3 | 4a | 4b | 5 | 6 | 7 | 8a | 8b | 9 | 10 |
Useful: Quiz | Forums | Privacy Policy | Terms and Conditions

Linuxzoo created by Gordon Russell.
@ Copyright 2004-2024 Edinburgh Napier University