0% found this document useful (0 votes)
11 views76 pages

CN Notes

Uploaded by

kediatrisha13
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views76 pages

CN Notes

Uploaded by

kediatrisha13
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 76

Confidentiality - prevent unauthorised access and disclosure,encryption

Integrity - no modification in data


Availablity - access of server available
Non repudiation - proof that the message was sent by specified party and received by specified
party.

●​ Encipherment: Hiding information using encryption.


●​ Digital Signature: Proving something is real and unchanged.
●​ Access Control: Deciding who can see or use something.
●​ Data Integrity: Making sure data is correct and safe.
●​ Authentication Exchange: Checking if someone is who they say they are.
●​ Traffic Padding: Adding extra data to hide real messages.
●​ Routing Control: Choosing safe paths for data to travel.

Pervasive Security Mechanisms," it means security measures that are built into multiple
areas of a system to provide overall protection.

●​ Trusted Functionality: Ensures that security mechanisms operate as intended without


vulnerabilities.
●​ Security Label: Assigns classification levels to data or resources to enforce access
control.
●​ Event Detection: Identifies and responds to security incidents in real-time.
●​ Security Audit Trail: Maintains logs of security-related activities for monitoring and
analysis.
●​ Security Recovery: Restores system integrity after a security breach or failure.

Algorithm - encryption algorithm


Data - encryption + secret key(keep it of large no. of bits)
Cryptology is the study of secure communication techniques. It includes:

●​ Cryptography – Creating secure encryption methods.


●​ Cryptanalysis – Breaking or analyzing encryption to find weaknesses.

It is used to protect sensitive data from unauthorized access.

Cryptanalysis is the study of breaking or analyzing encryption methods to understand how


secure they are. It involves finding weaknesses in cryptographic algorithms to decode
information without having the key.
Chosen Plaintext Attack (CPA)

●​ The attacker chooses plaintexts and gets their corresponding ciphertexts.


●​ Helps analyze how encryption works to find weaknesses.
●​ Example: Sending different test messages to see how they encrypt.

Chosen Ciphertext Attack (CCA)

●​ The attacker chooses ciphertexts and gets their decrypted plaintexts.


●​ Used to study how decryption behaves to find flaws.
●​ Example: Modifying an encrypted message and checking the response
to stop this attack we hav captcha
Guessing attack based on frequency
Combine ij as it is a 5 cross 5 matrix
Example of adding a filler character
Mod gives reminder
Mangler function:​

8 S boxes take 6 bits and convert it to 4 bits.


The E function:
Order of round keys changed in des decryption.
Here’s a one-line explanation of each attack based on the OSI model:

1.​ Physical Layer – Eavesdropping, Jamming, False Data Injection​

○​ Attackers intercept or disrupt physical signals using radio


interference or tapping cables.
2.​ Data Link Layer – MAC Spoofing, MITM Attack​

○​ Attackers manipulate MAC addresses to impersonate devices or


intercept communications.
3.​ Network Layer – IP Hijacking, IP Spoofing, Smurf Attack​
○​ Attackers manipulate IP packets to redirect traffic, disguise identities,
or overwhelm networks.
4.​ Transport Layer – TCP Flood, UDP Flood (DoS Attack)​

○​ Attackers overwhelm the target with excessive TCP or UDP


requests, causing service disruption.
5.​ Session Layer – Session Hijacking​

○​ Attackers steal active session tokens to take control of user


sessions.
6.​ Presentation Layer – SSL Stripping​

○​ Attackers downgrade HTTPS to HTTP, intercepting unencrypted


data.
7.​ Application Layer – SMTP Attacks, Insecure HTTP, Browser Hijacking​

○​ Attackers exploit vulnerabilities in web applications, emails, and


browsers to steal data.

Let me know if you need more details on any specific attack! 😊


