CY2004-CyberSec Assignment No. 1
CY2004-CyberSec Assignment No. 1
INSTRUCTIONS
Lab Objectives:
• Virtualization
• VMware Workstation and its Installation
• Install Linux on VMware Workstation
• Linux Terminal Commands
Lab Description:
Deadline for submission: August 31, 2024 (11:59 PM) Total Marks:120
CY-2004 Cyber Security Fall 2024 ASSIGNMENT No. 1
Advantages of virtualization
VMware
• VMware is one of the best virtualization platforms in the world, popular among IT
specialists due to its ability to provide high speed operations, reliability,
scalability, security and convenience.
• It is essential to internal penetration testing as most organizations use it for their
infrastructure.
• As security professionals, we need to learn about this technology and
understand the attacks that can be carried out against it.
• VMware is an amazing virtualization platform for network engineers, system
administrators and other information technology professionals.
• In this lab, we will focus on VMware Workstation Player. We will learn VMware
Download and VMware Workstation Installation step by step.
Deadline for submission: August 31, 2024 (11:59 PM) Total Marks:120
CY-2004 Cyber Security Fall 2024 ASSIGNMENT No. 1
• With VMware, you can create virtual devices on our PC and use them as they are
real devices.
• This device can be a Windows server, Linux server etc. With VMware workstation
player, we can have multiple virtual devices, and we can run virtual devices,
programs on them.
Tools/Software Requirement:
1. VMware
(https://support.broadcom.com/group/ecx/productdownloads?subfamily=VMware%20Workst
ation%20Pro&authuser=0)
2. Kali Linux ISO (https://cdimage.kali.org/kali-2024.2/kali-linux-2024.2-installer-amd64.iso)
Deadline for submission: August 31, 2024 (11:59 PM) Total Marks:120
CY-2004 Cyber Security Fall 2024 ASSIGNMENT No. 1
Deadline for submission: August 31, 2024 (11:59 PM) Total Marks:120
CY-2004 Cyber Security Fall 2024 ASSIGNMENT No. 1
✓ Read the agreement, then accept the agreement, & click Next to continue.
Deadline for submission: August 31, 2024 (11:59 PM) Total Marks:120
CY-2004 Cyber Security Fall 2024 ASSIGNMENT No. 1
✓ Set installation path or use default, them enable Enhanced Keyboard Driver & click Next.
Deadline for submission: August 31, 2024 (11:59 PM) Total Marks:120
CY-2004 Cyber Security Fall 2024 ASSIGNMENT No. 1
✓ Click Install.
Deadline for submission: August 31, 2024 (11:59 PM) Total Marks:120
CY-2004 Cyber Security Fall 2024 ASSIGNMENT No. 1
Below is the home screen of the VMware Workstation pro which you will see every time when you start
Workstation.
Deadline for submission: August 31, 2024 (11:59 PM) Total Marks:120
CY-2004 Cyber Security Fall 2024 ASSIGNMENT No. 1
• Select Installer disc image file, then click on browse… to add the iso of kali Linux downloaded
in previous step & click Next to continue.
Deadline for submission: August 31, 2024 (11:59 PM) Total Marks:120
CY-2004 Cyber Security Fall 2024 ASSIGNMENT No. 1
• Select Linux from Operating system, then from version dropdown select Debian 12.x 64-bit &
click Next to continue.
• Provide some name to virtual machine, the browse for the location where to save the virtual
machine. Make sure there is at least 40GB space in your selected drive & click Next to
continue.
Deadline for submission: August 31, 2024 (11:59 PM) Total Marks:120
CY-2004 Cyber Security Fall 2024 ASSIGNMENT No. 1
• Recommended disk size is 20GB but use at least 40GB of disk space, the select anyone fotm
the split options. Click Next to continue.
Deadline for submission: August 31, 2024 (11:59 PM) Total Marks:120
CY-2004 Cyber Security Fall 2024 ASSIGNMENT No. 1
• NOTE: To enter the cursor inside the Virtual Machine just click inside the Virtual Machine
window, if you want to release the cursor then simply use combination of ctrl + alt buttons.
• Click on the Graphical Install.
Deadline for submission: August 31, 2024 (11:59 PM) Total Marks:120
CY-2004 Cyber Security Fall 2024 ASSIGNMENT No. 1
Deadline for submission: August 31, 2024 (11:59 PM) Total Marks:120
CY-2004 Cyber Security Fall 2024 ASSIGNMENT No. 1
• Now wait for the progress, it will take some time to add additional components.
• Write Hostname or click continue to use default hostname kali.
Deadline for submission: August 31, 2024 (11:59 PM) Total Marks:120
CY-2004 Cyber Security Fall 2024 ASSIGNMENT No. 1
Deadline for submission: August 31, 2024 (11:59 PM) Total Marks:120
CY-2004 Cyber Security Fall 2024 ASSIGNMENT No. 1
Deadline for submission: August 31, 2024 (11:59 PM) Total Marks:120
CY-2004 Cyber Security Fall 2024 ASSIGNMENT No. 1
• For current scenario select Guided – use entire disk which means it will initialize the complete
disk assigned at VM creation process. Click continue.
Deadline for submission: August 31, 2024 (11:59 PM) Total Marks:120
CY-2004 Cyber Security Fall 2024 ASSIGNMENT No. 1
• Use default selected option, All files in one partition, click continue
Deadline for submission: August 31, 2024 (11:59 PM) Total Marks:120
CY-2004 Cyber Security Fall 2024 ASSIGNMENT No. 1
• Verify disk partition the select Finish partitioning & click continue.
• This will take some time to install the complete operating system.
Deadline for submission: August 31, 2024 (11:59 PM) Total Marks:120
CY-2004 Cyber Security Fall 2024 ASSIGNMENT No. 1
• Select the software details to install (Xfce, GNOME, KDE Plasma all are GUI for kali linux install
anyone of them. Xfce is the default GUI of Kali Linux) & click continue.
• It will take a long time to install so, sit back calmly and wait.
• To Install Grub select yes & click continue.
Deadline for submission: August 31, 2024 (11:59 PM) Total Marks:120
CY-2004 Cyber Security Fall 2024 ASSIGNMENT No. 1
Deadline for submission: August 31, 2024 (11:59 PM) Total Marks:120
CY-2004 Cyber Security Fall 2024 ASSIGNMENT No. 1
• Click continue to reboot the system, after reboot the Kali Linux operating system will be installed
& ready to use.
• After rebooting, kali Linux is installed. To continue provide the username and password that were
initially set at the installation step & click Login.
Deadline for submission: August 31, 2024 (11:59 PM) Total Marks:120
CY-2004 Cyber Security Fall 2024 ASSIGNMENT No. 1
• This is the desktop of Kali Linux Operating system with the following things highlighted.
1. Lock Screen Button: This icon allows you to lock your screen & other to perform
other power operations.
2. Volume & Network Status Control: This icon lets you adjust the system volume
& the status of your network connection. This bar also includes Battery & Time.
3. Resource Monitor: This allows you to monitor the CPU & Memory Usage.
4. Workspace Switcher: This allows you to switch between different virtual
workspaces.
5. Terminal Icon: This icon opens the terminal to perform command line (CLI)
operations.
6. Show Desktop: This icon allows you to jump to Desktop from any window & then
jump back to that window again.
7. Show Applications Icon: This icon opens the applications menu where you can
browse and launch installed applications.
<-------------------------------------------------------Part A------------------------------------------------------->
Deadline for submission: August 31, 2024 (11:59 PM) Total Marks:120
CY-2004 Cyber Security Fall 2024 ASSIGNMENT No. 1
Linux is a powerful, open-source operating system widely used for its stability, security, and flexibility.
It is the backbone of many servers, desktops, and embedded systems, making it an essential skill for
IT professionals. With a wide variety of distributions available, Linux caters to diverse needs, from
beginners to advanced users. In this assignment, you will explore the basics command-line usage,
and file management of Linux.
Rules:
1. Download the task files.
2. Carefully review all the commands.
3. Execute the required operations.
4. Capture screenshots and include them as evidence in your report.
5. For commands help use –-help flag after command.
• sudo command:
Short for superuser do, sudo is one of the most common Linux commands that lets you
perform tasks that require administrative or root permissions.
The command sudo su is used to switch to the root user (superuser) in a Linux system.
TASK 1: (5 marks)
• Open your terminal.
• Run the command sudo su to switch to the root user.
• Verify that you have successfully switched by checking the prompt (it should
change to #, indicating root access).
• Take a screenshot of your terminal.
Deadline for submission: August 31, 2024 (11:59 PM) Total Marks:120
CY-2004 Cyber Security Fall 2024 ASSIGNMENT No. 1
• APT command:
The apt command is used for managing software packages on Debian-based Linux
distributions, allowing you to install, update, upgrade, and remove software. It often
requires sudo to execute commands with administrative privileges for system-wide
changes.
TASK 2: (5 marks)
• Write all commands in report & provide the screenshot of terminal.
• Open your terminal.
• Update and upgrade the linux
• Install tree and wget packages
• Write tree command in terminal.
• Use wget command to download some file from internet.
• MAN command:
Displays the manual page for a specified command, providing detailed information and
options.
Syntax: man (command)
Example: man cd
• LS command:
Lists files and directories in the current directory.
Deadline for submission: August 31, 2024 (11:59 PM) Total Marks:120
CY-2004 Cyber Security Fall 2024 ASSIGNMENT No. 1
The above command created a folder in current directory. We can also use path
traversal ways like:
• PWD command:
Prints the current working directory's full path.
• CD command:
Changes the current directory to the specified path.
• TOUCH command:
Creates an empty file or updates the timestamp of an existing file.
Deadline for submission: August 31, 2024 (11:59 PM) Total Marks:120
CY-2004 Cyber Security Fall 2024 ASSIGNMENT No. 1
• CAT command:
Concatenates and displays the contents of files without opening it on editor or viewer.
▪ls: The ls command lists all the files and directories in the current directory. It
provides a quick overview of the contents, allowing you to see what is stored in
that location.
▪ echo Hello World! > i211910_MFaheem: This command prints "Hello World!" to
the terminal and redirects the output to a file named i211910_MFaheem. If the
file doesn't exist, it will be created; if it does exist, its contents will be
overwritten.
▪ cat i211910_MFaheem: The cat command reads and displays the contents of
the file i211910_MFaheem. It allows you to view the text "Hello World!" that was
previously written to the file.
• CP command:
Copies files or directories from one location to another.
Deadline for submission: August 31, 2024 (11:59 PM) Total Marks:120
CY-2004 Cyber Security Fall 2024 ASSIGNMENT No. 1
In this example, a test directory is created which was empty initially & after using mv
command the file i211910_c1.txt is moved to test directory.
Deadline for submission: August 31, 2024 (11:59 PM) Total Marks:120
CY-2004 Cyber Security Fall 2024 ASSIGNMENT No. 1
• RM command:
Removes files or directories.
• RMDIR command:
Removes empty directories.
• CHMOD command:
Changes the permissions of files or directories.
Deadline for submission: August 31, 2024 (11:59 PM) Total Marks:120
CY-2004 Cyber Security Fall 2024 ASSIGNMENT No. 1
The chmod command in Linux is used to change the permissions of files and
directories. It operates by setting read (r), write (w), and execute (x) permissions for the
owner (user), group, and others. Permissions can be set using symbolic mode (e.g.,
chmod u+x file to add execute permission for the user) or numeric mode (e.g., chmod
755 file), where each digit represents the permissions for the user, group, and others.
The first digit (user) is a sum of read (4), write (2), and execute (1); the same applies to
the group and others. For example, chmod 755 grants full permissions to the user and
read-execute permissions to the group and others. Symbolic mode allows for more
specific changes, like chmod g-w to remove write permissions for the group.
Additionally, chmod can recursively change permissions in a directory using the -R
option (e.g., chmod -R 755 directory).
• LOCATE command:
Quickly finds the location of files or directories in the filesystem.
• FIND command:
Searches for files and directories within a specified path.
1. Search for Files by Name:
Deadline for submission: August 31, 2024 (11:59 PM) Total Marks:120
CY-2004 Cyber Security Fall 2024 ASSIGNMENT No. 1
• GREP command:
Searches text using patterns and displays matching lines.
Deadline for submission: August 31, 2024 (11:59 PM) Total Marks:120
CY-2004 Cyber Security Fall 2024 ASSIGNMENT No. 1
•change the file's permissions so that only the owner can read, write, and
execute the file, but others cannot.
• Execute the i23xxxx_addition.py file to ensure it runs correctly with the
changed permissions.
• print the permissions with ls command and take ss.
• HEAD command:
Displays the first few lines of a file.
• TAIL command:
Displays the last few lines of a file.
• CLEAR command:
Clears the terminal screen.
Syntax: clear
• RESET command:
Resets the terminal to its default settings.
Syntax: reset
• WC command:
Counts the number of lines, words, and characters in a file.
For i211910_c1.txt:
▪ 11 refers to the number of lines in the file.
▪ 90 refers to the number of words in the file.
▪ 490 refers to the number of characters in the file.
Deadline for submission: August 31, 2024 (11:59 PM) Total Marks:120
CY-2004 Cyber Security Fall 2024 ASSIGNMENT No. 1
• DU command:
du is a command in Linux (short for disk usage) which helps you identify what
files/directories are consuming how much space.
• TR command:
Translate command(tr) can help you in number of ways, ranging from changing
character cases in a string to replacing characters in a string. REF. LINK
Deadline for submission: August 31, 2024 (11:59 PM) Total Marks:120
CY-2004 Cyber Security Fall 2024 ASSIGNMENT No. 1
NR: (Number Record) is the variable that keeps count of the rows after each line's
execution.
FS: (Field Separator) is the variable to set in case you want to define the field for input
stream.
Deadline for submission: August 31, 2024 (11:59 PM) Total Marks:120
CY-2004 Cyber Security Fall 2024 ASSIGNMENT No. 1
RS: (Record Separator): By default, it separate rows with '\n', you can specify something
else too.
OFS: (Output Field Separator) You must have gathered some idea by the full form, it is to
specify a delimeter while outputing.
Deadline for submission: August 31, 2024 (11:59 PM) Total Marks:120
CY-2004 Cyber Security Fall 2024 ASSIGNMENT No. 1
You can see I defined a variable argVar to use later in the 2 commands I ran with bash -c.
There are few files created in the directory with all the words defined in echo command.
You can use xargs with conjunction to find command to enhance the search
results.
Note: The find command prints results to standard output by default, so the -print
option is normally not needed, but -print0 separates the filenames with a \0 (NULL) byte
so that names containing spaces or newlines can be interpreted correctly. rm -rf
specifies the recursive forceful deletion of all the mentioned files.
You can use xargs command to grep a text from any file in any directory meeting a
specific pattern/criteria.
Deadline for submission: August 31, 2024 (11:59 PM) Total Marks:120
CY-2004 Cyber Security Fall 2024 ASSIGNMENT No. 1
You can see that I used xargs to grep a pattern matching anything starting with r with any
bunch of characters[:alnum:] and ending with 0. Which returned me this string. If you
want to practice on your own, you can find flag.txt file inside the downloaded zip
archive. Pick a string find a unique pattern for it and then grep it. Peace.
TASK 7: (20 marks)
• Write all commands in report & provide the screenshot of terminal.
• Use the provided file named xarg_task.txt
• You're working in a team and your team leader sent you a list of files that needs
to be created ASAP within current directory so that he can fake the synopsis
report (that needs to be submitted within a minute or 2) to the invigilator and
change the permissions to read-only to only you (Numberic representation).
You can find the files list in the "one" folder.
Use the following flags in ASCII order:
▪ Verbose
▪ Take argument as "files"
• Your friend trying to run multiple commands in one line, and wanting to create
a short version of rockyou.txt, messed up by creating files instead of
redirecting the output into "shortrockyou". Now he messed up his home
directory by creating a ton of files. He deleted rockyou wordlist in that one liner
and can't seem to download it and do all that long process again.
He now seeks help from you, to create the wordlist and remove those extra
files in his directory. You being a pro in linux, show him how it's done in one
liner way.
Use the following flags in ASCII order:
▪ Take argument as "word"
Deadline for submission: August 31, 2024 (11:59 PM) Total Marks:120
CY-2004 Cyber Security Fall 2024 ASSIGNMENT No. 1
▪ Verbose
▪ Max number of arguments should be 1 in for each file
You can find the files for this task in two folders.
• Which flag to use to specify the max number of arguments in one line.
• How will you escape command line flags to positional arguments?
• CURL command:
cURL(stands for crawl URL; It outputs the data of a URLs webpage in a raw format).
Another amazing command to perform activities that you can do with your browser, in
just a terminal way. You can't download cat pictures from a direct google search and
right clicking > save the image. But with a little grepping and pattern matching iframes,
that can be possible too. There are a lot of things that you can do with curl, ranging from
getting an offline copy of a webpage (grepping the sensitive information later), to
download very large files or activating web shells (for a reverse connection) just by
curling the URL.
curl is a very easy command to use once you get hold of its flags.
Let’s see an example, i started a local python file sharing server & accessed from
browser.
then i will use the curl command without any flags to just see the response.
Deadline for submission: August 31, 2024 (11:59 PM) Total Marks:120
CY-2004 Cyber Security Fall 2024 ASSIGNMENT No. 1
TASK 8: (5 marks)
• Write all commands in report & provide the screenshot of terminal.
• Which flag allows you to limit the download/upload rate of a file?
• curl -A ‘juzztesting’ https://nuces.tools/
• Can curl perform upload operations? (Yea/Nah)
• WGET command:
A command line way of downloading stuff with wget(web-get) command.
If i want to download the file from the above file server using terminal, then i will use
wget. First copy the link of file or anything you want to download.
Deadline for submission: August 31, 2024 (11:59 PM) Total Marks:120
CY-2004 Cyber Security Fall 2024 ASSIGNMENT No. 1
TASK 9: (5 marks)
• Write all commands in report & provide the screenshot of terminal.
• How will you enable time logging at every new activity that this tool initiates?
• What command will you use to download https://xyz.com/mypackage.zip
using wget, appending logs to an existing file named "package-logs.txt"
Deadline for submission: August 31, 2024 (11:59 PM) Total Marks:120
CY-2004 Cyber Security Fall 2024 ASSIGNMENT No. 1
• Write the command to read URLs from "file.txt" and limit the download speed
to 1mbps.
• XXD command:
xxd, which is well known for hexdumps or even the reverse. This command is not very
vast to explore, but still knowing this command thoroughly will help you handling hex
strings and hex digits. Whether you're playing ctfs, or bypassing JWT with automation,
xxd can do it all. This command can take input from a file or the input can be passed
through piping or redirection.
Use of -E flag (For curious minds):
Also, just so you know EBCDIC is Extended Binary Coded Decimal Interchange.
Output in binary and C include format:
Specifying a length:
Seeking an offset:
Deadline for submission: August 31, 2024 (11:59 PM) Total Marks:120
CY-2004 Cyber Security Fall 2024 ASSIGNMENT No. 1
Notice that the output seeked at the 0x10th(16th) byte and started dumping the file.
Seeking at offset from the end of the file:
Just by appending the offset's value with a hyphen the command starts dumping from
the end of the file.
TASK 10: (10 marks)
• Write all commands in report & provide the screenshot of terminal.
• Use the provided file named xxd_task.txt
• How will you seek at 10th byte (in hex) in xxd_task.txt and display only 50
bytes?
• How to display a n byte of hexdump in 3 columns with a group of 3 octets per
row from xxd_task.txt? (Use flags alphabetically)
• Which has more precedence over the other -c flag or -g flag?
• From xxd_task.txt file find the value of flag.
• TREE command:
Displays a directory structure in a tree-like format.
Deadline for submission: August 31, 2024 (11:59 PM) Total Marks:120
CY-2004 Cyber Security Fall 2024 ASSIGNMENT No. 1
• FILE command:
Determines the type of a file based on its content.
• GZIP/ZIP command:
Compresses or decompresses files and directories.
• NETSTAT command:
Displays network connections, routing tables, and interface statistics.
Deadline for submission: August 31, 2024 (11:59 PM) Total Marks:120
CY-2004 Cyber Security Fall 2024 ASSIGNMENT No. 1
• IFCONFIG/IP A command:
Displays or configures network interfaces.
Deadline for submission: August 31, 2024 (11:59 PM) Total Marks:120
CY-2004 Cyber Security Fall 2024 ASSIGNMENT No. 1
• SYSTEMCTL command:
Manages system services, controlling their status, startup, and shutdown.
This command checks and displays the current status of the Apache2 service (you can
replace apache2 with any other service name).
This command starts the Apache2 service. If it's already running, nothing will change.
Deadline for submission: August 31, 2024 (11:59 PM) Total Marks:120
CY-2004 Cyber Security Fall 2024 ASSIGNMENT No. 1
This command restarts the Apache2 service, stopping and starting it again.
This command configures the Apache2 service to start automatically when the system
boots.
This command prevents the Apache2 service from starting automatically at boot time.
Deadline for submission: August 31, 2024 (11:59 PM) Total Marks:120
CY-2004 Cyber Security Fall 2024 ASSIGNMENT No. 1
<-------------------------------------------------------Part B------------------------------------------------------->
Deadline for submission: August 31, 2024 (11:59 PM) Total Marks:120