Cse Unit-4
Cse Unit-4
Many malicious code types can harm your computer by finding entry points that
lead to your precious data. Among the ever-growing list, here are some common
culprits.
Viruses
Worms
Worms are also self-replicating and self-spreading code like viruses but do not
require any further action to do so. Once a computer worm has arrived on your
device, these malicious threats can execute entirely on their own — without any
assistance from a user-run program.
1
Trojans
Trojans are decoy files that carry malicious code payloads, requiring a user to use
the file or program to execute. These threats cannot self-replicate or spread
autonomously. However, their malicious payload could contain viruses, worms, or
any other code.
Cross-site scripting interferes with the user’s web browsing by injecting malicious
commands into the web applications they may use. This often changes web
content, intercepts confidential information, or serves an infection to the user’s
device itself.
Backdoor attacks
Cybercriminals can then move laterally through their newly obtained access level,
wipe out a computer's data, or even install spyware. These threats can reach a high
level: The U.S. Government Accountability Office has even warned about the
threat of malicious code against national security.
Malicious code can come in many forms and has been very active in the past.
Among the instances of these attacks, here are a few of the most well-known:
Emotet trojan
First appearing in 2014, the Emotet trojan evolved from its malware roots to
become email spam laden with malicious code. The attackers use phishing tactics
like urgent email subject lines (ex: "Payment Needed") to fool users into
downloads.
2
Once on a device, Emotet has been known to run scripts that deliver viruses, install
command and control (C&C) malware for botnet recruitment, and more. This
threat took a short break in 2018 before returning to become an SMS malware
threat in the process.
Stuxnet worm
Since 2010, the Stuxnet computer worm and its successors have been targeting
national infrastructure. Its first documented attack involved Iranian nuclear
facilities via USB flash drive, destroying critical equipment. Stuxnet has since
ceased, but its source code has been used to create similar highly targeted attacks
through 2018.
For most malicious threats, antivirus software with automatic updates, malware
removal capabilities, web-browsing security is the best defense. However,
preventing malicious code may not be possible with antivirus software on its own.
Antivirus typically prevents and removes viruses and other forms of malware — or
malicious software — is a subcategory of malicious code. The broader category of
malicious code includes website scripts that can exploit vulnerabilities to upload
malware. By definition, not all antivirus protection can treat certain infections or
actions caused by malicious code.
While antivirus is still essential for proactive infection removal and defense, here
are some valuable ways to protect yourself:
3
• Be wary of using any public data connection. USB connections are
generally overlooked but can easily harbor malicious code. Public Wi-Fi is
also a common threat that attackers can use to deliver malicious code.
• Use a properly configured firewall to block unauthorized connections. If
malicious code infiltrates your machine and connects outward to request
malware payloads, a firewall can help stop this. Be sure that your firewall is
configured to block by default and whitelist any expected and trusted
connections.
Privilege Escalation:
2. Obfuscation:
4
• Code obfuscation: Altering code to make it difficult for anyone reading the
code to understand its purpose. This is common in malware to prevent
reverse engineering.
• Encryption and tunneling: Masking data being transferred to avoid
detection by security systems (e.g., encrypting traffic or using
steganography).
• Obfuscating IP addresses or using tools like VPNs and proxies to hide the
attacker’s real location.
Defense Strategies:
5
Applications in Cybersecurity (Both Attacks and Defense)
• Evading Detection:
o VM obfuscation is commonly used by attackers to evade detection
during malware analysis. Security analysts may attempt to examine
suspicious code in a sandboxed environment, but if the malware
detects that it is being run in a virtual machine, it may not activate or
will only perform harmless actions, allowing the malware to slip past
the detection.
• Hiding Malware Behavior:
o Malicious actors may use VM obfuscation to keep the true nature of
their payload hidden from detection tools, which makes it harder for
security systems to analyze and understand the full scope of the
attack.
• Advanced Persistent Threats (APT):
o Advanced cybercriminal groups may leverage this technique to
maintain a foothold in a network while remaining undetected for long
periods, as their malware can be designed to blend into virtualized
environments, which are common in enterprise systems.
While attackers use VM obfuscation to hide their activities, defenders can also
leverage virtual machines to isolate threats and prevent them from spreading to real
systems. Some defensive applications include:
• Sandboxing:
o Security professionals use virtual machines to isolate and analyze
potentially harmful programs or suspicious files. By running these in a
VM, analysts can observe the behavior of malware without risking the
security of the actual operating system.
• VM Detection and Anti-VM Techniques:
o Defensive systems can also attempt to detect the use of VM
obfuscation by examining behaviors like anomalous CPU usage, file
access patterns, or system configurations that might indicate the
presence of a VM.
6
o Some anti-virus programs may specifically look for signs of VM-
aware malware and block or flag suspicious activities that occur in
VM environments.
7
• Self-Healing Security Mechanisms – Automatically restore security
configurations and files.
• Memory Integrity & Kernel Protection – Prevent unauthorized code
execution at the OS level.
• Behavioral Anomaly Detection – Persistent monitoring of system behavior
for anomalies.
• Threat Hunting & Cyber Deception – Deploy honeypots and deception
techniques to lure attackers.
• Zero Trust Architecture – Persistent verification of users, devices, and
network activities.
Rootkits
Types of Rootkits
8
3. Bootkit – Infects the bootloader, allowing it to execute before the operating
system loads.
4. Firmware Rootkits – Reside in firmware (such as BIOS or UEFI), making
them persistent even after reinstallation of the OS.
5. Hypervisor Rootkits – Run below the OS by taking control of the system’s
hypervisor, allowing them to manipulate the OS.
6. Memory Rootkits – Reside in system RAM and do not leave traces on the
hard drive, making them harder to detect.
Rootkits are hard to detect because they hide deep within the system. However,
detection methods include:
Spyware in Cybersecurity
9
Types of Spyware
10
Attacks Against Privileged User Accounts & Privilege Escalation
Privileged user accounts have higher access rights than regular accounts,
allowing them to manage critical systems, change security settings, and access
sensitive data. Cybercriminals target these accounts to gain unauthorized control
over a system.
Phishing – Deceiving users into revealing credentials via fake emails or websites.
Keylogging – Capturing keystrokes to steal usernames and passwords.
Credential Dumping – Extracting stored credentials from memory using tools
like Mimikatz.
Brute Force & Password Spraying – Repeatedly guessing passwords until
access is granted.
C. Insider Threats
11
D. Malware & Ransomware
Once attackers gain access to a system, they attempt to increase their privileges to
take full control.
12
A security token in Windows represents a user's authentication and privileges.
When a user logs in, the system assigns a token that determines what resources and
actions the user can access. Tokens are crucial for maintaining security and access
control.
Types of Tokens:
• Primary Token – Assigned when a user logs in and used for authentication.
• Impersonation Token – Allows a process to act on behalf of another user
temporarily.
Attack Steps:
4. Real-World Example
13
Virtual Machine (VM) Detection in Cybersecurity
A. Malware Perspective
14
B. Software & System Artifacts
• Registry Keys & Files – Virtual machines store identifiable files and
registry entries (e.g., HKLM\SOFTWARE\VMware, Inc.).
• Running Processes & Services – VM-related processes like
VBoxService.exe or vmtoolsd.exe indicate virtualization.
• Filesystem & Drivers – Searching for drivers like vboxguest.sys or
vm3dmp.sys reveals VM presence.
D. Interaction-Based Detection
15
compromised by hackers capitalizing on poor password management or
unsecure networks.
• Bad actors that gain access to companies’ systems can lurk inside networks,
pretending to be a legitimate user for days, weeks, or years.
• By remaining undetected, they can gain additional access rights to
increasingly sensitive corporate datasets and pose a growing threat to
unaware businesses.
Exploitation Techniques in Cybersecurity
1. Form Grabbing
Definition:
How It Works:
Examples:
• Zeus Trojan (targets banking credentials).
• SpyEye (steals login details and personal data).
Prevention Measures:
• Use antivirus and anti-malware software.
• Enable multi-factor authentication (MFA).
• Use password managers to autofill credentials securely.
16
• Monitor network traffic for suspicious activities.
2. Man-in-the-Middle (MitM) Attacks
Definition:
How It Works:
• The attacker positions themselves between the victim and a legitimate server
or user.
• They can eavesdrop, modify, or steal sensitive data.
• Often used over insecure Wi-Fi networks or via compromised routers.
3. DLL Injection
Definition:
How It Works:
Common Uses:
Examples:
Prevention Measures:
• Enable DLL verification to prevent unauthorized DLL loading.
• Monitor system processes for unusual behavior.
• Use endpoint protection to detect DLL injection attempts.
• Implement application whitelisting to allow only trusted DLLs.
Assignment Questions
1. Compare and contrast worms and viruses in terms of propagation, impact, and
real-world examples. How have these evolved over time?
2. What are rootkits, and how do they alter the system to hide their presence?
Tutorial Questions
18
2 Define obfuscation in the context of malware.
6 True/False: BHOs are only used by legitimate software like toolbars and cannot
be malicious.
7 What is virtual machine detection, and why would malware avoid execution in
VMs?
19