Chap 3 (Cyber Security)
Chap 3 (Cyber Security)
Malware, short for "malicious software," is any software designed to harm, disrupt, or
gain unauthorized access to computer systems, networks, or devices. Here's a
breakdown:
● Purpose:
● Replication: Viruses need a host program or file to replicate. They insert their
malicious code into other files.
●
● Activation: They often require user interaction (like opening an infected file) to
activate.
Important Notes:
Performance Issues:
Unexpected Behavior:
Important Considerations:
● It's important to note that some of these signs can also be caused by other
issues, such as hardware problems or software glitches.
● If you suspect a malware infection, it's crucial to take immediate action to prevent
further damage.
By being aware of these indicators, you can take steps to protect your devices and data
from malware attacks.
● Reliable Software:
○ Invest in reputable antivirus and anti-malware software.
○ Ensure it provides real-time scanning, detection, and removal capabilities.
○
● Regular Updates:
○ Keep your antivirus software updated with the latest virus definitions. This
ensures it can recognize and combat new threats.
○
○ Set up automatic updates.
○
● Scheduled Scans:
○ Perform regular full system scans to detect and remove any hidden
malware.
○
● Verify Sender:
○ Only open email attachments from trusted senders.
● Scan Attachments:
○ Scan all email attachments with your antivirus software before opening
them.
○
● Avoid Unexpected Attachments:
○ Be very wary of any unexpected email attachments, even if they appear to
come from someone you know.
○
5. Use a Firewall:
● Enable Firewall:
○ Enable your operating system's built-in firewall or use a dedicated firewall
application.
○
● Configure Firewall:
○ Configure your firewall to block unauthorized access to your computer.
○
● Regular Backups:
○ Back up your important files regularly to an external hard drive, cloud
storage, or other secure location.
● Offline Backups:
○ Keep backups offline, or off of the network, so that if ransomware does
infect your computer, your backups will also not be infected.
○
● Complex Passwords:
○ Use strong, unique passwords for all your online accounts.
○
● Password Manager:
○ Consider using a password manager to generate and store your
passwords securely.
○
9. Educate Yourself:
● Stay Informed:
○ Stay up-to-date on the latest malware threats and security best practices.
● Educate Others:
○ If you are responsible for other users, educate them on safe computer
practices.
By following these guidelines, you can significantly reduce your risk of falling victim to
virus attacks.
How it Works:
● Vulnerable Applications:
○ Applications sometimes need to execute OS commands to perform certain
tasks.
○ If an application doesn't properly sanitize user-supplied input before
passing it to the OS, an attacker can inject malicious commands.
○
● Exploitation:
○ Attackers insert OS commands into input fields, such as form fields, URLs,
or HTTP headers.
○
○ The vulnerable application then executes these injected commands, giving
the attacker control over the server.
○
● Consequences:
○ Attackers can gain unauthorized access to sensitive data.
○
○ They can modify or delete files.
○
○ They can even take complete control of the server.
○
Key Points:
Prevention:
● Input Validation:
○ Sanitize all user-supplied input to remove or escape potentially dangerous
characters.
○
○ Use whitelists to restrict input to only allowed characters or values.
○
● Avoid System Calls:
○ Whenever possible, avoid calling OS commands directly from the
application.
○ Use built-in functions or libraries that provide safer alternatives.
○
● Principle of Least Privilege:
○ Run applications with the minimum necessary privileges to limit the
potential damage of a successful attack.
○
● Secure Coding Practices:
○ Stay up-to-date on secure coding practices and regularly audit code for
vulnerabilities.
○
In essence, command injection is a serious security risk that can have devastating
consequences. By understanding how it works and implementing proper security
measures, developers can protect their applications and servers from this type of attack.
How it Works:
● Vulnerable Websites:
○ XSS vulnerabilities arise when a web application doesn't properly sanitize
user-supplied input. This means that if a website allows users to input data
(e.g., in comments, search bars, or forms) and then displays that data to
other users without checking it, an attacker can insert malicious code.
○
● Malicious Scripts:
○ Attackers typically inject JavaScript code, but they can also use other
client-side scripting languages.
○
● Attacking the User:
○ When a victim visits the compromised web page, their browser executes
the attacker's script. Because the script appears to come from the trusted
website, the browser treats it as legitimate.
○
Types of XSS:
Potential Consequences:
● Session Hijacking:
○ Attackers can steal session cookies, allowing them to impersonate users.
○
● Data Theft:
○ They can steal sensitive information, such as login credentials or personal
data.
○
● Website Defacement:
○ They can modify the content of the website.
○
● Malware Distribution:
○ They can redirect users to malicious websites or install malware on their
computers.
○
Prevention:
XSS is a serious threat, and developers must take appropriate measures to protect their
web applications.
7.WHAT IS FIREWALL?
A firewall is a network security system that monitors and controls incoming and outgoing
network traffic based on predetermined security rules. Essentially, it acts as a barrier
between a trusted internal network and an untrusted external network, such as the
internet.
● Traffic Filtering:
○ Firewalls examine network traffic (data packets) and decide whether to
allow or block it based on predefined rules. These rules can be based on
factors like:
■ Source and destination IP addresses
■
■ Port numbers
■
■ Protocols (e.g., TCP, UDP)
■
○
○
● Access Control:
○ Firewalls control which devices and applications can access the network
and which network resources they can use.
○
● Protection Against Threats:
○ Firewalls help protect against various cyber threats, including:
■ Unauthorized access
■
■ Malware
■
■ Network attacks
■
○
○
● Network Address Translation (NAT):
○ Many firewalls also perform NAT, which hides the internal IP addresses of
devices on a private network, providing an additional layer of security.
○
Types of Firewalls:
● Hardware Firewalls:
○ These are physical devices that are installed between a network and the
internet.
○
● Software Firewalls:
○ These are software applications that are installed on individual computers
or servers.
○
● Cloud Firewalls:
○ These are firewalls that are provided as a cloud based service.
○
● Next-Generation Firewalls (NGFWs):
○ These advanced firewalls offer more sophisticated features, such as
application-level filtering, intrusion prevention, and deep packet inspection.
○
In essence, firewalls are a crucial component of network security, providing a first line of
defense against unauthorized access and malicious activity.
Understanding Buffers:
● A buffer overflow happens when a program tries to write more data into a buffer
than its allocated size.
●
● This can occur due to programming errors, such as:
○ Not checking the size of input data before writing it to a buffer.
○
○ Using functions that don't perform bounds checking (i.e., they don't ensure
data stays within the buffer's limits).
○
● Attackers can craft input data that intentionally overflows a buffer, allowing them
to overwrite critical parts of the program's memory.
●
● By carefully manipulating the overflow, attackers can inject their own code and
force the program to execute it.
●
● This allows attackers to perform various malicious actions, such as:
○ Gaining unauthorized access to systems.
○
○ Stealing sensitive data.
○
○ Installing malware.
○
Prevention:
● Input Validation: Thoroughly check the size and format of input data before
writing it to a buffer.
●
● Bounds Checking: Use programming techniques and functions that ensure data
stays within the bounds of the buffer.
●
● Memory-Safe Languages: Use programming languages that have built-in
memory safety features.
● Address Space Layout Randomization (ASLR): This security technique
randomizes the memory addresses used by a program, making it harder for
attackers to predict where to inject malicious code.
●
● Data Execution Prevention (DEP): This security feature prevents the execution
of code in certain memory regions, making it harder for attackers to execute
injected code.
●
Buffer overflows are a classic but still relevant security vulnerability. Developers must
take precautions to prevent them.