CNT - Module 3
CNT - Module 3
1. Network firewall
Firewalls are the first line of defense in network security. These network
applications or devices monitor and control the flow of incoming and outgoing
network traffic between a trusted internal network and untrusted external networks.
Network traffic is evaluated based on state, port and protocol, with filtering
decisions made based on both administrator-defined security policy and static
rules.
2. Intrusion prevention system
Network IPSes are software products that provide continuous monitoring of the
network or system activities and analyze them for signs of policy violations,
deviations from standard security practices or malicious activity. They log, alert
and react to discovered issues. IPS products compare current activity with a list of
signatures known to represent threats. They can also use alternative detection
methods -- such as protocol analysis, anomaly and behavioral detection or
heuristics -- to discover suspicious network activity and malicious software.
Sophisticated IPSes use threat intelligence and machine learning to increase
accuracy.
UTM devices are best suited for SMBs and for branch and remote sites. UTM
products are the second-largest network security category with over $5 billion in
spending.
The benefit of advanced network threat prevention tools is their ability to detect
malware that has sophisticated evasion or obfuscation capabilities, as well as detect
new malware that hasn't been previously identified. Additionally, they validate
threat information and uncover critical indicators of compromise that can be used
for future investigations and threat hunting.
7. DDoS mitigation
DDoS mitigation is a set of hardening techniques, processes and tools that enable a
network, information system or IT environment to resist or mitigate the effect of
DDoS attacks on networks. DDoS mitigation activities typically require analysis of
the underlying system, network or environment for known and unknown security
vulnerabilities targeted in a DDoS attack. This also requires identification of what
normal conditions are -- through traffic analysis -- and the ability to identify
incoming traffic to separate human traffic from humanlike bots and hijacked web
browsers.
Before diving into the different subsets of network attacks, we first need to outline
the difference between passive and active network security threats.
Passive: During a passive attack, attackers fraudulently access a network
and monitor/steal sensitive data. However, the attackers do not alter the
source data in any manner
Active: Under active attack, attackers gain unauthorized access and alter
source data by deleting or encrypting it
After gaining unauthorized access to a corporate network, attackers often combine
various attack techniques like compromising an endpoint or injecting malware to
wreak havoc.
Active attacks:
Active attacks are a type of cyber security attack in which an attacker attempts to
alter, destroy, or disrupt the normal operation of a system or network. Active
attacks involve the attacker taking direct action against the target system or
network, and can be more dangerous than passive attacks, which involve simply
monitoring or eavesdropping on a system or network.
Masquerade –
Masquerade is a type of cybersecurity attack in which an attacker pretends to be
someone else in order to gain access to systems or data. This can involve
impersonating a legitimate user or system to trick other users or systems into
providing sensitive information or granting access to restricted areas.
There are several types of masquerade attacks, including:
Username and password masquerade: In a username and password
masquerade attack, an attacker uses stolen or forged credentials to log into a
system or application as a legitimate user.
IP address masquerade: In an IP address masquerade attack, an attacker
spoofs or forges their IP address to make it appear as though they are
accessing a system or application from a trusted source.
Website masquerade: In a website masquerade attack, an attacker creates a
fake website that appears to be legitimate in order to trick users into providing
sensitive information or downloading malware.
Email masquerade: In an email masquerade attack, an attacker sends an
email that appears to be from a trusted source, such as a bank or government
agency, in order to trick the recipient into providing sensitive information or
downloading malware.
With a DoS attack, the target site gets flooded with illegitimate requests. Because
the site has to respond to each request, its resources get consumed by all the
responses. This makes it impossible for the site to serve users as it normally does
and often results in a complete shutdown of the site.
DoS and DDoS attacks are different from other types of cyber attacks that enable
the hacker to either obtain access to a system or increase the access they currently
have. With these types of attacks, the attacker directly benefits from their efforts.
With DoS and DDoS network attacks, on the other hand, the objective is simply to
interrupt the effectiveness of the target's service. If the attacker is hired by a
business competitor, they may benefit financially from their efforts.
A DoS attack can also be used to create vulnerability for another type of attack.
With a successful DoS or DDoS attack, the system often has to come offline,
which can leave it vulnerable to other types of attacks. One common way to
prevent DoS attacks is to use a firewall that detects whether requests sent to your
site are legitimate. Imposter requests can then be discarded, allowing normal traffic
to flow without interruption. An example of a major internet attack of this kind
occurred in February 2020 to Amazon Web Services (AWS).
MITM attacks
In a MITM attack, the two parties involved feel like they are communicating as
they normally do. What they do not know is that the person actually sending the
message illicitly modifies or accesses the message before it reaches its destination.
Some ways to protect yourself and your organization from MITM attacks is by
using strong encryption on access points or to use a virtual private network (VPN).
Phishing attacks
A phishing attack occurs when a malicious actor sends emails that seem to be
coming from trusted, legitimate sources in an attempt to grab sensitive information
from the target. Phishing attacks combine social engineering and technology and
are so-called because the attacker is, in effect, “fishing” for access to a forbidden
area by using the “bait” of a seemingly trustworthy sender.
that then fools you into downloading malware such as viruses, or giving the
attacker your private information. In many cases, the target may not realize they
have To execute the attack, the bad actor may send a link that brings you to a
website been compromised, which allows the attacker to go after others in the
same organization without anyone suspecting malicious activity.
You can prevent phishing attacks from achieving their objectives by thinking
carefully about the kinds of emails you open and the links you click on. Pay close
attention to email headers, and do not click on anything that looks suspicious.
Check the parameters for “Reply-to” and “Return-path.” They need to connect to
the same domain presented in the email.
1. Encipherment :
This security mechanism deals with hiding and covering of data which helps
data to become confidential. It is achieved by applying mathematical
calculations or algorithms which reconstruct information into not readable
form. It is achieved by two famous techniques named Cryptography and
Encipherment. Level of data encryption is dependent on the algorithm used for
encipherment.
2. Access Control :
This mechanism is used to stop unattended access to data which you are
sending. It can be achieved by various techniques such as applying passwords,
using firewall, or just by adding PIN to data.
3. Notarization :
This security mechanism involves use of trusted third party in communication.
It acts as mediator between sender and receiver so that if any chance of
conflict is reduced. This mediator keeps record of requests made by sender to
receiver for later denied.
4. Data Integrity :
This security mechanism is used by appending value to data to which is
created by data itself. It is similar to sending packet of information known to
both sending and receiving parties and checked before and after data is
received. When this packet or data which is appended is checked and is the
same while sending and receiving data integrity is maintained.
5. Authentication exchange :
This security mechanism deals with identity to be known in communication.
This is achieved at the TCP/IP layer where two-way handshaking mechanism
is used to ensure data is sent or not
6. Bit stuffing :
This security mechanism is used to add some extra bits into data which is
being transmitted. It helps data to be checked at the receiving end and is
achieved by Even parity or Odd Parity.
7. Digital Signature :
This security mechanism is achieved by adding digital data that is not visible
to eyes. It is form of electronic signature which is added by sender which is
checked by receiver electronically. This mechanism is used to preserve data
which is not more confidential but sender’s identity is to be notified.
Polyalphabetic Ciphers: This is the type of cipher where any one of the
letters in the plaintext is substituted by a different letter to keep frequency
analysis challenging. For example, the Vigenère cipher operates with a
keyword that would determine the shift value for each letter in the plaintext.
Data Encryption Standard (DES) is a block cipher with a 56-bit key length
that has played a significant role in data security.
Data encryption standard (DES) has been found vulnerable to very
powerful attacks therefore, the popularity of DES has been found slightly
on the decline.
DES is a block cipher and encrypts data in blocks of size of 64 bits each,
which means 64 bits of plain text go as the input to DES, which produces
64 bits of ciphertext.
The same algorithm and key are used for encryption and decryption, with
minor differences. The key length is 56 bits.
AES performs operations on bytes of data rather than in bits. Since the block size
is 128 bits, the cipher processes 128 bits (or 16 bytes) of the input data at a time.
The number of rounds depends on the key length as follows :
128 bit key – 10 rounds
192 bit key – 12 rounds
256 bit key – 14 rounds
A Key Schedule algorithm is used to calculate all the round keys from the key. So
the initial key is used to create many different round keys which will be used in
the corresponding round of the encryption.
Encryption:
AES considers each block as a 16 byte (4 byte x 4 byte = 128 ) grid in a column
major arrangement.
[ b0 | b4 | b8 | b12 |
| b1 | b5 | b9 | b13 |
| b2 | b6 | b10| b14 |
| b3 | b7 | b11| b15 ]
Each round comprises of 4 steps :
SubBytes
ShiftRows
MixColumns
Add Round Key
The last round doesn’t have the MixColumns round.
The SubBytes does the substitution and ShiftRows and MixColumns performs the
permutation in the algorithm.
Sub Bytes:
This step implements the substitution.
In this step each byte is substituted by another byte. Its performed using a lookup
table also called the S-box. This substitution is done in a way that a byte is never
substituted by itself and also not substituted by another byte which is a
compliment of the current byte. The result of this step is a 16 byte (4 x 4 ) matrix
like before.
Shift Rows
This step is just as it sounds. Each row is shifted a particular number of times.
Add Round Keys : Now the resultant output of the previous stage is XOR-ed
with the corresponding round key. Here, the 16 bytes is not considered as a grid
but just as 128 bits of data.
After all these rounds 128 bits of encrypted data is given back as output. This
process is repeated until all the data to be encrypted undergoes this process .
Decryption:
The stages in the rounds can be easily undone as these stages have an opposite to
it which when performed reverts the changes.Each 128 blocks goes through the
10,12 or 14 rounds depending on the key size.
The stages of each round in decryption is as follows :
Inverse MixColumns :
This step is similar to the MixColumns step in encryption, but differs in the
matrix used to carry out the operation.
[ b0 ] [ 14 11 13 9 ] [ c0 ]
| b1 | = | 9 14 11 13 | | c1 |
| b2 | | 13 9 14 11 | | c2 |
[ b3 ] [ 11 13 9 14 ] [ c3 ]
Inverse SubBytes :
Inverse S-box is used as a lookup table and using which the bytes are substituted
during decryption.
Applications:
AES is widely used in many applications which require secure data storage and
transmission. Some common use cases include:
This method of cryptography requires two separate keys, one that is private
or secret, and one that is public.
Public key cryptography uses a pair of keys to encrypt and decrypt data to
protect it against unauthorized access or use.
Network users receive a public and private key pair from certification
authorities. If other users want to encrypt data, they get the intended
recipient’s public key from a public directory.
This key is used to encrypt the message, and to send it to the recipient. When
the message arrives, the recipient decrypts it using a private key, to which no
one else has access.
The Public key is used for encryption, and the Private Key is used for decryption.
Decryption cannot be done using a public key. The two keys are linked, but the
private key cannot be derived from the public key. The public key is well known,
but the private key is secret and it is known only to the user who owns the key. It
means that everybody can send a message to the user using user's public key. But
only the user can decrypt the message using his private key.
o The data to be sent is encrypted by sender A using the public key of the
intended receiver
o B decrypts the received ciphertext using its private key, which is known only
to B. B replies to A encrypting its message using A's public key.
o A decrypts the received ciphertext using its private key, which is known
only to him.
RSA encryption algorithm:
RSA is the most common public-key algorithm, named after its inventors Rivest,
Shamir, and Adelman (RSA).
RSA algorithm uses the following procedure to generate public and private
keys:
The Diffie-Hellman key exchange works by allowing two parties (Alice and Bob)
to agree on a shared secret key over an insecure channel, without any other party
being able to intercept the key or learn anything about it. The key exchange
involves the following steps –
Alice and Bob agree on two large prime numbers, p and g, and a public key
exchange algorithm.
Alice chooses a secret integer, a, and computes A = g^a mod p. She sends A
to Bob.
Bob chooses a secret integer, b, and computes B = g^b mod p. He sends B to
Alice.
Alice computes s = B^a mod p. Bob computes s = A^b mod p.
Alice and Bob now both have shared secret keys, which they can use to
establish a secure communication channel.
The security of the Diffie-Hellman key exchange relies on the fact that it is
computationally infeasible for an attacker to determine the shared secret keys from
the public values of p, g, A, and B. This allows Alice and Bob to exchange the key
securely, even over an insecure channel.
Alice and Bob agree on two large prime numbers, p and g, and a public key
exchange algorithm.
Alice chooses a secret integer, a, and computes A = g^a mod p. She sends A
to Bob.
Bob chooses a secret integer, b, and computes B = g^b mod p. He sends B to
Alice.
Alice computes s = B^a mod p. Bob computes s = A^b mod p.
Alice and Bob now both have the shared secret key s, which they can use to
establish a secure communication channel.
The security of the Diffie-Hellman key exchange relies on the fact that it is
computationally infeasible for an attacker to determine the shared secret key s from
the public values of p, g, A, and B. This allows Alice and Bob to exchange the key
securely, even over an insecure channel.
SSL/TLS − The Secure Sockets Layer (SSL) and Transport Layer Security
(TLS) protocols use the Diffie-Hellman key exchange to establish a secure
channel between a client and a server. This allows the client and server to
exchange encrypted messages over an insecure network, such as the Internet.
SSH − The Secure Shell (SSH) protocol uses the Diffie-Hellman key
exchange to establish a secure channel between a client and a server. This
allows users to securely log in to a remote server and execute commands,
transfer files, and perform other tasks over an insecure network.
VPNs − Many VPN protocols, such as IPSec and OpenVPN, use the Diffie-
Hellman key exchange to establish a secure connection between a client and
a server. This allows the client and server to exchange encrypted traffic over
an insecure network, such as the Internet.
SFTP − The Secure File Transfer Protocol (SFTP) uses the Diffie-Hellman
key exchange to establish a secure channel between a client and a server.
This allows users to securely transfer files between two systems over an
insecure network.
What is a Hash Function?
A hash function is a function that takes an input (or ‘message’) and returns a
fixed-size string of bytes. The output, typically a number, is called the hash
code or hash value. The main purpose of a hash function is to efficiently map
data of arbitrary size to fixed-size values, which are often used as indexes in
hash tables.
Key Properties of Hash Functions
Deterministic: A hash function must consistently produce the same output for
the same input.
Fixed Output Size: The output of a hash function should have a fixed size,
regardless of the size of the input.
Efficiency: The hash function should be able to process input quickly.
Uniformity: The hash function should distribute the hash values uniformly
across the output space to avoid clustering.
Pre-image Resistance: It should be computationally infeasible to reverse the
hash function, i.e., to find the original input given a hash value.
Collision Resistance: It should be difficult to find two different inputs that
produce the same hash value.
Avalanche Effect: A small change in the input should produce a significantly
different hash value.
Applications of Hash Functions
Hash Tables: The most common use of hash functions in DSA is in
hash tables, which provide an efficient way to store and retrieve
data.
Data Integrity: Hash functions are used to ensure the integrity of
data by generating checksums.
Cryptography: In cryptographic applications, hash functions are
used to create secure hash algorithms like SHA-256.
Data Structures: Hash functions are utilized in various data
structures such as Bloom filters and hash sets.
Secure Hashing Algorithm, or SHA. Data and certificates are hashed with
SHA, a modified version of MD5.
By using bitwise operations, modular additions, and compression functions,
a hashing algorithm reduces the input data into a smaller form that is
impossible to comprehend.
Can hashing be cracked or decrypted, you may wonder? The main
distinction between hashing and encryption is that hashing is one-way; once
data has been hashed, the resultant hash digest cannot be decrypted unless a
brute force assault is applied. See the illustration below to see how the SHA
algorithm functions.
SHA is designed to provide a different hash even if only one character in the
message changes. As an illustration, consider combining the themes Heaven
and Heaven Is Different. The only difference between a capital and tiny
letter, though, is size.
The first message is hashed using SHA-1 to get the hash digest
"06b73bd57b3b938786daed820cb9fa4561bf0e8e".
The hash digest for the second, analogous message will look like
"66da9f3b8d9d83f34770a14c38276a69433a535b" if it is hashed with SHA-
1.
The avalanche effect is what is known for this.
This phenomenon is crucial for cryptography since it implies that even the
smallest alteration to the message being entered entirely alters the output.
As a result, attackers won't be able to decipher what the hash digest initially
said or determine whether the message was altered while in route and inform
the message's recipient.
SHAs can aid in identifying any modifications made to an original message.
A user can determine whether even one letter has been altered by consulting
the original hash digest since the hash digests will be entirely different. The
fact that SHAs are deterministic is one of their key features.
This implies that any machine or user may reproduce the hash digest if they
know the hash algorithm that was used. Every SSL certificate on the Internet
must have been hashed with the SHA-2 procedure because of the
determinism of SHAs.
Digital Signature
A digital signature is a mathematical technique used to validate the authenticity
and integrity of a message, software, or digital document.
1. Key Generation Algorithms: Digital signature is electronic signatures, which
assure that the message was sent by a particular sender. While performing
digital transactions authenticity and integrity should be assured, otherwise, the
data can be altered or someone can also act as if he was the sender and expect
a reply.
2. Signing Algorithms: To create a digital signature, signing algorithms like
email programs create a one-way hash of the electronic data which is to be
signed. The signing algorithm then encrypts the hash value using the private
key (signature key). This encrypted hash along with other information like the
hashing algorithm is the digital signature. This digital signature is appended
with the data and sent to the verifier. The reason for encrypting the hash
instead of the entire message or document is that a hash function converts any
arbitrary input into a much shorter fixed-length value. This saves time as now
instead of signing a long message a shorter hash value has to be signed and
moreover hashing is much faster than signing.
3. Signature Verification Algorithms : Verifier receives Digital Signature
along with the data. It then uses Verification algorithm to process on the
digital signature and the public key (verification key) and generates some
value. It also applies the same hash function on the received data and
generates a hash value. If they both are equal, then the digital signature is
valid else it is invalid.
The steps followed in creating digital signature are :
1. Message digest is computed by applying hash function on the message and
then message digest is encrypted using private key of sender to form the
digital signature. (digital signature = encryption (private key of sender,
message digest) and message digest = message digest algorithm(message)).
2. Digital signature is then transmitted with the message.(message + digital
signature is transmitted)
3. Receiver decrypts the digital signature using the public key of sender.(This
assures authenticity, as only sender has his private key so only sender can
encrypt using his private key which can thus be decrypted by sender’s public
key).
4. The receiver now has the message digest.
5. The receiver can compute the message digest from the message (actual
message is sent with the digital signature).
6. The message digest computed by receiver and the message digest (got by
decryption on digital signature) need to be same for ensuring integrity.
Message digest is computed using one-way hash function, i.e. a hash function in
which computation of hash value of a message is easy but computation of the
message from hash value of the message is very difficult.
Assurances about digital signatures
The definitions and words that follow illustrate the kind of assurances that digital
signatures offer.
1. Authenticity: The identity of the signer is verified.
2. Integration: Since the content was digitally signed, it hasn’t been altered or
interfered with.
3. Non-repudiation: demonstrates the source of the signed content to all parties.
The act of a signer denying any affiliation with the signed material is known as
repudiation.
4. Notarization: Under some conditions, a signature in a Microsoft Word,
Microsoft Excel, or Microsoft PowerPoint document that has been time-stamped
by a secure time-stamp server is equivalent to a notarization.
What is Firewall?
A firewall is a network security device, either hardware or software-based, which
monitors all incoming and outgoing traffic and based on a defined set of security
rules accepts, rejects, or drops that specific traffic.
Accept: allow the traffic
Reject: block the traffic but reply with an “unreachable error”
Drop : block the traffic with no reply
A firewall is a type of network security device that filters incoming and outgoing
network traffic with security policies that have previously been set up inside an
organization. A firewall is essentially the wall that separates a private internal
network from the open Internet at its very basic level.
Working of Firewall
Firewall match the network traffic against the rule set defined in its table. Once
the rule is matched, associate action is applied to the network traffic.
For example, Rules are defined as any employee from Human Resources
department cannot access the data from code server and at the same time another
rule is defined like system administrator can access the data from both Human
Resource and technical department.
Rules can be defined on the firewall based on the necessity and security policies
of the organization. From the perspective of a server, network traffic can be either
outgoing or incoming.
Firewall maintains a distinct set of rules for both the cases. Mostly the outgoing
traffic, originated from the server itself, allowed to pass.
Still, setting a rule on outgoing traffic is always better in order to achieve more
security and prevent unwanted communication.
Incoming traffic is treated differently. Most traffic which reaches on the firewall
is one of these three major Transport Layer protocols- TCP, UDP or ICMP.
All these types have a source address and destination address. Also, TCP and
UDP have port numbers. ICMP uses type code instead of port number which
identifies purpose of that packet.
It works in the network layer of the OSI Model. It applies a set of rules (based on
the contents of IP and transport header fields) on each packet and based on the
outcome, decides to either forward or discard the packet.
Packet filter firewall controls access to packets on the basis of packet source and
destination address or specific transport protocol type. It is done at the OSI
(Open Systems Interconnection) data link, network, and transport layers. Packet
filter firewall works on the network layer of the OSI model.
Packet filters consider only the most basic attributes of each packet, and they
don’t need to remember anything about the traffic since each packet is examined
in isolation. For this reason, they can decide packet flow very quickly.
Example: Filter can be set to block all UDP segments and all Telnet connections.
This type of configuration prevents outsiders from logging onto internal hosts
using Telnet and insider from logging onto external hosts using Telnet
connections.
Types of Packet Filtering Firewalls
Dynamic packet filtering firewalls are adaptive and can modify rules based on
network traffic conditions. They allow for a more flexible approach to network
security. Dynamic packet filtering firewalls can be useful for handling transfer
protocols that allocate ports dynamically. Dynamic packet filtering firewalls are
beneficial because they can open and close ports as needed, which enhances
security without sacrificing the functionality of applications like FTP.
Stateless packet filtering firewalls evaluate each packet in isolation without considering
previous or future packets. They rely on predetermined rules to manage network access,
offering a fast and lightweight solution. However, the lack of contextual understanding
can make stateless firewalls less secure, as they cannot detect patterns in malicious traffic
that could indicate a sophisticated attack.
Stateful packet filtering firewalls maintain a record of active connections and make
decisions based on the state of network traffic. This means they can identify and
allow packets that are part of an established connection, which increases security
by preventing unauthorized access that a stateless system might not detect. Stateful
firewalls provide a higher level of security.