If security policies conflict, they can create vulnerabilities by allowing
unauthorized access or blocking legitimate actions. This happens due to
overlapping rules, inconsistent priorities, or contradictory policies. For
example, a firewall may permit access while an access control policy denies it,
causing confusion. To prevent this, organizations must align policies, set clear
priority rules, and conduct regular audits to ensure consistency and security.

Trust and Assumptions in Security


Security relies on correct policies and properly enforced mechanisms. If either fails or
assumptions are wrong, trust is broken, leading to vulnerabilities.

✔ Trust and assumptions are fundamental to all security aspects.

1. Policies

●​ Clearly separate secure and insecure system states.


●​ Must accurately define security requirements.

2. Mechanisms

●​ Enforce security policies (e.g., firewalls, authentication).


●​ Assumed to work correctly and reliably.
🔴 Risk: If policies or mechanisms are based on wrong assumptions, security
✅ Solution: Regular audits, testing, and updates to maintain security.
may fail.​

This image explains

Types of Security Mechanisms based on how they manage


system states. The yellow circle represents the set of reachable states (states
the system can enter), while the green circle represents the set of secure
states (states that ensure security).

1. Secure Mechanism

●​ The secure state (green) completely covers the reachable state (yellow).
●​ All reachable states are secure, meaning no system state leads to
insecurity.
●​ Highly restrictive, may limit functionality.

2. Precise Mechanism

●​ The reachable states (yellow) perfectly match the secure states (green).
●​ Ideal case where all accessible states are secure without over-restriction.
●​ Ensures security without unnecessary limitations.

3. Broad Mechanism

●​ The reachable states (yellow) exceed the secure states (green).


●​ Some reachable states are insecure, meaning potential vulnerabilities
exist.
●​ Less restrictive but riskier—may allow security breaches.
Conclusion:

●​ Secure mechanisms are the safest but may limit usability.


●​ Precise mechanisms are optimal, balancing security and usability.
●​ Broad mechanisms provide flexibility but increase security risks.

Context: Why Assurance Matters?


Security is based on policies (rules) and mechanisms (enforcement). But just
having policies and mechanisms isn't enough—we need Assurance to prove
that they actually work correctly.

Breakdown of Assurance:

Assurance ensures that the system is secure by verifying each stage:

1.​ Specification (What should the system do?)


○​ Defines security requirements based on risk analysis.
○​ Creates a clear statement of expected security behavior.
2.​ Design (How will the system achieve this?)
○​ Plans how the system meets the specification.
○​ Chooses security models, structures, and mechanisms.
3.​ Implementation (Building the system securely)
○​ Translates the design into actual programs, code, and systems.
○​ Ensures that coding and development follow secure practices.

Why is this Important?


Even if we trust the system’s policies and mechanisms, security can still fail if:​


Requirements are unclear (bad specification)​


Design doesn't fully meet the requirements​
Implementation introduces bugs (e.g., coding flaws)

Assurance validates security at every step to ensure the system works as


intended.

Operational Issues in Security


Security isn't just about technical measures; it also involves practical
decision-making based on costs, risks, and regulations.
1.​ Cost-Benefit Analysis
○​ Evaluates whether preventing a security issue is cheaper than
dealing with its consequences.
○​ Example: Is it cheaper to invest in firewalls, or just recover from
occasional cyberattacks?
2.​ Risk Analysis


○​ Helps determine:​


Should we protect something? (Is it at risk?)​
How much should we invest in protection? (Is it worth it?)
○​ Example: A bank will invest heavily in security, but a small blog
website might not need the same level of protection.
3.​ Laws and Customs
○​ Ensures that security measures comply with laws and fit user
expectations.
○​ Example: Surveillance cameras can improve security but may
violate privacy laws or user trust.

Why This Matters?

Even if a security system is technically strong, ignoring these operational


factors can make it impractical or even illegal.

Human Issues in Security


Security isn't just about technology—human factors play a big role.

1.​ Organizational Problems


