Unit 3
Unit 3
Unit 3
4 Inception The creeper virus was The first computer worm was
considered as the first created in 1988 by Robert
known virus. It was spread Morris, marking the beginning
through ARPANET in the of worm-based threats.
early 1970s.
5 Prevalence Viruses were more prevalent Worms have become
in the early days of increasingly prevalent in
computing but have become recent years due to their
less common with improved ability to spread rapidly across
security measures interconnected networks.
Viruses and Worms
Types of Viruses
❑ Computer viruses can be categorized based on attacks on various
elements of the system
Boot Sector Viruses: Boot sector viruses infect the storage media where OS is
stored i.e. the master boot record of hard drives or the boot sector of
removable media. They activate when a system boots, gaining control before
the operating system loads, which makes them particularly dangerous and
difficult to remove.
Program Viruses: Program viruses attach themselves to executable files (.exe,
.com, etc.) and activate when the infected program is run. They can spread to
other programs when the infected file is executed, potentially infecting an
entire system over time.
Multipartite Viruses: Multipartite viruses combine the characteristics of boot
sector and program viruses, infecting both executable files and boot sectors.
This dual infection method makes them particularly virulent and challenging
to eradicate, as cleaning one area doesn't eliminate the virus entirely.
Stealth Viruses: Stealth viruses use various techniques to hide their presence
from antivirus software and system tools. They may intercept system calls that
would detect them, returning fake "clean" information or temporarily
removing themselves from infected files during scans.
Viruses and Worms
Polymorphic Viruses: Polymorphic viruses change their code structure with
each infection, making them difficult to detect with signature-based antivirus
software. They use encryption and code mutation techniques to create
functionally equivalent but structurally different variants of themselves.
Macroviruses: Macroviruses infect documents and spreadsheets that support
macros, typically spreading through email attachments. They are written in
macro languages like VBA (Visual Basic for Applications) and can affect
cross-platform applications like Microsoft Office.
ActiveX and Java Applet Viruses: These viruses exploit vulnerabilities in
ActiveX controls or Java applets to infect systems through web browsers. They
can be embedded in web pages and execute when a user visits an infected site,
potentially bypassing traditional antivirus measures due to their web-based
nature.
Trojan Horses and Backdoors
Trojan Horses
❑ A Trojan Horse, often simply called a Trojan, is a type of malicious
software that disguises itself as legitimate software to trick users into
installing it. Unlike viruses or worms, Trojans do not self-replicate.
Instead, they rely on social engineering tactics to spread i.e. via E-Mail or
in a bundle with other software downloaded from the Internet.
❑ Once installed, a Trojan can perform various malicious actions, often
providing unauthorized access to the infected system.
❑ Key characteristics:
Disguised as useful software
Does not self-replicate
Requires user action to install
Often used to create backdoors
❑ Typical Examples of Threats by Trojans:
Remote Access Trojans (RATs): Allow for file manipulation, keylogging, and
webcam/microphone access
Banking Trojans: Often use web injection techniques to manipulate banking
websites in order to steal financial information and login credentials
Backdoor Trojans: Bypass authentication and security measures in order to
create hidden access points for attackers
Mobile Trojans: Often disguised as legitimate apps
Trojan Horses and Backdoors
Backdoor
❑ A backdoor is a covert method of bypassing normal authentication or
encryption in a computer system, network, or software application. It's
essentially a secret entry point that allows someone to gain unauthorized
access to a system, often with elevated privileges.
❑ What does a Backdoor do?
Provides unauthorized access: Allows attackers to enter a system without
going through proper authentication procedures.
Maintains persistent access: Ensures that the attacker can return to the system
even if the initial entry point is discovered and closed.
Bypasses security measures: Circumvents firewalls, intrusion detection
systems, and other security controls.
Enables remote control: Allows the attacker to manipulate the system, execute
commands, or exfiltrate data from a remote location.
Conceals malicious activities: Often designed to hide its presence from system
administrators and security software.
❑ Examples of Backdoor Trojan
Back Orifice: A notorious Windows backdoor from the late 1990s. Provided
remote administration capabilities. Could be easily hidden from the user.
Bifrost: A remote access tool that can be used as a backdoor. Provides features
like file management, keystroke logging, and screen capture.
Trojan Horses and Backdoors
Netcat: A legitimate networking utility that can be misused as a backdoor.
Allows for creating network connections and executing remote shells
Tini: A tiny backdoor for Windows systems. Creates a remote shell with
system-level privileges. Extremely small in size, making it difficult to detect
Steganography
❑ Steganography is the practice of concealing information within another
piece of data, typically a digital file, in such a way that it's not easily
detectable. Unlike encryption, which makes data unreadable,
steganography hides the very existence of the secret information.
❑ How Steganography Works:
1.
Steganography
Carrier Selection: Choose a carrier file (e.g., image, audio, video) to hide the
secret data.
2. Data Embedding: Insert the secret information into the carrier file using
various techniques:
Least Significant Bit (LSB) insertion: Modifying the least significant bits
of pixel values in images.
Spread Spectrum: Spreading the secret data across the frequency
spectrum of audio files.
Discrete Cosine Transform (DCT): Altering coefficients in JPEG
compression.
3. Stego-object Creation: The result is a stego-object that appears normal but
contains hidden information.
4. Transmission: The stego-object is sent through normal communication
channels.
5. Extraction: The recipient uses a corresponding extraction algorithm to
retrieve the hidden data.
❑ While steganography has legitimate uses (e.g., watermarking, secure
communication), it can also be misused for malicious purposes like data
exfiltration or covert communication by threat actors.
Steganography
❑ Examples Tools:
Steghide: Open-source steganography software. Supports embedding data in
BMP, JPEG, WAV, and AU files. Uses strong encryption for the embedded
data.
OpenStego: Java-based steganography tool. Supports various algorithms
including LSB and random LSB. Can hide any type of file within image files.
Stegosuite: Java-based steganography tool. Supports BMP, GIF, JPEG, and
PNG formats. Offers password protection for hidden data.
Steganalysis
❑ Steganalysis is the study and practice of detecting and extracting hidden
information from files or communications that have been concealed using
steganography techniques. It's essentially the counterpart to
steganography, aimed at uncovering covert messages and data.
❑ Purpose of Steganalysis:
Identify whether a file or communication contains hidden information.
Recover the concealed data if present.
Render the hidden information unreadable or destroyed.
Determine the nature and size of the hidden data.
DoS and DDoS Attacks
Denial of Service (DoS) Attacks
❑ A DoS attack is a malicious attempt to disrupt the normal functioning of a
targeted system, service, or network by overwhelming it with a flood of
traffic or exploiting vulnerabilities that cause the system to crash or
become unresponsive.
❑ Symptoms of a DoS Attack:
1. Unusually slow network performance
2. Unavailability of a particular website or service
3. Inability to access any website
4. Dramatic increase in the number of spam emails received
5. Disconnection of a wireless or wired internet connection
❑ What DoS Attacks Can Do:
1. Render websites or services completely inaccessible to legitimate users
2. Cause intermittent or degraded service availability
3. Consume all available network bandwidth
4. Deplete system resources like CPU, memory, or disk space
5. Incur costs for mitigation and recovery efforts
6. Erode customer trust and satisfaction
DoS and DDoS Attacks
❑ Types of Denial of Service (DoS) attacks:
1. Flood Attack: Flood attacks overwhelm a target system or network by sending
a massive volume of traffic, exhausting resources like bandwidth, CPU, or
memory. Common types include ICMP floods, UDP floods, and HTTP floods,
all aiming to make the target unavailable to legitimate users.
2. Ping of Death Attack: The Ping of Death attack involves sending oversized or
malformed ping packets to a target system. These packets, when reassembled,
exceed the maximum allowable size, potentially causing buffer overflows and
system crashes in vulnerable systems.
3. SYN Attack: SYN attacks exploit the TCP three-way handshake by sending
numerous SYN requests but never completing the handshake. This leaves
half-open connections on the server, exhausting its resources and preventing
legitimate connections.
4. Teardrop Attack: Teardrop attacks send fragmented packets with overlapping
offset fields to the target. When the system tries to reassemble these
malformed packets, it can crash or freeze, especially in older operating
systems with vulnerabilities in their TCP/IP fragmentation reassembly code.
5. Smurf Attack: A Smurf attack involves sending ICMP echo requests (pings) to
a network broadcast address, spoofing the source IP as the victim's. All devices
on the network respond to the victim, amplifying the attack and overwhelming
the target with responses.
DoS and DDoS Attacks
DoS Attacks
❑ Tools used to launch DoS attack :
1. Jolt2: Jolt2 is a tool designed to exploit fragmentation handling vulnerabilities
in older TCP/IP stacks. It sends a stream of fragmented IP packets to the
target, potentially causing system crashes or freezes in vulnerable systems.
2. Nemesy: Nemesy is a network packet crafting and injection tool that can be
used to generate various types of malformed packets. It allows for the creation
of custom packets with specific attributes, making it useful for testing network
stacks and potentially launching DoS attacks.
3. Targa: Targa is a suite of network stress testing tools capable of generating
multiple types of DoS attacks. It includes modules for various attack vectors
like Ping of Death, Teardrop, and Land attacks, making it a versatile tool for
testing network resilience.
4. Crazy Pinger: Crazy Pinger is a simple but effective tool designed to flood a
target with ICMP echo requests (pings). It can rapidly generate a large volume
of ping packets, potentially overwhelming the target's ability to process and
respond to these requests.
DoS and DDoS Attacks
DDoS Attacks
❑ DDoS attacks are a more sophisticated form of DoS attacks where
multiple compromised systems (often a botnet) are used to target a single
system, service, or network. This distributed approach amplifies the
attack's power, making it more difficult to mitigate than a single-source
DoS attack.
❑ DDoS attacks can overwhelm targets with traffic, exhaust resources, or
exploit vulnerabilities at a massive scale.
❑ Tools used to launch DDoS attack :
Trinoo: Trinoo is one of the earliest DDoS tools, using UDP flood attacks
coordinated across multiple systems. It consists of masters and daemons, with
the masters controlling the daemons to launch synchronized attacks on
targets.
Tribe Flood Network (TFN): TFN is a more advanced tool than Trinoo,
capable of launching various types of attacks including SYN floods, UDP
floods, and ICMP floods. It uses a similar master-daemon architecture but
with encrypted communications between nodes.
Stacheldraht: Stacheldraht combines features of Trinoo and TFN, adding
encrypted communication between attackers and masters. It can perform
multiple types of floods and includes automatic update capabilities for the
attack network.
DoS and DDoS Attacks
Shaft: Shaft is similar to Trinoo but with enhanced features like encrypted
communications and the ability to switch master servers during an attack. It's
known for its ability to generate high-volume UDP and ICMP flood attacks.
MStream: MStream is designed specifically for launching massive TCP SYN
flood attacks. It uses a master-slave architecture and can spoof source IP
addresses, making the attack harder to trace and mitigate.
SQL Injection
❑ SQL Injection (SQLi) is a type of cyber attack where an attacker exploits
vulnerabilities in an application's software by inserting or "injecting"
malicious SQL code into a query. This allows the attacker to interfere
with the queries that an application makes to its database. If successful,
an SQL injection attack can lead to unauthorized access to database
contents, including sensitive data, or even control over the database
server.
❑ Thus it’s a vulnerability that consists of an attacker interfering with the
SQL queries that an application makes to a database
SQL Injection
❑ In an SQL Injection attack, the attacker takes advantage of user input
fields (such as login forms, search boxes, or any web form) that are not
properly sanitized or validated. By injecting specially crafted SQL
commands into these input fields, the attacker can manipulate the SQL
query executed by the database, potentially gaining unauthorized access
to data, modifying or deleting data, or even executing administrative
operations on the database.
Impact of SQL Injection Attacks
❑ Unauthorized access to sensitive data
Confidentiality – SQLi can be used to view sensitive information, such as
application usernames and passwords
Integrity – SQLi can be used to alter data in the database
Availability – SQLi can be used to delete data in the database
❑ Remote code execution on the operating system
SQL Injection
Steps for an SQL Injection Attack
❑ The attacker first identifies input fields in a web application where user
input is directly included in SQL queries. These could be login forms,
search boxes, feedback forms, etc.
❑ Once a vulnerable input field is identified, the attacker crafts malicious
SQL code designed to alter the intended SQL query. For example, instead
of entering a legitimate username, the attacker might enter something
like:
' OR '1'='1'; --
This code might trick the database into executing a query that always
returns true, potentially bypassing authentication
❑ The attacker enters the malicious SQL code into the vulnerable input
field. If the application is not properly sanitizing the input, this code will
be executed by the database.
❑ The attacker analyzes the response from the server to determine if the
attack was successful. If the injection worked, the attacker might see
unauthorized data, gain access to the database, or receive confirmation
that the query was manipulated.
SQL Injection
Example of an SQL Injection Attack
❑ Suppose a web application has a login form where users enter their
username and password. The application might use the following SQL
query to check if the user exists in the database:
SELECT * FROM users WHERE username = 'user' AND password = 'pass';
❑ An attacker could input the following into the username field:
' OR '1'='1
❑ This would result in the following SQL query:
SELECT * FROM users WHERE username = '' OR '1'='1' AND password = ‘’;
Types of SQL Injection
❑ T
S
SQL Injection
❑ In-Band SQL Injection: In-band SQLi occurs when the attacker uses the
same communication channel to both launch the attack and gather the
result of the attack
Retrieved data is presented directly in the application web page
❑ Easier to exploit than other categories of SQLi
❑ Error-based SQLi is an in-band SQLi technique that forces the database
to generate an error, giving the attacker information upon which to refine
their injection.
❑ Example:
Input:
Output:
Output:
Payload #1 (False):
Backend Query:
Payload #2 (True):
Backend Query:
Payload:
Backend Query:
SQL Injection
Payload:
Backend Query: