Security
Security
Computer Security
Chapter 1: Introduction
Definitions
Security: the quality of state if being secure (free from danger or to be protected from
adversaries).
Threat: bad things that might happen.
Vulnerability: weakness in your defenses (point whe re a system is suspectible to attack).
Attacks: ways in which the threat may be actualized.
Countermeasures: are techniques for protecting computer or network system from cyber
threats.
Computer security: provisions and policies adopted to protect information and property
aganist intruders and malicious software while allowing the information and property to remain
accessible and productive to it’s intended users.
Network security: provisions and policies adopted to prevent and monitor unauthorized
access, misuse, modification, or denial of the computer network and network accessible
resources.
Types of vulnerabilities
Physical vulnerabilities
Natural vulnerabilities
Hardware and software vulnerabilities
Media vulnerabilities
Communication vulnerabilities
Human vulnerabilities
Types of threats
Natural
Unintentional
Intentional (80% by fully authorized users)
Consequences of risks
Failure/End of service.
Reduction of Qos, (Denial of Service(DoS))
Internal problems in enterprise
Trust decrease
Technology leakage
Human consquences
Countermeasures
Authentication
Encryption
Auditing/inspect the quality of the system
Administrative procedures
Standards
Physical security
Laws
Backups
Removing or reducing vulnerability to prevent an attack and block a threat.
Supplements to CIA
Protocol (IP) address, the Uniform Resource Identifier (URI) they used, and the different services
they accessed.
Goals of security
Categories of attacks
Passive attacks:
Attempt to learn or make use of the information without changing the content of the
message and disrupting the operation of the communication. Example: Eavesdropping
and Traffic
analysis
Very difficult to detect.
Prevention methods are more effective than detection methods.
Active attacks:
External attacks: are carried out by hosts that don’t belong to the network domain,
sometimes they are called outsider.
Internal attacks: occur when malicious node from the network gains unauthorized access and
acts as a genuine node and disrupts the normal operation of nodes.
Network protocols are a set of rules and conventions that govern how data is transmitted
and received over a network. These protocols define:
Format of data packets,
Error handling,
Addressing, and other aspects of network communication.
TCP/IP protocol
It is the foundation of modern networking. It consists of several layers, each with its own set of
protocols.
i. Application Layer: This layer includes protocols like HTTP, FTP, SMTP, and DNS. It
deals with application-level data and user interactions.
ii. Transport Layer: is responsible for end-to-end communication. It includes TCP for
reliable, connection-oriented communication and UDP for connectionless communication.
iii. Internet Layer: is primarily governed by the IP. It is responsible for routing and
addressing data packets to their destination across networks.
iv. Link Layer: includes protocols for the physical and data link layers of network
communication. Ethernet and Wi-Fi are examples of link layer technologies.
Attacks on different layer of TCP/IP model and their countermeasures
Transport Session hijacking, Altering checksum, Use Transport Layer Security (TLS)
layer Man in the Middle attack and SYN for encryption, employ firewalls and
flooding. intrusion detection systems, and
implement SYN/ACK cookies.
Network IP spoofing, ICMP echo, Worm hole, Implement packet filtering, use
layer black hole, gray hole, Byzantine, Access Control Liss (ACLs), and
flooding, DDoS attacks, or routing deploy intrusion detection and
attacks. prevention systems (IDPS)
Data link MAC address spoofing, ARP Implement port security, use MAC
layer poisoning, or VLAN hopping Traffic address filtering, empoy ARP
analysis, disruption (E.g MAC IEEE inspection, and configure VLAN
802.11 Wi-Fi) ACLs (Access Control Lists)
Attacks Countermeasures
Malicious code
Basic forms:
Virus:
Self-replicating software that attaches itself to other software.
Replicates within computer system, potentially attaching itself to every other program.
Innocuous, Humorous, Data altering, Catastrophic
Consists two parts:
Replicator - esponsible for copying the virus to other executable Programs.
Payload - action of a virus (part of the virus that performs modification and
corruption of data).
Anti-virus, proper firewall configuration and various scanners serve as pervention and
detection techniques aganist virus.
Worm:
Computer program that can run independently, can propagate a complete working
version of itself onto other host on a network, may consume computer resources
destructively.
Stand-alone applications
Do not need a carrier program
Replicate by spawning copies of themselves.
More complex and harder to write than the virus programs.
Multitasking computers with open network standards are vulnerable.
Trojan horse:
A programs that appears to have a useful function, but also has a hidden and
malicious purpose that evades security mechanism, sometimes by exploiting the
legitimate authorization of the user who invokes the programs.
A worm which pretends to be a useful program or virus purposely attached to a useful
program prior to distribution.
Untrained users are vulnerable.
User training is one of the best prevention methods.
Aunthentication Mechanisms
To prevent attacks
To revoke access from attackers
To identify user’s identity which required to allow access to confidential data.
Passwords
Best practices
Choose passwords based on passphrase
Use password cracking tool to test for weak pwds
Require periodic password changes
Possible attacks
Denial of Service (DoS)
Dictionary attack : attacker pre-computes h(x) for all x in a dictionary of
common passwords.
Other issues:
Too many passwords to remember
Failure to change default passwords
Social engineering
Bugs, keystroke logging and spyware
Password cracking tools:
Password Crackers
Password Portal
L0phtCrack and LC4 (Windows)
John the Ripper (Unix)
Something the user has
Biometrics
Desirable replacement for passwords.
Hard to forge
Hand Geometry:
Popular form of biometric
Suitable for authentication
Quick
Can’t be used on very young and very old users
Relatively high equal error rate
Iris pattern:
Little or no genetic influence
Different even for identical twins
Pattern is stable through lifetime
Attackers could use photo of eye but it can be detected using scanner with light
to be sure it’s living iris.
Chapter 2: Cryptography
Basic terms
Operations used:
Substitution : replace (bit, letter, group of bits letters).
Transposition : rearrange the order.
Product : use multiple stages of both substitution and transposition.
Number of keys used:
Symmetric : same key , secret-key, private-key.
Asymmetric : different key , public-key.
Way in which the plain text is processed:
Block cipher
Stream cipher
Substitution Ciphers
Caesar Cipher:
p = D(k, c) = (c–k)mod(26)
rather than just shifting the alphabet monoalphabetic cipher could shuffle the letters
arbitrarily. Each plaintext letter maps to a different random ciphertext letter with 26 letters
long key.
E(x) = (ax + b)mod(26)
26! = 4 × 1026 keys
Playfair Cipher:
a polyalphabetic cipher in which the cipher alphabet for the plain alphabet may be
different at different places during the encryption process.
Steps:
First create 5 × 5 matrix and fill it using each character in the given key (no duplicate
characters). Since the matrix can only contain 25 characters put i and j in the same
cell.
Example: key = MONARCHY, plain text = INSTRUMENTS
M O N A R
C H Y B D
E F G I/J K
L P Q S T
U V W X Z
If the letter is standing alone in the process of pairing, then add an extra bogus
letter with the alone letter.
Example: plain text = art -> “ar” “tz” where “z” act as bogus letter
Pair cannot be made with same letter. Break the letter in single and add a bogus
letter to the previous letter.
Example: plain text = hello -> “he” “lx” “lo” where “x” act as bogus letter
For each pair of letters obtained in the second step, apply playfair cipher:
If both the letters are in the same column: Take the letter below each one (going
back to the top if at the bottom).
If both the letters are in the same row: Take the letter to the right of each one
(going back to the leftmost if at the rightmost position).
If neither of the above rules is true: Form a rectangle with the two letters and
take the letters on the horizontal opposite corner of the rectangle.
Using the above example we can apply playfair cipher like this:
The strength of the Vigenère cipher is that it is not susceptible to frequency analysis
due to the fact that the cipher rotates through different shifts, so the same plaintext
letter will not always be encrypted to the same ciphertext letter.
A Vigenère cipher is difficult to crack using brute-force because each letter in a
message could be encoded as any of the 26 letters. Because the encoding of the
message depends on the keyword used, a given message could be encoded in 26k
ways, where k is the length of the keyword.
- The primary weakness of the Vigenère cipher is the repeating nature of its key. If a
cryptanalyst correctly guesses the length of the key, then the ciphertext can be treated as
interwoven Caesar ciphers, which, individually, can be easily broken. Repetitions in the
ciphertext indicate repetitions in the plaintext, and the space between such repetitions hint
at the length of the keyword.
Transposition Ciphers
Steps:
write your plaintext message along the rows of a matrix of some size.
generate ciphertext by reading along the columns. The order in which we read the
columns is determined by the encryption key.
Spartians Cipher (Spartan scytale):
create key × n matrix where n = f loor(length/key) then fill it with each letter in the
plain text.
Exmaple: plain text = “Start the war today” key = 4, n = 16/4 = 4
S t a r
t t h e
w a r t
o d a y
combine each letter in the every column to get the cipher text.
C = E("Start the war today") = "stwottadahrarety"
Rail Fence Cipher:
Write the plaintext downwards on successive “rails” of an imaginary fence. When you get
to the bottom start moving up.
Exmaple: plain text = “Start the war today” rails = 3
S t w
t r t e a
a h r
Write the message in rows of a fixed length, and then read out again column by column.
The columns are chosen in some scrambled order. Both the length of the rows and the
permutation of the columns are usually defined by a keyword.
Any spare spaces are filled with nulls or left blank or placed by a character().
Exmaple: plain text = “Start the war today” key = “HACK”, order of letter in the key =
“4123”
H A C K
3 1 2 4
S t a r
_ t h e
_ w a r
_ t o d
a y _ _
Route Cipher:
The plaintext is first written out in a grid of given dimensions, then we read it off in a
pattern given in the key.
Example: The key say: read message from top right corner down and to the left.
S t a r
t t h e
w a r t
o d a y
Crptanalytic Attacks
Types of Attacks:
An attacker has only the ciphertext and his goal is to find the corresponding plaintext.
An attacker has a ciphertext and the corresponding plaintext and his goal is to find the
key.
Cryptanalytic attack exploits the characteristics of the algorithm.
the attacker tries to determine the key by attempting all possible keys.
time required to break the system by getting the secret key depends on the size of the
key.
Ciphertext Only Attacks (COA):
In this method, the attacker has access to a set of ciphertext(s) but not the plain text.
COA is said to be successful when the corresponding plaintext can be determined
from a given set of ciphertext. Occasionally, the encryption key can be determined
from this attack.
Modern cryptosystems are guarded against ciphertext-only attacks
Known Plaintext Attack (KPA):
In this method, the attacker knows the plaintext for some parts of the ciphertext.
Know/suspect plaintext & ciphertext -> Find key or algorithm
The task is to decrypt the rest of the ciphertext using this information. This may be
done by determining the key or via some other method.
Chosen Plaintext Attack (CPA):
In this method, the attacker has the text of his choice encrypted. So he has the
ciphertext-plaintext pair of his choice. This simplifies his task of determining the
encryption key.
select plaintext and obtain ciphertext -> select ciphertext and obtain plaintext ->
select plaintext or ciphertext to en/decrypt.
Letters are not equally commonly used in English, E is by far the most common letter
followed by T , R , N , I , O , A , S . Other letters like Z , J , K , Q , X are fairly rare.
Categories of cryptography
Symmetric:
same key (secret key) used between the sender and the receiver.
Stream cipher:
encrypt data one bit or one byte at a time.
used if data is a constant stream of information.
combines plaintext digits with a pseudo-random cipher digit stream (keystream) to
obtain the ciphertext.
Block cipher:
operates on fixed length group of bits, called blocks, with an unvarying
transformation.
takes n block of plain text as input and output a corresponding n block of cipher text.
Same thing applies for decryption.
the exact transformation is controlled using a second input which is the secret key.
Modes of operation:
Electronic Codebook (ECB) : Each 64-bit block is encrypted and decrypted
independently.
Cipher Block Chaining (CBC) . Each 64-bit block depends on the previous one and
uses an Initialization Vector (IV).
Cipher Feedback (CFB) . The preceding ciphertext becomes the input for the encryption
algorithm, producing pseudorandom output, which in turn is XORed with plaintext, building
the next ciphertext unit.
Output Feedback (OFB) . Much like CFB, except that the encryption algorithm input is
the output from the preceding DES.
Counter (CTR) . Each plaintext block is XORed with an encrypted counter. The counter is
then incremented for each subsequent block.
weakness:
key size is small.
slower compared to AES and other algorithms.
vulnerable for exhaustive key search attack.
[ b0 | b4 | b8 | b12 |
| b1 | b5 | b9 | b13 |
| b2 | b6 | b10 | b14 |
| b3 | b7 | b11 | b15 ]
total number of rounds and subkeys generated from the original symmetric key.
each round comprises of 4 steps:
SubBytes : performs substitution on each byte with another byte different from the
original and the complement.
ShiftRows : shifts a particular number of times.
The first row is not shifted.
The second row is shifted once to the left.
The third row is shifted twice to the left.
The fourth row is shifted thrice to the left.
[ b0 | b1 | b2 | b3 ] [ b0 | b1 | b2 | b3 ]
| b4 | b5 | b6 | b7 | -> | b5 | b6 | b7 | b4 |
| b8 | b9 | b10 | b11 | | b10 | b11 | b8 | b9 |
[ b12 | b13 | b14 | b15 ] [ b15 | b12 | b13 | b14 ]
MixColumns : each column is multiplied with a specific matrix and thus the position of
each byte in the column is changed as a result.
[ c0 ] [ 2 3 1 1 ] [ b0 ]
| c1 | = | 1 2 3 1 | | b1 |
| c2 | | 1 1 2 3 | | b2 |
[ c3 ] [ 3 1 1 2 ] [ b3 ]
Add Round Key : resultant output of the previous stage is XOR-ed with the
corresponding round key.
DES vs AES
DES AES
P = D(K priv, C)
Provided ability for messages to be exchanged securely without having to have shared some
secret information previously.
Inception of public key cryptography which allowed keys to be exchanged in the open.
Avoided Man in Middle attack.
Symmetric vs Asymmetric cryptography
Symmetric Asymmetric
Same key used for both Different key for both encryption and decryption
encryption and decryption
Need secure channel to transfer Secure channel not needed to transfer the key
the key
RSA algorithim
The first practicable public-key cryptosystems and is widely used for secure data transmission.
Steps:
Digital Signature
Protection of hardware, software networks, data centers and other essential components that
constitute an organization’s information technology infrastructure.
Ensuring the confidentiality, integrity, and avaliability of information and resources.
Practice of protecting critical systems and assets aganist physical and cyber threats.
Process of protecting the data from unauthorized access disclosure, destruction or disruption.
Technology assets
Physical security
Network security
Server security
Data security
Endpoint security
Cloud security
Incident response and Disaster recovery
Security Policies and Training
Physical level
Network level
Application level
Data level
Host Security
A host is any computer including workstations, network servers, laptops, wirelessly networked
devices.
Activities:
Protecting the physical devices.
Securing an operating system software.
Using software based software application.
Monitoring logs
Elements:
Securing devices
Physical access security (hardware lock, deadbolt locks)
Hardware security
Mobile device security (Remote wipe/sanitation, GPS tracking and Voice encryption)
Network monitoring and diagnosis tools
Network Monitoring: a process in which all network components (Router, switch,
firewall, servers and VM) are monitored.
Tools:
SNMP(simple network management protocol)
Widely used
Used to monitor the network, detect network faults, and sometimes even
used to configure remote devices.
Implemented on the application layer.
Components:
SNMP Manager: centeralized system that is used to monitor network.
SNMP Agent: specialized software run by Managed devices which
collect data and store information about the device’s status and
configuartion.
Management Information bases: consists of information on resources
that are to be managed.
Nagios core
Paessler PRTG
Atera
ManageEngine opManager
Security of different media
Media:
Print media
Broadcast media
Internet media
Out-of-home (outdoor) media
Main memory (RAM) and Backing (secondary) storage device
Storage devices: the device that save data onto the storage medium, or read data from it.
Intrusion: any set of action that attempt to compromise the confidentiality, integrity, or
avaliability of a computer resource.
Intrusion detection: detection of break-ins and break-in attempts via automated software
systems. process of identifying and responding to malicious activities targeted at resources.
Intrusion detection system: a system designed to test/analyze network system traffic/events
against a given set of parameters and alert/capture data when these thresholds are met.
Functions:
Detecting attacks as soon as possible
Take reactive measures than preventive mesaure when an attack is detected
It plays a role of information rather than a police officer
Major components:
Central processing devices(control panel)
Alarm/notification devices
Audit data preprocessor
Detection engine
Decision engine
Detection models
Decision table
Detection methods in IDS
IDS reports situation that match signatures IDS reports situation that deviate from
profile
Good”low false alarm rate, instantaneous Good cat detect some new attacks
detection
Bad: cannot detect new attacks Bad: high false alarm rates, high
complexity
Chapter 4: Managing communication and network
security
Remote Access Technologies
Various methods and technologies that enable users to connect to computer sysystems or
networks from a location other than the physical site.
Uses:
Virtual Private Network (VPN): establishes a secure and encrypted connection over the
internet.
Remote Desktop Services (RDS): allows users to connect a desktop environment or
specific application on a remote server.
Cloud-Based solutions
Secure Shell (SSH): cryptographic network protocol that provides a secure way to access
and manage network devices remotely.
Mobile Device Management (MDM): allow organizations to manage and secure mobile
devices remotely.
Web based remote access
Remote file access (File Transfer Protocol (FTP) and Secure File Transfer Protocol
(SFTP))
Remote Access Software
Network Security
Major concerns:
Confidentiality: only sender and intended receiver should “understand” message contents.
Authentication: sender and receiver want to confirm identity of each other.
Message integrity: sender and receiver want to ensure message not altered (in transit, or
afterwards) without detection.
Access and avaliability: services must be accessible and avaliable to users.
Types of attacks in network security:
Active:
Threatening the integrity and avaliability of data being transmitted.
Quite possible in TCP/IP
Examples:
Denial of Services (DoS):
E-mail bombing : flooding someone
Smurf attack : sending a “ping” multicast or broadcast with a spoofed IP of
a victim.
Spoofing attack:
IP spoofing : putting wrong IP address in the source of an IP packet.
DNS spoofing : changing DNS info so that it directs to a wrong maching.
URL spoofing (web phishing)
E-mail address spoofing
Session hijacking
Passive:
Listening to a network and make a use of the information without altering iy.
Passive wiretapping and traffic analysis
Utilities such as EtherDetect and tcpdump used
Protocols and Vulnerabilities:
IP Security (IPSec):
A one way relationship between a sender and a receiver that provides security
services (authentication and confidentiality).
Modes:
Transport mode : protection of upper layer protocols (TCP, UDP).
Before ESP can be used, it is necessary for the two ends of a communication link to
exchange the secret key that will be used for encryption. Similarly, AH needs an
authentication key.
IPSec is a specification for the IP-level security features that are built into the IPv6 internet
protocol. These security features can also be used with the IPv4 internet protocol.
A TCP SYN Flood attack seeks to exploit the TCP three-way handshake mechanism, which is
foundational for establishing connections in TCP/IP networks. The handshake involves three
steps:
A client sends a SYN (synchronize) message to a server, indicating a desire to establish a
connection.
The server acknowledges this request by sending a SYN-ACK message back to the
client.
The client responds with an ACK (acknowledgment), and the connection is officially
established.
In a TCP SYN Flood attack, the malicious entity sends a barrage of SYN requests to a target
server but intentionally avoids sending the final ACK. This leaves the server waiting for a
response that never comes, consuming resources for each of these half-open connections.
Impacts:
Service Disruption: Legitimate users find it difficult or impossible to access the affected
service.
Resource Strain: The server’s resources, including memory and processing power, are
consumed by the flood of bogus requests.
Potential System Failures: In extreme cases, the server might crash or malfunction due to
the overwhelming number of half-open connections.
Mitigation techniques:
SSL/TLS protocols
DNS spoofing
Modifying or poisoning server so that it gives false information by mapping server IP to own
(attacker’s) IP address.
E-mail Security
SMTP Limitations:
Executable files or other binary files.
“National language” characters.
Messages over a certain size.
ASCII to EBCDIC translation problems.
Lines longer than a certain length.
Pretty Good Privacy (PGP):
Provides a confidentiality and authentication service that can be used for electronic mail
and file storage applications.
Services:
Digital Signature
Message Encryption
Compression
E-mail Compatibility
Segmentation
How PGP works:
User A wants to send User B a private email.
User B generates a public and private key.
User B keeps the private key and sends back the public key.
User A encrypts their message using the public key.
User A sends the private encrypted message.
User B decrypts the message with the private key.
S/MIME:
MIME is a techniques used to describes transfer of a multimedia including audio, video
and pictures.
Functions:
Enveloped Data: encrypted content and encrypted session keys for recipients.
Signed Data: message digest encrypted with private key of “signer”.
Clear-Signed Data: signed but not encryoted.
Signed and Enveloped Data: various orderings for encrypting and signing.
PGP S/MIME
designed for processing the plain designed to process email as well as many multimedia
texts files
cheap expensive
depends on user key exchange it relies on a hierarchically valid certificate for key
exchange
PGP S/MIME
standard for strong encryption the standard for strong encryption but it has some
drawbacks
Threats Countermeasures
Denial of Service (DDoS, killing user thread and machine flooding) Detection and action
Web Security
Key features:
Confidentiality of information
Integrity of data
Cardholder account authentication
Merchant authentication
SET participants:
Network Level:
Transparent to applications
Provide general purpose solution
Provides filtering capability
Example: IPSec
Transport Level:
Alternatively, can be embedded into applications
Exmaples: SSL and TLS
Application level:
Embedded within specific application
Examples: SET, HTTP, S/MIME, PGP and SMTP.
Security enhanced application protocols