○​ Power & Responsibility:
■​ Who is in charge of security? If unclear, security can fail.
■​ Example: A company with no clear security head may ignore
threats.
○​ Financial Benefits:
■​ Security costs money, but some may cut corners to save
costs.
■​ Example: A company might skip cybersecurity measures to
increase profits.
2.​ People Problems
○​ Outsiders & Insiders:
■​ Attacks can come from hackers (outsiders) or even
employees (insiders).
■​ Example: A disgruntled employee leaks sensitive data.
○​ Social Engineering:
■​ Hackers manipulate people into giving away information.
■​ Example: Phishing emails trick employees into revealing
passwords.

Here’s a one-line explanation for each security principle:

1.​ Economy of Mechanism – Keep security systems simple and small to


reduce errors and vulnerabilities.
2.​ Fail-Safe Defaults – Deny access by default and grant it only when
explicitly permitted.
3.​ Complete Mediation – Validate every access request through a
centralized control mechanism.
4.​ Open Design – Security should rely on transparency, except for secret
keys.
5.​ Separation of Privilege – Require multiple credentials or conditions to
access sensitive data.
6.​ Least Privilege – Grant only the minimum access necessary for users to
perform their tasks.
7.​ Least Common Mechanism – Reduce shared resources among users to
limit attack surfaces.
8.​ Psychological Acceptability – Make security measures user-friendly to
encourage compliance.
9.​ Isolation – Keep public, user, and security components separate to limit
unauthorized access.
10.​ Encapsulation – Restrict access to internal structures using
object-oriented design.
11.​Modularity – Design security as independent modules for easier
maintenance and updates.
12.​ Layering – Use multiple security measures to provide overlapping
protection.
13.​ Least Astonishment – Ensure the system behaves as expected to
prevent user confusion and errors.

Would you like any further refinements? 😊


Attack Surfaces Explained in Simple Terms

An attack surface is all the ways a hacker can try to break into a system. It
includes weaknesses that are reachable and exploitable by attackers.

Examples of Attack Surfaces

●​ Open ports on servers that hackers can connect to.


●​ Services running inside a firewall that might have weak security.
●​ Software that handles emails, files, or forms, which can be tricked into
running harmful code.
●​ Employees who can be tricked into revealing sensitive information (social
engineering).

Types of Attack Surfaces

1.​ Network Attack Surface – Weaknesses in network communication, like


open ports, insecure protocols, or attacks that disrupt connections.
2.​ Software Attack Surface – Bugs or vulnerabilities in apps, operating
systems, or web servers that hackers can exploit.
3.​ Human Attack Surface – Mistakes or manipulation of people, such as
phishing scams, weak passwords, or insider threats.

Attack Surface Analysis

This process helps find weak spots in a system by:

1.​ Listing all ways data enters or leaves the system (like APIs, forms, network
connections).
2.​ Checking how risky each entry point is.

Why It’s Important

●​ Reduces ways hackers can break in.


●​ Helps focus security efforts on the most vulnerable areas.

Here are one-liners for each type of attack:

●​ Social engineering/phishing – Tricking people into revealing sensitive


information.
●​ Physical break-ins, theft – Gaining access to devices or data through
unauthorized physical entry.
●​ Password attacks – Cracking or stealing passwords to access systems.
●​ Buffer overflows – Exploiting memory overflow to execute malicious
code.
●​ Command injection – Inserting harmful commands into a system to gain
control.
●​ Denial of Service (DoS) – Overloading a system to make it unusable.
●​ Exploitation of faulty application logic – Taking advantage of weak
software design.
●​ Snooping – Secretly monitoring data or network activity.
●​ Packet manipulation or fabrication – Tampering with network traffic to
mislead systems.
●​ Backdoors – Hidden access points used to bypass security.
●​ Malware – Harmful software like viruses, worms, and trojans that disrupt or
control systems.

Would you like further simplification or examples? 😊

This attack tree represents different ways a bank account compromise can
occur. Let's break it down:

Root Node (Main Goal)

●​ Bank account compromise: The ultimate goal of an attacker.

Primary Attack Paths

1.​ User Credential Compromise


