CyberSecurity LabManual Final
CyberSecurity LabManual Final
CyberSecurity LabManual Final
PRACTICAL-1
1
CyberSecurity
▪ X Windows system
A. Linux Distributions
A Linux distribution is an assemblage of software with its own packaging schemes, defaults
and configuration methods. The following is a list of some of the major Linux distributions
● Fedora Linux : The Fedora Project welcomes OEM distributors, but providers must
adhere to the same trademark guidelines as other vendors. Specifically, you may not
modify the Fedora installation and maintain the Fedora name. The nearest you may do is
completely rebrand the distribution to comply with the trademark guidelines, make your
modifications, and distribute the product under a different name. You may also not then
say that your product "contains Fedora" or is an alternate "edition" of Fedora. You may
say that your product is "a derivative of Fedora" or is "built upon Fedora", but you must
make it clear that your product is NOT Fedora. If you use the Fedora name in such a
manner, you must also note that Fedora is a registered trademark, and not attempt to
confuse users or allude to a non-existent relationship between you and the Fedora Project
or Red Hat.
● Corel Linux: This is a new Linux distribution that has made an impressive entrance.
The installation process is simple and does a great job of detecting and automatically
configuring many sound and video card adapters. It also comes together with Corel’s
WordPerfect word processing package which has been ported to run on Linux.
● Debian GNU/Linux: This distribution is one of the oldest and recognized favorites
among advanced technical groups. It is relatively difficult to install due to the very high
number of installation options.
● OpenLinux (Caldera): The OpenLinux distribution has shrink-wrapped software
packages that include the first graphical Linux installation. This distribution allows the
user to play a game in the foreground while the computer loads software in the
background during installation.
● Red Hat: Red Hat is the first company to mass market the Linux operating system.
They have validated Linux by packing the GNU/Linux tools in shrink wrapped packages
and have included valued-added features to their product such as: telephone support,
training, and consulting services.
2
CyberSecurity
● Slackware: Of all of the surviving Linux distributions, Slackware has been around the
longest. The installation interface had remained the same since its beginning, until a
couple of years ago.
● SuSE: This distribution derives from Germany. SuSE works closely with the XFree86
project (the free X graphical server component of all Linux distributions). As a result,
they have a terrific graphical configuration tool called SaX.
● TurboLinux: This distribution provides a great graphical desktop environment along
with a few tools for configuring the system. TurboLinux has lead the way in the turnkey
installations by providing CD installations exclusive to Server, Workstation, and
Clusters.
B. Configuring Your System
After the installation process of the files is complete, the next step is configuring the system.
These
steps involved:
1. Selecting a language
2. Choosing automatic or manual partitioning
3. Type of software to install
4. Choosing which drive to boot from
5. Adjusting the time settings
6. Configuring the hardware aspect of the system
7. Creating the root password (for the Administrator), as well as the user name and
password for users
8. Hardware configuration
C. Linux Applications
Once the user is familiar with navigating the KDE GUI, it is time to explore the numerous
applications Linux has to offer. Unlike Windows operating system, Linux distributions such
as SuSE already come with all the programs and applications needed. Programs for the SuSE
Linux include:
▪ OpenOffice: word processing, spreadsheets, drawing
▪ Adobe Acrobat Reader
▪ Konqueror: The KDE File Manager and Web Browser
3
CyberSecurity
It is useful to note that the Linux operating system allows the user to continue to use old
files that were created in different operating systems. Standard program in Linux such as
StarOffice and the GIMP can handle most file formats that the user has previously utilized;
whether it is for word processing documents, pictures, or video data. SuSe Linux allows the
user to work with old files without difficulty.
D. Files, Folders, and Directories
To use the shell efficiently, it is useful to have some knowledge about the file and directory
structures of Linux. Directories can be thought as electronic folders where files, programs, and
subdirectories are stored.The place where the entire directory tree begins is called the root
directory. The root directory is identified by a slash (‘ / ’). Root is one of the several users on
the Linux system, which as mentioned before, is a multiuser system. The root is responsible for
the entire Linux system, making sure it runs reliably.
The Linux file system is then subdivided into many branches known as subdirectories. Table
provides a short description of these standard directories.
Table Overview of Important Directories
Directory Description
/ Root directory, starting point of the directory tree
/home (private) directories of users
/dev Device files that represent hardware components
/etc Important files for system configuration
/etc/init.d Boot scripts
/usr/bin Generally accessible programs
/bin Program needed early in the boot process
4
CyberSecurity
Linux Command:
ls
The ls command - the list command - functions in the Linux terminal to show all of the major
directories filed under a given file system. For example, the command:
ls /applications : It will show the user all of the folders stored in the overall applications
folder.The ls command is used for viewing files, folders and directories.
1. cd
The cd command - change directory - will allow the user to change between file directories. As
the name command name suggest, you would use the cd command to circulate between two
different directories. For example, if you wanted to change from the home directory to the Arora
directory, you would input the following command:
cd/arora/applications : As you might have noted, the path name listed lists in reverse order.
Logically cd/arora/applications reads change to the arora directory which is stored in the
applications directory. All Linux commands follow a logical path.
5
CyberSecurity
2. mv
The mv command - move - allows a user to move a file to another folder or directory. Just like
dragging a file located on a PC desktop to a folder stored within the "Documents" folder, the mv
command functions in the same manner. An example of the mv command is:
The first part of the command mv/arora/applications/majorapps lists the application to be
moved. In this case, arora. The second part of the command /arora/applications/minorapps lists
where arora will be moved to - from majorapps to minorapps.
3. man
The man command - the manual command - is used to show the manual of the inputted
command. Just like a film on the nature of film, the man command is the meta command of the
Linux CLI. Inputting the man command will show you all information about the command you
are using. An example:
man cd
The inputting command will show the manual or all relevant information for the change directory
command.
4. rmdir
The mkdir - make directory - command allows the user to make a new directory. Just like making
a new directory within a PC or Mac desktop environment, the mkdir command makes new
directories in a Linux environment. An example of the mkdir command
mkdir testdirectory
The example command made the directory "testdirectory".
5. rm
The rm command - remove - like the rmdir command is meant to remove files from your Linux
OS. Whereas the rmdir command will remove directories and files held within, the rm command
will delete created files. An example of the rm command:
rm testfile.txt
The aforementioned command removed testfile.txt. Interestingly, whereas the rmdir command
will only delete an empty directory, the rm command will remove both files and directories with
files in it. This said, the rm command carries more weight than the rmdir command and should be
used with more specificity.
6
CyberSecurity
EXERCISES:
EVALUATION:
7
CyberSecurity
PRACTICAL-2
AIM: Study of different types of vulnerabilities for hacking a websites / Web Application
Learning Objectives
After going through this session, you should be able to:
Attack Goal %
Stealing Sensitive Information 42%
Defacement 23%
Planning Malware 15%
Unknown 08%
Deceit 03%
Blackmail 03%
Link Spam 03%
Worm 01%
Phishing 01%
Information Warfare 01%
OS Commanding 03 %
Security Misconfiguration 03 %
8
CyberSecurity
This all are the Vulnerability types and how much it’s usage. The SQL Injection and Cross Site
Scripting are the most famous vulnerabilities in web application. Generally web servers, application
servers, and web application environment are affected to following types of vulnerabilities. The
OWASP (Open Web Application Security Project) listed all security vulnerability at .There are two
types of attacks which are frequently used by hackers namely SQL Injection attack and XSS (Cross Site
Scripting) Attack. The following are the brief explanation of each type of attack.
● Stored XSS
● Reflected XSS
● Dom based XSS
Stored XSS also known as persistent XSS .This occurs when hacker stored malicious script
9
CyberSecurity
permanently in target server like database, visitor log, and comment field or in URL. Reflected XSS
occur when hacker insert inject script into some input field.
Security Misconfiguration
Good security requires having a secure configuration defined and deployed for the application,
frameworks, application server, web server, database server and platform. In these types of attack
hacker accesses default accounts, unused pages, un-patched flaws, unprotected files and dictionaries
to gain unauthorized access or for the knowledge of the system.
10
CyberSecurity
Hacker links to redirect and forced victim to click. Since the link is to a valid site. Attacker targets
unsafe forward to bypass authentication.
EXERCISES:
1. List and discuss the different types of attack used by hackers.
2. What do you mean by Cross Site Scripting (XSS).
3. What is Encryption? Why is it important?
4. What do you understand by Risk, Vulnerability & Threat in a network?
EVALUATION:
11
CyberSecurity
PRACTICAL-3
It is a question of creating, at gateway level, a translation of packets coming from the internal
network to the external network.
So, each machine on the network needing to access the Internet is configured to use the NAT
gateway (by specifying the IP address of the gateway in the "Gateway" field with its TCP/IP
parameters). When a network machine makes a request to the Internet, the gateway makes the
request in its place, receives the response, then sends it to the machine which made the request.
Since the gateway completely conceals the internal addresses on the network, the network
address translation mechanism provides a secure function. In fact, to an external observer of the
network, all requests seem to come from the gateway IP address.
12
CyberSecurity
Address space
The organization managing public address space (routable IP addresses) is the Internet Assigned
Number Authority (IANA). RFC 1918 defines a private address space enabling any organization
to allocate IP addresses to machines on its internal network without risk of entering into conflict
with a public IP address allocated by IANA. These addresses known as non-routable relate to the
following address ranges:
All the machines on an internal network, connected to the internet via a router and not having a
public IP address must use an address within one of these ranges. For small domestic networks,
the address range from 192.168.0.1 to 192.168.0.255 is generally used.
Static translation
The principle of static NAT consists of linking a public IP address to a private internal IP
address on the network. The router (or more precisely the gateway) thus allows a private IP
address (for example 192.168.0.1) to be linked to a public routable IP address on the Internet and
conducts the translation, in either direction, by changing the address in the IP packet.
Static network address translation therefore enables internal network machines to be connected
to the Internet in a transparent way but does not resolve the problem of the lack of addresses
insofar as n routable IP addresses are necessary to connect n machines to the internal network.
Dynamic translation
Dynamic NAT enables a routable IP address (or a reduced number of routable IP addresses) to
be shared between several machines with private addresses. So seen from outside, all the
machines on the internal network virtually possess the same IP address. This is the reason why
the term "IP masquerading" is sometimes used to indicate dynamic network address translation.
In order to be able to "multiplex" (share) the different IP addresses on one or several routable IP
addresses, dynamic NAT uses Port Address Translation (PAT), i.e. the allocation of a different
source port for each request in such a way as to be able to maintain a correspondence between
the requests coming from the internal network and the responses of the machines on the Internet,
all addressed to the router's IP address.
13
CyberSecurity
EXERCISES:
EVALUATION:
14
CyberSecurity
PRACTICAL-4
Cybercrime is defined as a crime in which a computer is the object of the crime (hacking,
phishing, spamming) or is used as a tool to commit an offense (child pornography, hate crimes).
cybercriminals may use computer technology to access personal information, business trade
secrets or use the internet for exploitative or malicious purposes. Criminals can also use
computers for communication and document or data storage. Criminals who perform these
illegal activities are often referred to as hackers.Cybercrime may also be referred to as computer
crime.
Common types of cybercrime include online bank information theft, identity theft, online
predatory crimes and unauthorized computer access. More serious crimes like cyberterrorism are
also of significant concern.Cybercrime encompasses a wide range of activities, but these can
generally be broken into two categories:
● Crimes that target computer networks or devices. These types of crimes include viruses
and denial-of-service (DoS) attacks.
● Crimes that use computer networks to advance other criminal activities. These types of
crimes include cyberstalking, phishing and fraud or identity theft.
The FBI identifies cybercrime fugitives who have allegedly committed bank fraud and trafficked
counterfeit devices that access personal electronic information. The FBI also provides
information on how to report cybercrimes, as well as useful intelligence information about the
latest cybercriminals.
DDoS Attacks
These are used to make an online service unavailable and take the network down by
overwhelming the site with traffic from a variety of sources. Large networks of infected devices
known as Botnets are created by depositing malware on users’ computers. The hacker then hacks
into the system once the network is down.
Botnets
Botnets are networks from compromised computers that are controlled externally by remote
hackers. The remote hackers then send spam or attack other computers through these botnets.
Botnets can also be used to act as malware and perform malicious tasks.
Identity Theft
15
CyberSecurity
This cybercrime occurs when a criminal gains access to a user’s personal information to steal
funds, access confidential information, or participate in tax or health insurance fraud. They can
also open a phone/internet account in your name, use your name to plan a criminal activity and
claim government benefits in your name. They may do this by finding out user’s passwords
through hacking, retrieving personal information from social media, or sending phishing emails.
Cyberstalking
This kind of cybercrime involves online harassment where the user is subjected to a plethora of
online messages and emails. Typically cyberstalkers use social media, websites and search
engines to intimidate a user and instill fear. Usually, the cyberstalker knows their victim and
makes the person feel afraid or concerned for their safety.
Social Engineering
Social engineering involves criminals making direct contact with you usually by phone or email.
They want to gain your confidence and usually pose as a customer service agent so you’ll give
the necessary information needed. This is typically a password, the company you work for, or
bank information. Cybercriminals will find out what they can about you on the internet and then
attempt to add you as a friend on social accounts. Once they gain access to an account, they can
sell your information or secure accounts in your name.
PUPs
PUPS or Potentially Unwanted Programs are less threatening than other cybercrimes, but are a
type of malware. They uninstall necessary software in your system including search engines and
pre-downloaded apps. They can include spyware or adware, so it’s a good idea to install an
antivirus software to avoid the malicious download.
Phishing
This type of attack involves hackers sending malicious email attachments or URLs to users to
gain access to their accounts or computer. Cybercriminals are becoming more established and
many of these emails are not flagged as spam. Users are tricked into emails claiming they need to
change their password or update their billing information, giving criminals access.
Prohibited/Illegal Content
This cybercrime involves criminals sharing and distributing inappropriate content that can be
considered highly distressing and offensive. Offensive content can include, but is not limited to,
sexual activity between adults, videos with intense violent and videos of criminal activity. Illegal
content includes materials advocating terrorism-related acts and child exploitation material. This
type of content exists both on the everyday internet and on the dark web, an anonymous network.
Online Scams
16
CyberSecurity
These are usually in the form of ads or spam emails that include promises of rewards or offers of
unrealistic amounts of money. Online scams include enticing offers that are “too good to be true”
and when clicked on can cause malware to interfere and compromise information.
Exploit Kits
Exploit kits need a vulnerability (bug in the code of a software) in order to gain control of a
user’s computer. They are readymade tools criminals can buy online and use against anyone with
a computer. The exploit kits are upgraded regularly similar to normal software and are available
on dark web hacking forums.
EXERCISES:
1. What is cybercrime? Explain types of cybercrime.
2. Discuss the impact of cybercrime on society.
3. List some common cyber attacks.
4. What are black hat, white hat, grey hat hackers?
EVALUATION:
17
CyberSecurity
PRACTICAL-5
SQL Injection (SQLi) is a type of an injection attack that makes it possible to execute malicious
SQL statements. These statements control a database server behind a web application. Attackers
can use SQL Injection vulnerabilities to bypass application security measures. They can go
around authentication and authorization of a web page or web application and retrieve the
content of the entire SQL database. They can also use SQL Injection to add, modify, and delete
records in the database.
An SQL Injection vulnerability may affect any website or web application that uses an SQL
database such as MySQL, Oracle, SQL Server, or others. Criminals may use it to gain
unauthorized access to your sensitive data: customer information, personal data, trade secrets,
intellectual property, and more. SQL Injection attacks are one of the oldest, most prevalent, and
most dangerous web application vulnerabilities
● Attackers can use SQL Injections to find the credentials of other users in the database.
They can then impersonate these users. The impersonated user may be a database
administrator with all database privileges.
● SQL lets you select and output data from the database. An SQL Injection vulnerability
could allow the attacker to gain complete access to all data in a database server.
● SQL also lets you alter data in a database and add new data. For example, in a financial
application, an attacker could use SQL Injection to alter balances, void transactions, or
transfer money to their account.
● You can use SQL to delete records from a database, even drop tables. Even if the
administrator makes database backups, deletion of data could affect application
availability until the database is restored. Also, backups may not cover the most recent
data.
18
CyberSecurity
● In some database servers, you can access the operating system using the database server.
This may be intentional or accidental. In such case, an attacker could use an SQL
Injection as the initial vector and then attack the internal network behind a firewall.
There are several types of SQL Injection attacks: in-band SQLi (using database errors or UNION
commands), blind SQLi, and out-of-band SQLi.
The following example shows,how an attacker can use an SQL Injection vulnerability to go
around application security and authenticate as an administrator.
The following script is pseudocode executed on a web server. It is a simple example of
authenticating with a username and a password. The example database has a table named users
with the following columns: username and password.
# Define POST variables
uname = request.POST['username']
passwd = request.POST['password']
19
CyberSecurity
EXERCISES:
EVALUATION:
20
CyberSecurity
PRACTICAL-6
A VPN (Virtual Private Network) is a service that lets you access the web safely and privately by
routing your connection through a server and hiding your online actions.
a VPN is a method used to connect to the internet privately. It does this by hiding your real IP
address and routing all of your internet traffic and data through a private, securely encrypted
tunnel over public networks.VPNs are popular because they let you browse the internet without
giving your personal identity, location, or data away. When all of your data is encrypted inside
the VPN tunnel, ISPs, search engines, marketers, hackers, and others can't see or track your
activities on the web.
1. By disguising your real IP address and location. After connecting to a VPN service,
you're sent onto the internet from a new gateway server. This spoofs your IP address and
makes it appear as if you're in a different city or country than the one you're actually in.
2. By encapsulating all of your internet traffic through a private VPN tunnel. Data on
the internet moves in packets. With a VPN, all of your data packets are encapsulated
inside additional data packets. This encapsulation effectively creates a private tunnel
inside public networks.
3. By scrambling your private data with encryption. When using a VPN service, all of
your internet traffic and personal information inside the tunnel is scrambled via
encryption. This makes a VPN connection virtually impossible to hack by outside forces.
21
CyberSecurity
22
CyberSecurity
EXERCISES:
1. What is VPN?
2. Discuss when to use VPN.
3. What is port blocking within LAN?
4. What is the difference between VPN and VLAN?
EVALUATION:
23
CyberSecurity
PRACTICAL-7
While nearly all DDoS attacks involve overwhelming a target device or network with traffic,
attacks can be divided into three categories. An attacker may make use one or multiple different
attack vectors, or cycle attack vectors potentially based on counter measures taken by the target.
24
CyberSecurity
HTTP Flood
This attack is similar to pressing refresh in a web browser over and over on many different
computers at once – large numbers of HTTP requests flood the server, resulting in denial-of-
service.
This type of attack ranges from simple to complex. Simpler implementations may access one
URL with the same range of attacking IP addresses, referrers and user agents. Complex versions
may use a large number of attacking IP addresses, and target random urls using random referrers
and user agents.
Protocol Attacks
25
CyberSecurity
SYN Flood
A SYN Flood is analogous to a worker in a supply room receiving requests from the front of the
store. The worker receives a request, goes and gets the package, and waits for confirmation
before bringing the package out front. The worker then gets many more package requests
without confirmation until they can’t carry any more packages, become overwhelmed, and
requests start going unanswered.
This attack exploits the TCP handshake by sending a target a large number of TCP “Initial
Connection Request” SYN packets with spoofed source IP addresses. The target machine
responds to each connection request and then waits for the final step in the handshake, which
never occurs, exhausting the target’s resources in the process.
Volumetric Attacks
Amplification Example:
26
CyberSecurity
DNS Amplification
A DNS Amplification is like if someone were to call a restaurant and say “I’ll have one of
everything, please call me back and tell me my whole order,” where the callback phone number
they give is the target’s number. With very little effort, a long response is generated.
By making a request to an open DNS server with a spoofed IP address (the real IP address of the
target), the target IP address then receives a response from the server. The attacker structures the
request such that the DNS server responds to the target with a large amount of data. As a result,
the target receives an amplification of the attacker’s initial query.
What is the process for mitigating a DDoS attack?
The key concern in mitigating a DDoS attack is differentiating between attack and normal traffic.
For example, if a product release has a company’s website swamped with eager customers,
cutting off all traffic is a mistake. If that company suddenly has a surge in traffic from known
bad actors, efforts to alleviate an attack are probably necessary. The difficulty lies it telling apart
the real customer and the attack traffic.
In the modern Internet, DDoS traffic comes in many forms. The traffic can vary in design from
un-spoofed single source attacks to complex and adaptive multi-vector attacks. A multi-vector
DDoS attack uses multiple attack pathways in order to overwhelm a target in different ways,
potentially distracting mitigation efforts on any one trajectory. An attack that targets multiple
layers of the protocol stack at the same time, such as a DNS amplification (targeting layers 3/4)
coupled with an HTTP flood (targeting layer 7) is an example of multi-vector DDoS.
27
CyberSecurity
EXERCISES:
EVALUATION:
28