Computer Security (Chapter-2)
Computer Security (Chapter-2)
Computer Threat
Chapter objectives
Up on completion of this chapter you should be able to: –
Understand what are malicious programs & how they affect the system.
phishing emails that trick you into clicking on link or opening an attachment, etc.
3
Malicious Code
Way to recognize if our system affected by malware are:
System suddenly slows down or crashes.
personal amusement
5
Malicious Code (Virus Phases)
Computer viruses typically go through several phases as they infect and spread through
computer systems.
6
Malicious Code (Virus Phases)…
1) Dormant phase
In this phase, the virus is inactive and does not cause any harm.
2. Propagation phase
The virus begins to places an identical copy of itself (replicate) into other programs
7
Malicious Code (Virus Phases)…
3. Triggering phase
This is the point the virus is activated & begins its intended malicious activities.
4. Execution phase
This is the actual work of the virus, where the payload will be released.
It can be destructive such as deleting files, crashing the system, or corrupting files.
8
Malicious Code (Types of Virus)
Boot Sector Virus
It infects the boot sector of floppy disks or the Master Boot Record (MBR) of hard disks.
The Boot sector comprises all the files which are required to start the OS.
It either overwrites the existing program or copies itself to another part of the disk.
The Brain virus is a classic example, discovered in 1986 and targeted IBM PC.
Macro Virus
Polymorphic Virus
To prevent detection, it constantly change the versions of itself while retaining the same
program after each infection. Use mutation engine to encrypt & decrypt its code.
Multipartite Virus
It can attack both the boot sector and the executable files.
Well-known example is Invader virus, which was discovered in the late 1990s.
Anti-malware software:
Firewalls:
Patch Management:
The 3 classes of attack that are commonly found in today's network environment:
1. Access attacks
2. Reconnaissance attacks
These attacks are often aimed at stealing data, obtaining user credentials, or
elevating privileges within the system.
◦ Also known as port forwarding attack that occur when an attacker gains
unauthorized access to a network's router/firewall and sets up port forwarding
rules to redirect traffic from specific external ports to internal devices.
c) Man-in-the-Middle Attacks
◦ This attack happens when a hacker eavesdrops or listens for network traffic and intercepts a
data transmission.
◦ The hacker can also take over the communication and reformat the packets to send..
The attack involves sending a series of ICMP echo requests (ping) to a range of IP addresses to
determine which hosts are reachable and responsive. Use Nmap, Zenmap tool.
3. Port Scans
It is method used by attackers to identify open ports & services on a target system or network.
Program can be used by company to audit a network as well as by a hacker for malicious intent.
E.g., users might be denied access to email as the result of a successful DoS attack.
A current example of a DoS attack is a teardrop, which can cause a system to crash by
running the CPU up to 100%.
In this attack, the attacker sends a large number of SYN packets to the target server,
but does not respond to the SYN-ACK packets sent by the server.
This causes
the server to keep the half-open connections open and
wait for the final ACK packet from the client,
tying up resources and preventing legitimate clients from establishing connections.
They are mostly unintentional errors in which the program's design or implementation
These flaws can include things like logic errors, race conditions, and memory leaks..
If the application does not properly validate the size of the input, it could lead to a buffer
overflow vulnerability.
Cause: due to improper memory management within the application (no input size check).
Effect: It can lead to corruption of adjacent memory, & application crash / execute arbitrary
code.
Security Implications: attackers can gain unauthorized access to the system, execute
arbitrary codes, modify data, or even take control of the entire system.
Mitigation:
Use functions like strncpy() instead of unsafe functions like strcpy() for input validation.
Compiler & code analysis tools that detect the vulnerabilities during development phase.
Use exception handling mechanism.
1/30/2024 Compiled by: Naol G. (MSc.) 31
Program flaws /Incomplete mediation errors
Incomplete mediation is error that occurs when the application accepts incorrect
◦ Email: iang#cs.uwaterloo.ca
The web application needs to ensure that what the user has entered constitutes a
meaningful request.
Instead, user edits URL directly, changing price and total cost as below:
o Make sure client has not modified the data in any way.
During the time between the check and the use, the condition or resource may have changed,
leading to unexpected behavior.
Effect:
The TOCTOU errors can lead to security issues like privilege escalation, and data integrity issues.
However, between the check and the operation, the file can be deleted or modified by another
process, leading to unintended consequences. file that serves as a reference to another file or directory.
The attacker makes a symbolic link: logfile -> file she owns
Between the “check” and the “open”, she changes it: logfile -> /etc/passwd
Security Implications:
An attacker might exploit a TOCTOU vulnerability to gain elevated privileges, bypass access
controls, or manipulate sensitive data.
Additionally, proper access controls, input validation, and secure coding practices can help
◦ Administrative controls
Secure Coding Standards and Guidelines: cover secure coding practices, input validation, output
Threat Modeling: identify potential security threats & vulnerabilities in the software design.
Security Testing: static code analysis helps identify security vulnerabilities in the code.
Secure Development Tools: tools &libraries that are free from known vulnerabilities. And etc.
1/30/2024 Compiled by: Naol G. (MSc.) 39
Controls against program flaws in execution
Operating system controls:
◦ OS controls play a crucial role in protecting against program flaws in execution.
◦ These controls are designed to safeguard the OS and the programs running on it.
◦ Some key operating system controls against program flaws include:
randomizes the memory addresses used by the program, making it more difficult for
Secure Boot Enforcement: ensures that OS only boots from trusted & verified bootloaders.
Least privilege principle: granting users only the minimum level of access & permissions
required to perform their duties can limit the impact of program flaws in execution.
Security awareness and training: awareness and training programs to employees can
help raise awareness of program execution risks. And etc.
Database security measures are essential for safeguarding sensitive information from
unauthorized access, data breaches, and other security threats.
A given database is secured when database reliability and integrity, secrecy, inference
control, and multi-level databases is ensured.
Data validation: ensure that only valid and accurate data is entered into the
database, preventing data integrity issues.
Access Control: ensure that only authorized users have access to sensitive data,
In a given company, employees can access to their own salary, but not of their
colleagues.
However, employee with access to sales performance data and commission structures
may be able to infer their colleagues salaries by analyzing the correlation between sales
performance and compensation, breaching the confidentiality of salary information.
1/30/2024 Compiled by: Naol G. (MSc.) 46
Database security...
Multi-Level Databases:
Is refers to a database system that is designed to handle data with different levels of
sensitivity.
In such a database, information is categorized into different security levels and access to
the data is controlled based on the authorization level of the user.
Data classification & labeling: Clearly classify and label data based on its sensitivity
level.
This helps users understand the security implications of the data they are accessing
and reinforces the need to adhere to access controls.