○​ User surveillance (UT/U1a): Monitoring user activities to steal
credentials.
○​ Theft of token and handwritten notes (UT/U1b): Stealing security
tokens or written passwords.
○​ Malicious software installation: Using malware to capture
credentials.
○​ Smartcard analyzers (UT/U3a): Analyzing smartcard data to extract
credentials.
○​ Smartcard reader manipulator (UT/U3b): Modifying card readers
to capture credentials.
○​ Brute force attacks with PIN calculators (UT/U3c): Guessing PINs
using automated tools.
○​ Sniffing (CC2): Intercepting user data over a network.
○​ User communication with attacker: Tricking users into revealing
credentials.
2.​ Vulnerability Exploits
○​ Hidden code (UT/U2a): Injecting malicious hidden scripts.
○​ Worms (UT/U2b): Using self-spreading malware.
○​ Emails with malicious code (UT/U2c): Phishing emails with
harmful links or attachments.
3.​ Social Engineering & Web Attacks
○​ Social engineering (UT/U4a): Manipulating users into revealing
sensitive info.
○​ Web page obfuscation (UT/U4b): Creating fake websites to
deceive users.
○​ Pharming (CC1): Redirecting users to fraudulent banking sites.
○​ Web site manipulation (IBS3): Modifying legitimate sites to steal
credentials.
4.​ Injection of Commands
○​ Active man-in-the-middle attacks (CC3): Intercepting and altering
communications.
5.​ User Credential Guessing
○​ Brute force attacks (IBS1): Trying multiple password combinations.
6.​ Security Policy Violations (IBS2)
○​ Exploiting weaknesses in bank security policies.
7.​ Session Hijacking
○​ Using a known authenticated session: Taking over an active user
session.
○​ Pre-defined session IDs (CC4): Exploiting weak session
management.

CHALLENGES IN CNS
1. Balancing Complexity, Usability, and Threat Mitigation

●​ Security requirements seem simple (confidentiality, authentication,


integrity, etc.).
●​ Implementation is complex, requiring deep understanding and
reasoning.
2. Complexity of Security Requirements

●​ Security goals (e.g., confidentiality, authentication) seem straightforward.


●​ Implementation mechanisms (e.g., encryption, access control) are
intricate.
●​ Attackers exploit subtle weaknesses in these mechanisms.

3. Thinking Like an Attacker

●​ Successful attacks exploit unexpected weaknesses.


●​ Attackers approach problems differently, looking for vulnerabilities that
are overlooked.

4. Counterintuitive Security Mechanisms

●​ Security appears unnecessarily complex at first.


●​ Only makes sense when considering the full range of possible threats.

5. Placement of Security Mechanisms

●​ Physical placement: Where in the network should security measures be


applied?
●​ Logical placement: At what layer of the system (e.g., application layer,
network layer)?

6. Managing Secrets and Protocols

●​ Security relies on confidential information (e.g., encryption keys,


passwords).
●​ Challenges include:
○​ Secure creation and distribution of keys.
○​ Ensuring protection from leaks or attacks.
○​ Delays in security protocols that can cause inefficiencies.

7. Battle of Wits

●​ Defenders must eliminate all weaknesses.


●​ Attackers only need one vulnerability to succeed.
●​ Security is a constant battle with evolving threats.

8. Perceived Value of Security

●​ Security is often undervalued until a breach happens.


●​ Failures highlight its importance, but by then, it may be too late.
●​ Ongoing security efforts are necessary to prevent attacks.

9. Continuous Monitoring

●​ Security requires constant vigilance.


●​ Large environments make monitoring difficult.
●​ Attackers often operate unnoticed for long periods.

10. Security as an Afterthought

●​ Often, security is added after design, leading to inefficiencies.


●​ It is sometimes viewed as a barrier to usability and performance.

Security Standards
To ensure consistency and best practices, various organizations define security
standards:

1.​ National Institute of Standards and Technology (NIST)


