Module 4 Notes
Module 4 Notes
Web security refers to the protection of websites, web applications, and web services from cyber threats,
unauthorized access, and data breaches. It ensures confidentiality, integrity, and availability (CIA
triad) of information.
• Occurs when attackers insert malicious SQL queries into input fields.
• Can lead to unauthorized access to databases.
• Example: Login bypass using ' OR '1'='1.
• In this type, the malicious script is permanently stored on the web server (e.g., database,
comment section, forums).
• When other users access the affected page, the script is executed in their browser.
Example:
Impact:
Example:
Impact:
• Session hijacking
• Phishing attacks
• Unauthorized actions
3. DOM-based XSS
• The vulnerability exists in the client-side code (JavaScript) rather than the server.
• The script modifies the Document Object Model (DOM) in an unsafe way.
Example:
• JavaScript reads data from URL and inserts it into the page without validation.
Impact:
e) Session Hijacking
f) Clickjacking
6. Session Management
8. Ransomware : Ransomware is a type of malware that is designed to block user access from own
system until a ransom fee is paid to ransomware creator. Ransomware is a lot dangerous than a
regular malware and spread through phishing emails having infected attachments. Ransomware has
emerged over the last few years and can attack individuals or organizations.
Secure Socket Layer (SSL) and Transport Layer Security (TLS)
1. Introduction
SSL (Secure Socket Layer) and TLS (Transport Layer Security) are cryptographic protocols used to
secure communication over a network (mainly the Internet). They provide encryption, authentication,
and data integrity between a client (browser) and a server (website).
• SSL: Older protocol (now deprecated due to security weaknesses)
• TLS: Improved and secure successor of SSL (widely used today)
2. Goals of SSL/TLS
• Confidentiality: Encrypts data so unauthorized users cannot read it
• Integrity: Ensures data is not altered during transmission
• Authentication: Verifies the identity of the server (and sometimes the client)
4. Encryption Mechanism
SSL/TLS uses two types of encryption:
a) Asymmetric Encryption
• Uses public and private keys
• Used during handshake (key exchange)
b) Symmetric Encryption
• Uses a single shared key
• Used for fast data transmission after handshake
5. Digital Certificates
• Issued by trusted organizations called Certificate Authorities (CA)
• Contains:
o Server’s public key
o Domain name
o CA signature
Examples of CAs: DigiCert and Let’s Encrypt
7. Advantages of TLS
• Strong encryption algorithms
• Protection against modern attacks
• Ensures secure online transactions
• Builds user trust (HTTPS padlock symbol)
8. Applications of SSL/TLS
• Secure websites (HTTPS)
• Online banking
• Email security (SMTP, IMAP, POP3 with TLS)
• Secure file transfer
9. Limitations
• Requires certificate management
• Slight performance overhead
• Misconfiguration can lead to vulnerabilities
10. Conclusion
SSL/TLS protocols are essential for securing communication over the Internet. While SSL is outdated,
TLS provides strong security mechanisms that protect sensitive data and ensure trust between users and
web services.
Secure Sockets Layer (SSL) is an Internet security protocol that encrypts data to ensure secure
communication between devices over a network.
• Developed by Netscape in 1995, SSL provides privacy, authentication and data integrity for
online communications.
• It is the predecessor of TLS (Transport Layer Security), which is now the standard protocol for
secure communications on the Internet.
Working of SSL
SSL ensures secure communication through three main mechanisms:
1. Encryption: Data transmitted over the network is encrypted, preventing unauthorized parties
from reading it. If intercepted, encrypted data appears as an unreadable jumble of characters.
2. Authentication: SSL uses a handshake process to authenticate both the client and server,
ensuring each party is legitimate and not an imposter.
3. Data Integrity: SSL digitally signs transmitted data to detect any tampering, ensuring that the
data received is exactly what was sent.
Importance of SSL
Before SSL, web data was transmitted in plaintext, making it vulnerable to interception. SSL solves this
by:
• Encrypting sensitive information such as login credentials, financial transactions and personal
data.
• Authenticating web servers to prevent users from connecting to fraudulent websites.
• Ensuring data integrity so transmitted information cannot be modified during transit.
Note: SSL protects against cyber threats by providing confidentiality, authentication and integrity for
online communications.
SSL Protocols
SSL consists of several protocols, each handling a different aspect of secure communication
2. Handshake Protocol
Four phases:
• Client and server exchange hello packets, protocol versions and cipher suites.
• Server sends its certificate and server key information.
• Client responds with its certificate and key exchange.
• Change Cipher Spec finalizes the handshake, activating secure communication.
• Signals that pending cryptographic parameters from the handshake should now become active.
• Consists of a single 1-byte message.
4. Alert Protocol
• Communicates SSL-related warnings or errors.
• Warning alerts (level 1): Non-critical issues, such as expired or unsupported certificates.
• Fatal alerts (level 2): Critical errors, such as handshake failures, bad record MAC or illegal
parameters, which terminate the connection.
SSL Certificates
SSL certificates are digital certificates issued by trusted Certificate Authorities (CAs) to secure and
verify websites.
Key Features
• Encryption: Protects sensitive information during transmission.
• Authentication: Confirms the identity of the website or service.
• Integrity: Ensures transmitted data is not altered.
• Non-repudiation: Prevents denial of transmitted messages.
• Public-key cryptography: Facilitates secure key exchange.
• Session management: Allows resumption of secure sessions after interruptions.
Session key is Shared Symmetric Encryption Key used in TLS sessions to encrypt data being sent back
and forth.
HTTPS stands for HyperText Transfer Protocol Secure. It is the most common protocol for sending data
between a web browser and a website. HTTPS is the secure variant of HTTP and is used to
communicate between the user's browser and the website, ensuring that data transfer is encrypted for
added security.
Working of HTTPS
HTTPS establishes the communication between the browser and the web server. It uses the Secure
Socket Layer (SSL) and Transport Layer Security (TLS) protocol for establishing communication. The
new version of SSL is TLS(Transport Layer Security).
• HTTPS uses the conventional HTTP protocol and adds a layer of SSL/TLS over it.
• The workflow of HTTP and HTTPS remains the same, the browsers and servers still
communicate with each other using the HTTP protocol.
• However, this is done over a secure SSL connection. The SSL connection is responsible for the
encryption and decryption of the data that is being exchanged to ensure data safety.
Example:
Before encryption: "This is a string of text that is completely readable"
After encryption:
"ITM0IRyiEhVpa6VnKyExMiEgNveroyWBPlgGyfkflYjDaaFf/Kn3bo3OfghBPDWo6AfSHlNtL8N7ITEwI
Xc1gU5X73xMsJormzzXlwOyrCs+9XCPk63Y+z0="
Note: HTTPS uses the following algorithms for encryption and hashing purposes:
• RSA: Used during the TLS/SSL handshake to securely exchange keys between client and server.
It’s an asymmetric encryption algorithm.
• SHA-256: Used for data integrity in digital signatures and certificates. It’s a hashing algorithm,
not for encrypting the actual traffic.
HTTP vs HTTPS
Here are some key differences between HTTP and HTTPS:
HTTP HTTPS
Secure Communication: A client and a server can communicate securely thanks to SSH. To prevent
unwanted access to the data, it encrypts all information sent over the network, including passwords,
usernames, and other private data.
Authentication: SSH offers methods for confirming the legitimacy of the client and server. To confirm
the parties’ identities, it makes use of cryptographic keys. Only authorized users and servers can access
the system thanks to this authentication procedure.
Remote Access: SSH is primarily used to enable safe remote access to computers, servers, and other
resources. With SSH, users can safely run remote commands or access a server’s command-line
interface from a distance.
File Transfer: SSH facilitates safe file transfers between computers by using programs such as Secure
Copy Program (SCP) and SSH File Transfer Protocol (SFTP). With the help of these tools, users can
safely move data between two remote servers or between a local computer and a distant server.
Tunneling: The ability to build secure channels for the transmission of other network protocols over
SSH is made possible by the functionality for tunneling provided by SSH. Services that might not be
immediately accessible via the network, such as web servers, databases, and email servers, can now be
accessed securely thanks to this capability.
The architecture of Secure Shell is client-server. A server administrator typically installs a program
on the server that controls whether incoming connections are accepted or rejected. In addition, a client
program that a user runs on their PC makes requests to the server. The server listens on HTTP port 22
by default.
SSH Commands
To securely communicate with remote servers or devices, utilize Secure Shell (SSH) commands. The
following SSH commands are frequently used:
• ssh: To establish an SSH connection with a remote server, use the ssh command. The
fundamental syntax is as follows:
ssh username@hostname
• scp: Secure file transfers between hosts are accomplished with the scp command. This represents
a “secure copy.” The fundamental syntax is as follows:
scp [Link] username@hostname:/remote/directory
• sftp: The sftp command is an interactive file transfer tool that functions similarly to FTP but
encrypts the connection using Secure Shell. Users can safely move files between hosts with its
help. To initiate an SFTP session, just enter:
sftp username@hostname
• ssh-keygen: SSH key pairs are created with the ssh-keygen command and are used for
authentication. It generates public and private keys that enable password-free remote server
authentication. The fundamental syntax is as follows:
ssh-keygen -t rsa
Secure Shell (SSH) is used to ensure safe and encrypted communication in three main areas:
• Remote Server Administration: Allows administrators to securely access and manage servers
from a distance.
• File Transfer: Enables secure file sharing using protocols like SFTP and SCP.
• Tunneling: Provides secure access to restricted services by creating encrypted network tunnels.
Wireless networks (Wi-Fi) allow devices to connect without physical cables, but this convenience
makes them more vulnerable to unauthorized access, data theft, and cyber attacks. Proper security
measures are essential to protect users and data.
c) WPA2
Introduction:
WPA2 was introduced in 2004 by the Wi-Fi Alliance as the official successor to WPA. It became the
most widely used Wi-Fi security standard for many years and is still commonly used today.
Encryption Mechanism:
WPA2 uses the AES (Advanced Encryption Standard), which is much stronger than RC4 used in
earlier protocols.
• AES provides robust encryption, widely trusted in government and enterprise systems.
• Ensures confidentiality of data transmitted over wireless networks.
CCMP Protocol:
WPA2 replaces TKIP with CCMP (Counter Mode with Cipher Block Chaining Message
Authentication Code Protocol).
• Provides data integrity and authentication
• Prevents tampering and replay attacks
• Ensures that data packets are not altered during transmission
Modes of Operation:
WPA2 supports two main modes:
• WPA2-Personal (PSK – Pre-Shared Key):
o Uses a shared password
o Suitable for home and small office networks
• WPA2-Enterprise:
o Uses centralized authentication servers such as RADIUS (Remote Authentication Dial-
In User Service)
o Provides individual user authentication
o Ideal for organizations and institutions
Security Strengths:
• Strong encryption using AES
• Secure key management and authentication
• Resistant to most common wireless attacks when configured properly
• Supports network scalability and enterprise-level security
Limitations and Vulnerabilities:
• Vulnerable to the KRACK attack discovered in 2017
o Exploits weaknesses in the handshake process
o Can allow attackers to decrypt some traffic
• Susceptible to brute-force and dictionary attacks if weak passwords are used
• Security depends on regular firmware updates and strong passwords
Performance:
• Slightly higher computational requirement than WPA, but efficient on modern devices
• Provides a good balance between security and performance
Current Status:
• Still widely used, especially where WPA3 is not yet supported
• Recommended to use WPA2 with AES (not TKIP) for better security
• Gradually being replaced by WPA3 in modern networks
Conclusion:
WPA2 offers strong, reliable wireless security and has been the backbone of Wi-Fi protection for
years. However, due to emerging threats and vulnerabilities, it is being phased out in favor of WPA3,
especially in high-security environments.
d) WPA3
Introduction:
WPA3 is the latest Wi-Fi security standard, introduced by the Wi-Fi Alliance in 2018. It is designed
to address the limitations of WPA2 and provide stronger, future-ready security for modern wireless
networks.
Authentication Mechanism (SAE):
WPA3 replaces the traditional PSK method with SAE (Simultaneous Authentication of Equals), also
known as the Dragonfly handshake.
• Protects against offline dictionary attacks
• Ensures attackers cannot guess passwords even after capturing data
• Provides mutual authentication between devices
Forward Secrecy:
• WPA3 supports forward secrecy, meaning:
o Even if a password is compromised later, previously transmitted data remains secure
• Prevents attackers from decrypting past communications
Stronger Encryption:
• Uses advanced cryptographic techniques with enhanced encryption strength
• In enterprise mode, supports 192-bit security, offering higher-level protection for sensitive
environments
Protection Against Attacks:
• Strong defense against brute-force attacks
• Limits repeated login attempts, making password guessing difficult
• Improves resistance to common Wi-Fi hacking techniques
Improved Features:
• Better protection for weak passwords: Even simple passwords are harder to crack due to SAE
• Enhanced open network security: Uses encryption in public Wi-Fi through features like
Opportunistic Wireless Encryption (OWE)
• Simplified device connection: Easier and more secure setup for IoT devices without screens
Modes of Operation:
• WPA3-Personal: Uses SAE for home users
• WPA3-Enterprise: Offers stronger authentication and higher encryption levels for
organizations
Backward Compatibility:
• Supports transition mode, allowing WPA2 and WPA3 devices to coexist
• Ensures smooth migration to newer security standards
Current Status:
• Recommended for all modern routers and devices
• Gradually replacing WPA2 as the new standard
• Required for Wi-Fi 6 and newer technologies
Conclusion:
WPA3 provides advanced security, better password protection, and improved privacy, making it
the most secure Wi-Fi protocol available today. It is highly recommended for secure and future-proof
wireless networking.
Overall Comparison Insight
• WEP → Completely insecure
• WPA → Better but outdated
• WPA2 → Strong and widely used
• WPA3 → Most secure and future-ready
Conclusion
Mobile device security involves protecting devices from digital and physical threats through safe
usage practices, strong authentication, encryption, and regular updates. Following these measures
ensures data privacy, device safety, and secure communication.
Important Components
• Station (STA): Any wireless device (mobile, laptop, etc.)
• Access Point (AP): Connects wireless devices to the network
• Basic Service Set (BSS): A group of devices communicating together
• Extended Service Set (ESS): Multiple BSS connected together for wider coverage
Limitations
• Security risks if not properly configured
• Interference from other wireless devices
• Limited range compared to wired networks
• Speed variations due to signal strength and obstacles
Conclusion
The IEEE 802.11 standard forms the backbone of modern Wi-Fi communication, enabling seamless
wireless connectivity across homes, offices, and public spaces. With continuous advancements (like Wi-
Fi 6), it offers higher speed, better efficiency, and improved security, making it essential in today’s
digital world.
IEEE 802.11i Wireless LAN Security
Introduction
The IEEE 802.11i is an amendment to the IEEE 802.11 standard, designed to enhance the security of
wireless networks. It was introduced to overcome the weaknesses of earlier security mechanisms like
WEP and forms the basis for modern Wi-Fi security, especially WPA2.
5. WPA2 Implementation
• IEEE 802.11i is the technical foundation for WPA2
• WPA2 uses:
o AES encryption
o CCMP protocol
o Secure authentication mechanisms
• Provides strong and reliable wireless security
Limitations
• Slightly higher computational overhead
• Requires modern hardware support
• Vulnerable to certain attacks (e.g., improper implementation like KRACK) if not updated
Conclusion
IEEE 802.11i significantly improves wireless LAN security by introducing strong encryption (AES),
secure authentication (802.1X), and advanced protocols (CCMP). It laid the foundation for WPA2
and remains a critical milestone in securing modern Wi-Fi networks.