Unit_II_Lectures
Unit_II_Lectures
Adarsh Kumar
Professor, Systems, School of Computer Science, UPES, Dehradun,
Uttarakhand, India
[email protected]
1 Worms
Introduction
Worm’ Characteristics
Worm Propagation Process
Prevention and Protection Against Worms
Detection and Prevention Algorithms
Signature-Based Prevention Algorithm
Behavioral Prevention Algorithm
Network-Based Prevention
Patch Management
Access Control
Network Segmentation
Least Privilege Principle
Network Disruption
Worms can cause severe network slowdowns and outages by generating excessive traffic as they spread.
Some worms carry payloads that steal sensitive information, delete files, or encrypt data, leading to data breaches and
loss.
Economic Impact
Businesses can suffer financial losses due to downtime, data recovery costs, and damage to reputation caused by worm
infections.
System Instability
Worms can consume system resources, leading to crashes and reduced performance of infected computers.
Formation of Botnets
Some worms turn infected computers into bots (zombies) that can be controlled remotely by cybercriminals for further
malicious activities, such as sending spam or launching distributed denial-of-service (DDoS) attacks.
Self-replicating
Worms have the ability to make copies of themselves without any human interaction. This allows them to spread rapidly across
networks.
Standalone
Unlike viruses, worms do not need a host program to attach themselves to. They can operate and propagate independently.
Network Spreading
Worms are designed to exploit network vulnerabilities to spread to other connected systems. They often use the infected
computer’s network resources to find new targets.
Payload Delivery
Some worms carry a malicious payload (additional malware), such as ransomware, keyloggers, or backdoors, which can perform
harmful activities on the infected system.
Resource Consumption
Worms can consume a significant amount of network bandwidth and system resources as they spread, leading to network
slowdowns and system instability.
Email Attachments
Worms can spread via email by tricking users into opening malicious attachments or clicking on harmful links.
Network Exploits
Worms often exploit vulnerabilities in network services or software. For example, they may exploit open ports, unpatched
operating systems, or vulnerabilities in network protocols to spread.
File Sharing
Worms can spread through shared network drives, USB drives, or peer-to-peer file-sharing networks.
Internet Downloads
Malicious websites or compromised legitimate websites can host worm malware, which infects systems when users visit or
download content.
Conficker (2008)
Exploited Windows vulnerabilities, creating a botnet that affected millions
of computers worldwide. It had the capability to disable security features
and download additional malware.
2. Compromise Targets
Exploit vulnerability
Trick users to run malicious code (e.g., Spam)
F i n d N e w Ta r g e t s
C o m p r o m i s e Ta r g e t s IP r a n d o m s c anning
Network Disruption
Worms can cause severe network slowdowns and outages by generating excessive traffic as they spread.
Economic Impact
Businesses can suffer financial losses due to downtime, data recovery costs, and damage to reputation caused by worm infections.
System Instability
Worms can consume system resources, leading to crashes and reduced performance of infected computers.
Formation of Botnets
Some worms turn infected computers into bots (zombies) that can be controlled remotely by cybercriminals for further malicious
activities, such as sending spam or launching distributed denial-of-service (DDoS) attacks.
Firewalls
Use network and host-based firewalls to block unauthorized access and monitor suspicious network activity.
User Education
Educate users about the dangers of opening email attachments or clicking on links from unknown or untrusted sources.
Network Segmentation
Isolate critical systems and data from the rest of the network to minimize the spread of worms in case of an infection.
Example Scenario: Let’s consider a simple example where D is a byte stream, and each
signature s i is a sequence of bytes.
Signature Database Example:
s 1 = 0x90, 0x90, 0x90 (NOP sled)
s 2 = 0xDE, 0xAD, 0xBE, 0xEF (Example signature)
Example Scenario: Let’s consider a simple example where D is a byte stream, and each
signature s i is a sequence of bytes.
Signature Database Example:
s 1 = 0x90, 0x90, 0x90 (NOP sled)
s 2 = 0xDE, 0xAD, 0xBE, 0xEF (Example signature)
Data to Scan:
D = 0x00, 0x00, 0x90, 0x90, 0x90, 0xAB, 0xCD
Example Scenario: Let’s consider a simple example where D is a byte stream, and each
signature s i is a sequence of bytes.
Signature Database Example:
s 1 = 0x90, 0x90, 0x90 (NOP sled)
s 2 = 0xDE, 0xAD, 0xBE, 0xEF (Example signature)
Data to Scan:
D = 0x00, 0x00, 0x90, 0x90, 0x90, 0xAB, 0xCD
Matching Process:
For s 1 : Scan D for the byte sequence 0x90, 0x90, 0x90.
For s 2 : Scan D for the byte sequence 0xDE, 0xAD, 0xBE, 0xEF.
Example Scenario: Let’s consider a simple example where D is a byte stream, and each
signature s i is a sequence of bytes.
Signature Database Example:
s 1 = 0x90, 0x90, 0x90 (NOP sled)
s 2 = 0xDE, 0xAD, 0xBE, 0xEF (Example signature)
Data to Scan:
D = 0x00, 0x00, 0x90, 0x90, 0x90, 0xAB, 0xCD
Matching Process:
For s 1 : Scan D for the byte sequence 0x90, 0x90, 0x90.
For s 2 : Scan D for the byte sequence 0xDE, 0xAD, 0xBE, 0xEF.
Result:
s 1 is found at position 2 in D , so a match is detected, and appropriate action is taken.
s 2 is not found in D , so no action is taken for s 2 .
Example Scenario: Let’s consider a simple example where D is a byte stream, and each
signature s i is a sequence of bytes.
Signature Database Example:
s 1 = 0x90, 0x90, 0x90 (NOP sled)
s 2 = 0xDE, 0xAD, 0xBE, 0xEF (Example signature)
Data to Scan:
D = 0x00, 0x00, 0x90, 0x90, 0x90, 0xAB, 0xCD
Matching Process:
For s 1 : Scan D for the byte sequence 0x90, 0x90, 0x90.
For s 2 : Scan D for the byte sequence 0xDE, 0xAD, 0xBE, 0xEF.
Result:
s 1 is found at position 2 in D , so a match is detected, and appropriate action is taken.
s 2 is not found in D , so no action is taken for s 2 .
Note: A NOP sled is a sequence of ”No Operation” (NOP) instructions placed in the memory
area where an attacker intends to execute malicious code. Its purpose is to create a large,
contiguous region of memory that does nothing (i.e., it executes no operations), allowing the
attacker to direct the execution flow to any part of this region and still eventually reach the
malicious payload.
Limitations
Signature-Based Detection Limitations
This approach only detects known threats. It cannot identify new, unknown
threats that do not have corresponding signatures.
The efficiency of the matching process can vary based on the size of the
database and the complexity of the signatures.
Mathematical Extensions
Probabilistic Models
Some systems use probabilistic models or machine learning to improve detection
accuracy and reduce false positives.
Hash-Based Matching
Using hash functions to represent signatures and hashes of data can speed up the
matching process.
where D M ( X t ) is the Mahalanobis distance, µ is the mean vector of normal behavior, and
Σ − 1 is the inverse of the covariance matrix.
Thresholding: Compare the Mahalanobis distance with a predefined threshold θ. If
D M ( X t ) > θ, the behavior is considered anomalous.
Adarsh Kumar Adarsh[dot]Kumar[at]ddn[dot]upes[dot]ac[dot]in January 17, 2025 18 / 93
Behavioral Prevention Algorithm (Step 3):Response
Mechanism
Alert Generation:
If the behavior is detected as anomalous, generate an alert or log the
event.
Preventive Actions:
Based on the severity of the detected anomaly, take preventive
actions such as blocking the process, isolating the system, or
terminating the suspicious activity.
Let:
N : Total number of nodes (hosts) in the network.
t: Time variable (continuous time).
S(t): Number of susceptible nodes at time t.
I(t): Number of infected nodes at time t.
R(t): Number of removed (recovered) nodes at time t.
λ: Infection rate (worm spread rate from infected to susceptible nodes).
δ: Recovery rate (rate at which infected nodes are removed).
dS(t)
= −λS(t)I(t) (1)
dt
dI(t)
= λ S (t)I(t) − δI(t) (2)
dt
dR(t)
= δI(t) (3)
dt
Initial conditions:
S(0) = 990
I(0) = 10
R(0) = 0
∆ R = γ ·I(0)
∆ R = 0.1 ·10 = 1
Adarsh Kumar Adarsh[dot]Kumar[at]ddn[dot]upes[dot]ac[dot]in January 17, 2025 27 / 93
Updated Values at Time Step 1
Automated Patch Manage- High Reduces manual effort, ensures Requires setup and mainte- Large organizations
ment Tools consistency, fast deployment nance; potential deployment of needing consistent
faulty patches patch deployment
Centralized Patch Manage- High Better control, reduced band- Potential single point of failure, Organizations with
ment width usage, efficient manage- complex setup many devices in multi-
ment ple locations
Regular Patch Testing and Medium Reduces patch-related issues, Slower deployment, requires ad- Environments where up-
Validation ensures compatibility and stabil- ditional resources time and stability are
ity critical
Patch Prioritization and Variable Focuses on critical vulnerabili- Less critical patches might be Security-sensitive envi-
Risk Assessment ties, optimized resource use delayed, potential exposure ronments
Patch Management Policy Medium Establishes clear procedures, en- Requires audits and adherence, All organizations, partic-
and Compliance hances accountability, ensures challenging to enforce ularly regulated indus-
regular updates tries
Vulnerability Scanning and High Early detection of vulnerabilities, False positives/negatives, un- Dynamic and evolving
Patch Monitoring ensures patch compliance necessary work or missed threats IT environments
Third-Party Patch Manage- High Comprehensive security cover- Complexity in managing patches Organizations using a
ment age, reduces attack surface for various software vendors wide range of third-
party software
Emergency Patch Deploy- High (criti- Quick response to critical vulner- Potential disruption, high ur- High exposure to zero-
ment Protocol cal) abilities, reduces exposure win- gency requires readiness day vulnerabilities
dow
Cloud-Based Patch Man- High Scalability, remote management, Dependence on internet connec- Remote or geographi-
agement Solutions reduced on-prem infrastructure tivity, potential latency issues cally dispersed infras-
tructure
End-User Awareness and Low (di- Enhances security culture, re- Relies on user participation, in- Any organization aiming
Training rectly) duces risk of delayed updates direct impact on patch perfor- for holistic security
mance
S = 990 − 20 = 970, I = 10 + 20 = 30
S = 970 − 50 = 920, R = 0 + 50 = 50
S = 920 − 60 = 860, I = 30 + 60 = 90
S = 0, I = 810 + 40 = 850
S = 0, R = 200
Scenario
An organization with 1,000 computers is at risk of infection from a newly
discovered worm exploiting a zero-day vulnerability in a commonly used
software application.
Scenario
An organization with 1,000 computers is at risk of infection from a newly
discovered worm exploiting a zero-day vulnerability in a commonly used
software application.
Scenario
An organization with 1,000 computers is at risk of infection from a newly
discovered worm exploiting a zero-day vulnerability in a commonly used
software application.
Impact
After 1 hour: 200 computers patched, 800 computers still vulnerable.
After 2 hours: 400 computers patched, 600 computers still vulnerable.
After 3 hours: 600 computers patched, 400 computers still vulnerable.
After 5 hours: All 1,000 computers patched, no computers vulnerable.
Scenario
A multinational organization with 5,000 devices distributed across five locations worldwide faces
a threat from a worm exploiting a known vulnerability in its email client.
Scenario
A multinational organization with 5,000 devices distributed across five locations worldwide faces
a threat from a worm exploiting a known vulnerability in its email client.
Scenario
A multinational organization with 5,000 devices distributed across five locations worldwide faces
a threat from a worm exploiting a known vulnerability in its email client.
Calculation
Total Devices Patched per Hour:
Scenario
A multinational organization with 5,000 devices distributed across five locations worldwide faces
a threat from a worm exploiting a known vulnerability in its email client.
Calculation
Total Devices Patched per Hour:
Outcome
Using centralized patch management, all devices across the organization are patched within 2
hours, minimizing the risk of a worm infection.
Scenario
A healthcare organization with 2,000 devices has a critical vulnerability affecting its patient
management software. The organization decides to prioritize patching high-risk devices first.
Scenario
A healthcare organization with 2,000 devices has a critical vulnerability affecting its patient
management software. The organization decides to prioritize patching high-risk devices first.
Scenario
A healthcare organization with 2,000 devices has a critical vulnerability affecting its patient
management software. The organization decides to prioritize patching high-risk devices first.
Scenario
A healthcare organization with 2,000 devices has a critical vulnerability affecting its patient
management software. The organization decides to prioritize patching high-risk devices first.
Outcome
By prioritizing patch deployment based on risk, the healthcare organization reduces the risk of a
worm infection impacting critical systems within 24 hours while fully securing all devices within
3 days.
Adarsh Kumar Adarsh[dot]Kumar[at]ddn[dot]upes[dot]ac[dot]in January 17, 2025 51 / 93
Example 4: Emergency Patch Deployment Protocol
Scenario
A financial institution with 10,000 endpoints detects a worm exploiting a
zero-day vulnerability. An emergency patch deployment is initiated.
Outcome
The emergency patch deployment protocol patches all endpoints within 10
hours, drastically reducing the potential impact of the worm.
Adarsh Kumar Adarsh[dot]Kumar[at]ddn[dot]upes[dot]ac[dot]in January 17, 2025 52 / 93
Example 5: Cloud-Based Patch Management Solutions
Scenario
A tech company with a distributed workforce (remote) has 3,000 devices connected via the
cloud. A critical security patch is required for a newly identified worm threat.
Scenario
A tech company with a distributed workforce (remote) has 3,000 devices connected via the
cloud. A critical security patch is required for a newly identified worm threat.
Scenario
A tech company with a distributed workforce (remote) has 3,000 devices connected via the
cloud. A critical security patch is required for a newly identified worm threat.
Calculation
After 1 hour: 500 devices patched, 2,500 vulnerable.
After 3 hours: 1,500 devices patched, 1,500 vulnerable.
After 6 hours: 3,000 devices patched, 0 vulnerable.
Scenario
A tech company with a distributed workforce (remote) has 3,000 devices connected via the
cloud. A critical security patch is required for a newly identified worm threat.
Calculation
After 1 hour: 500 devices patched, 2,500 vulnerable.
After 3 hours: 1,500 devices patched, 1,500 vulnerable.
After 6 hours: 3,000 devices patched, 0 vulnerable.
Outcome
The cloud-based patch management system ensures that all remote devices are patched within 6
hours, providing effective and quick mitigation against the worm threat.
Scenario
Initial Vulnerability: 2,000 workstations are potentially vulnerable to worm infections due to
outdated third-party applications. Patch Deployment Rate: ManageEngine Patch Manager
Plus can patch 200 workstations per hour. Patching Schedule: Patches are applied overnight to
minimize disruption.
Scenario
Initial Vulnerability: 2,000 workstations are potentially vulnerable to worm infections due to
outdated third-party applications. Patch Deployment Rate: ManageEngine Patch Manager
Plus can patch 200 workstations per hour. Patching Schedule: Patches are applied overnight to
minimize disruption.
Calculation
After 1 hour: 200 workstations patched, 1,800 vulnerable.
After 5 hours: 1,000 workstations patched, 1,000 vulnerable.
After 10 hours: 2,000 workstations patched, 0 vulnerable.
Scenario
Initial Vulnerability: 2,000 workstations are potentially vulnerable to worm infections due to
outdated third-party applications. Patch Deployment Rate: ManageEngine Patch Manager
Plus can patch 200 workstations per hour. Patching Schedule: Patches are applied overnight to
minimize disruption.
Calculation
After 1 hour: 200 workstations patched, 1,800 vulnerable.
After 5 hours: 1,000 workstations patched, 1,000 vulnerable.
After 10 hours: 2,000 workstations patched, 0 vulnerable.
Outcome
By using ManageEngine Patch Manager Plus, the company can ensure that all third-party
applications across its 2,000 workstations are patched within 10 hours, reducing the risk of worm
infections exploiting known vulnerabilities.
Algorithm Steps
Input: List of vulnerabilities V = {v 1 , v2, . . . , v n }, Patch database
P = {p 1 , p2, . . . , p m }.
Output: Successfully patched systems.
1 Initialization: Set S = ∅, where S is the set of patched systems.
2 For each vulnerability v i in V :
Find corresponding patch p j in P such that p j addresses vi.
If p j is not already applied:
Apply p j to affected systems.
Add affected systems to S.
3
End For
4 Verification: Check that all systems in S have been patched
correctly.
Best Practices:
Regularly scan systems for vulnerabilities.
Test patches in a non-production environment before deployment.
Automate the patching process where possible to ensure consistency.
Keep a backup before applying critical patches.
Educate users about the importance of security updates.
Advantages:
Patch management is a critical component of cybersecurity.
A well-defined patch management process helps in mitigating the
risks posed by worms and other malware.
Regular updates and adherence to best practices ensure the security
and reliability of systems.
Ensures Accountability
Access control mechanisms often include logging and monitoring features that track user
activities, helping to quickly identify and isolate compromised accounts.
Algorithm Steps
Input: User request R, Access Control Policy P , User attributes U ,
Resource attributes Res.
Output: Access granted or denied.
1 Step 1: Validate the user identity U and resource Res.
2 Step 2: Check the access control policy P for user role R and
corresponding permissions.
3 Step 3: Evaluate conditions based on attributes (ABAC model):
Step-by-Step Execution
1 Validate User and Resource: Alice and critical server 01 are valid.
2 Check Access Control Policy:
Alice’s Role: System Administrator (Matches)
Resource Type: Critical Server (Matches)
Department: IT (Matches)
3 Evaluate Conditions:
Example Scenario
User Request: Alice requests access to the financial report R .
Access Control Policy: Policy P requires that only users with the role ”Manager” can access financial reports.
User Attributes: Alice’s role U . r o l e = ”Manager”.
Resource Attributes: The resource type R e s . t y p e = ”Financial Report”.
Output: Access granted.
Since Alice’s role is ”Manager” and the resource type is ”Financial Report”, the condition is true.
4 Step 4: Log Alice’s access request and the outcome (Access granted).
5 Step 5: No alert is necessary as access is granted.
Algorithm Steps
Input: User request R , ABAC Policy P a b a c , User attributes U , Resource attributes R e s .
Output: Access granted or denied.
1 Step 1: Extract attributes: {U.role, U.department, U.security level, . . . } and {Re s. t yp e , Res.sensitivity level, . . .}.
2 Step 2: Match user attributes against policy:
4
Step 4: Log access request and decision.
5
Step 5: If denied, notify security monitoring system.
Step-by-Step Execution
1 Extract Attributes:
4 Log Outcome: ”Access request by Bob for confidential file.txt was granted.”
5 Notify if Denied: Not required, access was granted.
Example Scenario
User Request: Bob requests access to a classified project file R .
ABAC Policy: Policy P a b a c requires that the user must be in the ”Research” department and have a security level of 5
or higher to access classified project files.
User Attributes:
U.role = ”Researcher”
U.department = ”Research”
U.security level = 5
Resource Attributes:
Re s. t yp e = ”Classified Project File”
Res.sensitivity level = 4
Output: Access granted.
Example Scenario
3 Step 3: Evaluate any additional conditions defined in P a b a c :
4 Step 4: Log Bob’s access request and the decision (Access granted).
5 Step 5: Since access is granted, no notification to the security monitoring system is needed.
Algorithm Steps
Input: User role U.role, RBAC Policy Prbac.
Output: Access granted or denied.
1 Step 1: Identify user’s role U.role.
2 Step 2: Retrieve permissions associated with U.role from Prbac.
3 Step 3: Check if the requested action is within the permissions:
Example Scenario
User Role: John is assigned the role of ”Network Administrator” U.role = ”Network Admin”.
RBAC Policy: The RBAC Policy P r b a c specifies that the ”Network Admin” role has permissions to ”Monitor Traffic”
and ”Configure Routers.”
Output: Access granted or denied based on John’s role and the requested action.
2 Step 2: Retrieve permissions associated with the ”Network Admin” role from P r b a c .
Permissions retrieved: ”Monitor Traffic,” ”Configure Routers.”
3 Step 3: Check if the requested action is within the permissions:
Algorithm Steps
Input: User U , Resource R e s , DAC Policy P d a c .
Output: Access granted or denied.
Example Scenario
User: Alice requests access to a proprietary design document R e s .
Resource Owner: The document is owned by Bob Res.owner = ”Bob”.
DAC Policy: The policy P d a c specifies that access is granted if the user is the owner or an admin.
Output: Access granted or denied.
Overview
Network segmentation involves dividing a network into smaller, isolated segments to limit the spread of worms and other
malicious activities. This approach enhances security by controlling traffic flow and reducing the attack surface.
Algorithm Steps
Input: Network topology N , Segmentation policy S , Traffic rules T , Security requirements R .
Output: Segmented network with defined security zones.
Overview
1 Step 4: Apply security controls R within each segment.
Implement security measures such as firewalls, intrusion detection systems, and access controls tailored to each
segment’s requirements.
Monitor(N, S , T , R )
Example Scenario
A company implements network segmentation to prevent the spread of a
worm infection. The network is divided into four segments:
Development
Marketing
Finance
HR
The aim is to contain any worm infection within a single segment and
prevent it from spreading to others.
Implementation Steps
Input: Network topology N , Segmentation policy S , Traffic rules T , Security controls C .
Output: Secured and isolated network segments.
Implementation Steps
1 Step 2: Define access rules T between segments.
Control which segments can communicate with each other.
(
Allowed if Segmenti and Segmentj are permitted to communicate
T ij =
Denied otherwise
Example:
TDev, Mkt = Allowed, TDev, Fin = Denied
C = {Firewall for Dev, IDS for Mkt, Access Controls for HR}
Monitor(N, T , C )
Numerical Example
Consider a network with the following topology and segmentation policy:
Network Topology N :
N = { A , B, C, D, E}
Segmentation Policy S :
Traffic Rules T :
(
Allowed if Segmenti and Segmentj are permitted to communicate
T ij =
Denied otherwise
For example:
T 1 2 = Allowed, T 1 3 = Denied, T 2 3 = Allowed, T 2 4 = Denied
Security Controls R :
R = {Firewalls, IDS, Access Controls}
Monitoring:
Monitor(N, S , T , R ) = Evaluate effectiveness of segmentation and security controls.
Overview
The Least Privilege Principle dictates that users and systems should be granted the minimum level of access necessary to
perform their functions. This principle helps to limit the spread of worms and other malicious threats by minimizing the
potential damage that can be caused by compromised accounts or systems.
Implementation Steps
Input: User roles R , Resource access requirements A , Security policy P , Current access levels C .
Output: Restricted access permissions.
Implementation Steps
5 Step 4: Review and adjust current access levels C .
Audit existing permissions and adjust to align with the least privilege policy.
6 Step 5: Monitor and enforce compliance with the least privilege policy.
Continuously review access levels and adjust as necessary to maintain minimal access.
Monitor(R, A , C , P )
Implementation Steps
Input: User roles R , Resource access requirements A , Security policy P , Current access levels C .
Output: Restricted access permissions.
1 Step 1: Identify user roles R and their required access levels.
Define roles based on job functions and responsibilities.
Implementation Steps
5 Step 4: Review and adjust current access levels C .
Audit existing permissions and adjust to align with the least privilege policy.
6 Step 5: Monitor and enforce compliance with the least privilege policy.
Continuously review access levels and adjust as necessary to maintain minimal access.
Implementation Steps
Input: User roles R , Resource access requirements A , Security policy P , Current access levels C .
Output: Restricted access permissions.
Implementation Steps
3 Step 3: Define security policy P based on least privilege.
Implement access controls to enforce the least privilege principle.
Implementation Steps
4 Step 4: Review and adjust current access levels C .
Audit existing permissions and adjust to align with the least privilege policy.
5 Step 5: Monitor and enforce compliance with the least privilege policy.
Continuously review access levels and adjust as necessary to maintain minimal access.
Thank You!