○​ Develops standards for U.S. government and industry.
○​ Key standards:
■​ Federal Information Processing Standards (FIPS)
■​ Special Publications (SP)
2.​ Internet Society (ISOC)
○​ Supports Internet standards through:
■​ Internet Engineering Task Force (IETF)
■​ Internet Architecture Board (IAB)
○​ Publishes security guidelines as Requests for Comments (RFCs).
3.​ International Telecommunication Union (ITU-T)
○​ UN agency setting global telecom and security standards.
○​ Standards are called Recommendations.
4.​ International Organization for Standardization (ISO)
○​ Develops global standards in technology, science, and trade.
○​ ISO standards facilitate global cooperation.

Final Thoughts

Computer and network security involve continuous efforts, deep reasoning,


and a balance between security and usability. Security cannot be an
afterthought; it must be built into systems from the start. Organizations like
NIST, ISOC, ITU-T, and ISO help define security standards to ensure best
practices worldwide.

"Big Cats In India Secretly Visit Isolated Snowy Summits."

Each word corresponds to a key concept from the list:

●​ Big → Broken Access Control


●​ Cats → Cryptographic Failures
●​ In → Injection
●​ India → Insecure Design
●​ Secretly → Security Misconfiguration
●​ Visit → Vulnerable and Outdated Components
●​ Isolated → Identification and Authentication Failures
●​ Snowy → Software and Data Integrity Failures
●​ Summits → Security Logging and Monitoring Failures
●​ Side → Server-Side Request Forgery

Methods of broken access control


●​ Cross-Site Scripting (XSS): Injects malicious scripts into web pages
viewed by users.
●​ Injection Flaws: Manipulates queries (e.g., SQL, LDAP) to execute
unintended commands.
●​ Broken Authentication and Session Management: Exploits weak login
or session controls to hijack accounts.
●​ Brute Force Attacks: Tries multiple password combinations to gain
unauthorized access.
●​ Session Hijacking: Steals active session tokens to impersonate a user.
●​ Man-in-the-Middle (MitM) Attacks: Intercepts and alters communication
between two parties.
●​ Replay Attacks: Captures and reuses valid authentication requests to
gain access.
●​ Privilege Escalation Attacks: Exploits system flaws to gain higher access
rights than intended.
Security Misconfiguration Explained

Definition:​
Security misconfiguration occurs when an application, server, or database is not
securely set up, leading to vulnerabilities that attackers can exploit. This can
result from default settings, unnecessary features, or improper permissions.

Risks:

●​ Weak default credentials (e.g., "admin/admin" login).


●​ Outdated software or unpatched security flaws.
●​ Exposed sensitive information (e.g., error messages revealing system
details).

Impact:

●​ Attackers can bypass security controls and gain unauthorized access.


●​ Exploitable gaps can lead to data breaches, malware injections, or
complete system compromise.


Mitigation:​


Regularly update and patch all software and dependencies.​


Disable unnecessary features, services, and accounts.​


Use least privilege principles (restrict user access).​


Harden configurations (e.g., strong passwords, HTTPS, secure API keys).​
Perform regular security audits and automated scans.

Vulnerable and Outdated Components Explained

Definition:​
This occurs when an application uses outdated software, libraries, frameworks,
or plugins with known vulnerabilities. Attackers can exploit these weaknesses to
compromise systems.

Risks:

●​ Use of unpatched software (e.g., old versions of frameworks or


dependencies).
●​ Third-party libraries with known security flaws (e.g., Log4j vulnerability).
●​ Malicious or abandoned components that may introduce security risks.

Impact:

●​ Server takeovers: Attackers can exploit outdated components to gain


control.
●​ Data breaches: Sensitive data can be stolen or manipulated.
●​ Service disruptions: Attacks like ransomware can render applications
unusable.


Mitigation:​


Regularly update software, libraries, and dependencies.​


Monitor for vulnerabilities (e.g., use CVE databases, security advisories).​


Remove unused or unsupported components from the system.​
Use dependency management tools (e.g., OWASP Dependency-Check,
Snyk).

Example:

●​ The Log4j vulnerability (Log4Shell) allowed remote code execution


(RCE) on unpatched servers, leading to major cyberattacks.

OWASP Top 10 (2021) - Brief Explanation


1.​ Broken Access Control
○​ Occurs when users can access data or functions they shouldn't.
○​ Example: A normal user accessing admin functionalities.
○​ Mitigation: Implement proper role-based access control (RBAC)
and enforce least privilege.
2.​ Cryptographic Failures (A02:2021)
○​ Weak or missing encryption exposes sensitive data.
○​ Example: Storing passwords in plain text or using outdated
algorithms like MD5.
○​ Mitigation: Use strong encryption (AES-256, TLS 1.2+), and secure
key management.
3.​ Injection (A03:2021)
○​ Attacker injects malicious code into queries or scripts.
○​ Example: SQL Injection (' OR '1'='1), Cross-Site Scripting
(XSS).
○​ Mitigation: Use parameterized queries and input validation.
4.​ Insecure Design (A04:2021)
○​ Security flaws due to poor application design.
○​ Example: Lack of security controls, weak authentication logic.
○​ Mitigation: Implement secure design principles, threat modeling.
5.​ Security Misconfiguration (A05:2021)
○​ Improperly configured settings create vulnerabilities.
○​ Example: Default credentials, open admin panels, unnecessary
services running.
○​ Mitigation: Regular security audits, disable unused features,
enforce security policies.
6.​ Vulnerable and Outdated Components (A06:2021)
○​ Using outdated software with known vulnerabilities.
○​ Example: Log4j vulnerability, unpatched CMS like WordPress.
○​ Mitigation: Regular updates, vulnerability monitoring (CVE
databases).
7.​ Identification and Authentication Failures (A07:2021)
○​ Weak authentication mechanisms allow unauthorized access.
○​ Example: Weak passwords, no multi-factor authentication (MFA).
○​ Mitigation: Use strong authentication (OAuth, MFA, session timeout
policies).
8.​ Software and Data Integrity Failures (A08:2021)
○​ Poor validation of software updates and data integrity.
○​ Example: Attackers injecting malware via software supply chain
attacks.
○​ Mitigation: Use code signing, verify software updates, secure CI/CD
pipelines.
9.​ Security Logging and Monitoring Failures (A09:2021)
○​ Lack of proper logging and monitoring for security incidents.
○​ Example: Not detecting repeated failed login attempts or API
misuse.
○​ Mitigation: Implement centralized logging, real-time monitoring,
alerting systems.
10.​ Server-Side Request Forgery (SSRF) (A10:2021)
●​ Attackers trick servers into making unauthorized requests.
●​ Example: Exploiting an API to access internal resources.
●​ Mitigation: Restrict outgoing requests, validate URLs, use allowlists.
What is Shellcode?

●​ Shellcode is a small piece of code injected by an attacker into a


program's memory.
●​ Its goal is to gain control over the system by exploiting vulnerabilities in
the program.
●​ Traditionally, shellcode launches a command-line shell (hence the name
"shellcode"), allowing attackers to execute commands with the privileges of
the compromised program.

How Does Shellcode Work?

1.​ On UNIX systems (like Linux/macOS)


○​ Attackers use the execve("/bin/sh") function.
○​ This replaces the current program with a shell (like Bash or Sh).
○​ The attacker can then execute commands with the privileges of the
exploited program.
2.​ On Windows systems
○​ Attackers call the system("command.exe") function (or cmd.exe
on newer systems).
○​ This launches the Windows command prompt (CMD).
○​ The attacker can then run commands on the system.
Why is Shellcode Dangerous?

●​ It allows an attacker to fully control a compromised system.


●​ It can be embedded into exploits targeting buffer overflow
vulnerabilities.
●​ If a program does not properly handle memory (e.g., using unsafe
functions like gets() or strcpy()), attackers can inject and execute
shellcode.

You might also like