MODULE 4
Web security considerations, Secure Socket Layer and Transport
Layer Security, HTTPS, Secure Shell (SSH). Wireless Network
Security: Wireless Security, Mobile Device Security, IEEE 802.11
Wireless LAN, IEEE 802.11i Wireless LAN Security.
Web security considerations:
Web security is crucial to protecting websites, users, and data from unauthorized access,
misuse, and attacks. Here are key web security considerations to keep in mind:
1. Authentication and Access Control
Strong password policies (length, complexity, expiration).
Multi-Factor Authentication (MFA) to reduce risk of credential theft.
Role-Based Access Control (RBAC) to ensure users access only what they’re
authorized for.
2. Data Encryption
HTTPS using TLS to encrypt data in transit.
Encryption at rest for sensitive information stored in databases.
Proper certificate management to avoid expired or misconfigured SSL certificates.
3. Input Validation and Output Encoding
Sanitize user inputs to prevent injection attacks (e.g., SQL, XSS).
Encode output to prevent cross-site scripting (XSS).
Use parameterized queries to prevent SQL injection.
4. Session Management
Use secure cookies (HttpOnly, Secure, SameSite).
Session expiration and logout functionality.
Protect against session fixation and session hijacking.
5. Secure Configuration
Disable unused services, features, and default accounts.
Use secure headers (e.g., Content-Security-Policy, X-Frame-Options, Strict-
Transport-Security).
Regularly patch and update web servers, frameworks, and libraries.
6. Error Handling and Logging
Avoid exposing stack traces or internal errors to users.
Log security-relevant events securely and monitor logs for anomalies.
7. Cross-Site Request Forgery (CSRF) Protection
Use anti-CSRF tokens.
Set SameSite cookie attributes appropriately.
8. Content Security Policy (CSP)
Define trusted sources for content to mitigate XSS and data injection.
9. Rate Limiting and Throttling
Protect against brute force and denial-of-service (DoS) attacks.
Use CAPTCHAs for suspicious or high-risk actions.
10. Security Testing and Auditing
Regular penetration testing and vulnerability scanning.
Use automated security tools (e.g., OWASP ZAP, Snyk).
Perform code reviews with a focus on security.
Secure Socket Layer and Transport Layer Security:
Secure Socket Layer (SSL) and Transport Layer Security (TLS) are cryptographic protocols designed to
provide secure communication over a network, especially the internet. Here's a breakdown of both
and how they relate:
What Is SSL?
What is SSL (Secure Sockets Layer)?
SSL is a deprecated cryptographic protocol that was originally developed by Netscape
in the 1990s to provide secure communication over the internet. It laid the groundwork
for TLS (TraPurpose of SSL
SSL was designed to:
1. Encrypt data sent over the internet.
2. Authenticate the identity of websites.
3. Ensure data integrity, making sure that information wasn't tampered with in transit.
nsport Layer Security), which has replaced SSL due to its improved security.
What Is TLS?
TLS (Transport Layer Security) is a cryptographic protocol designed to provide
secure communication over a computer network. It's the successor to SSL
(Secure Sockets Layer) and is widely What TLS Does
TLS ensures three key aspects of communication:
1. Confidentiality: Data is encrypted so that only the intended recipient can read it.
2. Integrity: Ensures the data hasn’t been altered in transit (uses message authentication
codes).
3. Authentication: Verifies the identity of one or both parties (commonly the server,
using digital certificates).
Where TLS Is Used
Web traffic: Secures HTTPS websites (the “S” in HTTPS means TLS).
Email protocols: Secures SMTP, IMAP, POP3.
VPNs and VoIP: Protects data flow.
APIs: Used in REST, GraphQL, and other secure data exchanges.
How TLS Works (Simplified)
1. Handshake:
o Client and server agree on a TLS version and cipher suite.
o Server sends a digital certificate to prove its identity.
o A secure session key is generated using public-key cryptography.
2. Session Encryption:
o After the handshake, both sides use symmetric encryption with the shared
session key to encrypt and decrypt data efficiently.
3. Data Integrity Checks:
Each message is verified to ensure it wasn’t altered during transit.
sed to protect data transmitted across the internet.
Key Features of TLS (and SSL):
1. Encryption: Protects data in transit from eavesdropping.
2. Authentication: Uses digital certificates (e.g., X.509) to verify server (and optionally
client) identity.
3. Integrity: Ensures data hasn’t been tampered with via MAC (Message Authentication
Codes).
Key Exchange: Typically uses asymmetric encryption (e.g., RSA, Diffie-Hellman) TLS
in Practice
Commonly used in HTTPS: the "S" in HTTPS means TLS is in use.
TLS is also used in securing email protocols (SMTP, IMAP, POP3), VPNs, VoIP,
etc.
Modern browsers and servers negotiate the highest TLS version supported on both
ends during a handshake.
4. for establishing secure session keys.
SSL vs. TLS
Feature SSL TLS
Status Obsolete Actively used (TLS 1.2, 1.3)
Security Vulnerable to modern attacks Strong encryption and algorithms
Performance Slower Faster (especially TLS 1.3)
What is HTTPS?
HTTPS (HyperText Transfer Protocol Secure) is the secure version of HTTP, the
foundational protocol used to transmit data between your web browser and websites.
It combines HTTP with TLS (formerly SSL) to encrypt the data being transferred,
ensuring:
🔒 Confidentiality – No one can eavesdrop on the data.
✅ Integrity – Data isn't altered during transmission.
🔒 Authentication – Confirms that you're connected to the legitimate website.
How HTTPS Works
1. Browser connects to the server over port 443 (instead of port 80 for HTTP).
2. TLS Handshake takes place:
o The server sends its digital certificate (proving identity).
o A secure session key is negotiated.
3. Encrypted communication begins using that session key.
Benefits of HTTPS
Benefit Description
🔒 Encryption Protects sensitive user data like passwords, credit cards, etc.
🔒 Authentication Uses certificates to confirm the server’s identity.
🔒 Integrity Ensures data isn’t modified in transit.
🔒 SEO Advantage Google gives ranking boosts to HTTPS sites.
🔒 Trust Signals Browser padlock icon or “Secure” label improves user trust.
HTTPS vs HTTP
Feature HTTP HTTPS
Encryption ❌ No ✅Yes
Port 80 443
Secure ❌No ✅ Yes
Certificate Not needed TLS certificate required
How to Implement HTTPS
1. Obtain a TLS Certificate:
o From trusted Certificate Authorities (CAs) like Let's Encrypt (free), DigiCert,
etc.
2. Install the certificate on your web server.
3. Redirect all HTTP traffic to HTTPS.
4. Enable HSTS (HTTP Strict Transport Security) for additional protection.
What is Secure Shell (SSH)?
SSH (Secure Shell) is a cryptographic network protocol used to securely access and
manage remote computers over an unsecured network.
It provides:
🔒 Encrypted communication
🔒🔒 Secure remote login
🔒 File transfer (via SCP/SFTP)
🔒 Command execution and tunneling
🔐 Core Features of SSH
Feature Description
Encryption Encrypts all data (commands, output, file transfers).
Authentication Supports password-based or public key authentication.
Port forwarding Securely tunnels other protocols through SSH.
Remote management Allows secure access to remote servers and devices.
🔐 How SSH Works (Basic Flow)
1. Client initiates a connection to the SSH server (default port: 22).
2. Server sends its public key to the client.
3. Client verifies the server's identity (optionally, via known hosts).
4. User authenticates using:
o Password, or
o SSH Key pair (preferred method: public/private keys)
5. Once authenticated, a secure session is established.
🔐 Authentication Methods
Password authentication: Simple but less secure.
Public key authentication: Involves a private key (on the client) and a public key (on
the server). Stronger and automated-friendly.
Multi-factor authentication (MFA): Adds an extra security layer (e.g., TOTP,
hardware tokens).
🔐 Common Uses of SSH
Remote server administration (e.g., Linux servers).
Automated backups and scripts.
Git operations over SSH (for private repositories).
Secure file transfers using:
o scp (Secure Copy)
o sftp (SSH File Transfer Protocol)
SSH Tunneling: Securing traffic (e.g., MySQL, HTTP) over SSH.
🔐 Best Practices for SSH Security
Use key-based authentication instead of passwords.
Disable root login over SSH (PermitRootLogin no).
Change the default port (22) to a non-standard one.
Use firewalls and fail2ban to limit brute-force attacks.
Regularly rotate keys and audit access.
Wireless Network Security:
Wireless Network Security
Wireless network security involves protecting wireless (Wi-Fi) networks from unauthorized access,
data theft, and cyberattacks. Because Wi-Fi transmits data over radio waves, it's inherently more
vulnerable than wired networks.
🔐 Key Wireless Security Risks
Eavesdropping: Attackers can intercept unencrypted data.
Rogue Access Points: Fake Wi-Fi hotspots used to steal data.
Man-in-the-Middle (MITM) Attacks: Intercepting and altering communication.
Unauthorized Access: Attackers connect to the network and launch attacks from within.
✅ Best Practices for Wireless Network Security
1. Use Strong Wi-Fi Encryption
Encryption Type Status Notes
WEP ❌ Insecure Easily cracked, avoid using
WPA ❌Weak Better than WEP, but still flawed
WPA2-AES ✅ Recommended Strong and widely supported
WPA3 ✅ Best Strongest current standard (if supported)
Avoid "WPA2-TKIP" as it’s considered less secure than WPA2-AES.
2. Change Default Settings
Change default SSID (network name) and avoid using personal information.
Change default router/admin passwords immediately.
3. Use a Strong Pre-Shared Key (Wi-Fi Password)
Minimum 12–16 characters, with a mix of letters, numbers, and symbols.
Avoid common or dictionary-based words.
4. Disable WPS (Wi-Fi Protected Setup)
WPS is convenient but vulnerable to brute-force attacks.
5. Enable Network Firewall and Intrusion Detection
Use router firewalls and enable built-in protections like SPI (Stateful Packet Inspection).
Consider using IDS/IPS on enterprise networks.
6. Segment Your Network
Use guest networks for visitors.
Isolate IoT devices from the main network (e.g., smart TVs, security cams).
7. Keep Firmware Updated
Regularly update router firmware to patch vulnerabilities.
8. Monitor for Unauthorized Devices
Use the router’s admin panel or a network monitoring tool to track connected devices.
9. Limit Signal Range
Reduce Wi-Fi broadcast strength if possible to avoid leaking outside physical boundaries.
Consider using directional antennas or shielding for sensitive areas.
10. Use VPN Over Wi-Fi
Especially on public Wi-Fi, use a VPN to encrypt internet traffic end-to-end.
Wireless Security: Overview
Wireless security refers to the set of protections and practices used to secure wireless
networks and communication against unauthorized access, data interception, and
cyberattacks.
Because wireless networks transmit data over open airwaves, they're inherently more
vulnerable than wired networks and require specific safeguards.
🔐 Goals of Wireless Security
1. Confidentiality: Prevent unauthorized access to data.
2. Integrity: Ensure data is not modified in transit.
3. Availability: Ensure the network remains usable and reliable.
4. Authentication: Confirm that users and devices are legitimate.
🔐 Types of Wireless Security Protocols
Security
Protocol Status Notes
Level
WEP (Wired
Obsolete ❌ Very Weak Easily broken, should not be used.
Equivalent Privacy)
Security
Protocol Status Notes
Level
WPA (Wi-Fi Deprecated
Weak Better than WEP, but still crackable.
Protected Access) ❌
Secure if using AES encryption, widely
WPA2 (AES) Standard ✅ Strong
used.
Latest standard, includes protections
WPA3 Current ✅ Very Strong
against offline password guessing.
🔐 Common Wireless Security Threats
Eavesdropping (Sniffing): Attackers intercept data over the air.
Man-in-the-Middle (MITM): Traffic is intercepted and altered.
Rogue Access Points: Fake Wi-Fi networks that trick users into connecting.
Evil Twin Attacks: Cloned access point that mimics a legitimate one.
DoS Attacks: Disrupting wireless signal or access with jamming.
✅ Best Practices for Wireless Security
1. Use WPA3 or WPA2-AES encryption.
2. Set a strong Wi-Fi password (avoid default or weak ones).
3. Disable WPS (Wi-Fi Protected Setup) – vulnerable to brute-force attacks.
4. Change default SSIDs and admin passwords.
5. Enable MAC address filtering (limited benefit but adds a layer).
6. Segment networks (e.g., create guest networks).
7. Update router firmware regularly to patch vulnerabilities.
8. Turn off Wi-Fi when not in use (for sensitive environments).
9. Monitor connected devices via your router’s dashboard.
10. Use VPNs on public Wi-Fi networks for added encryption.
Mobile Device Security
Mobile device security refers to the strategies, technologies, and best practices used to protect
smartphones, tablets, and other portable devices from threats like malware, data theft, and
unauthorized access.
With the increasing use of mobile devices for personal, business, and financial activities, securing
them is critical.
🔐 Key Objectives of Mobile Device Security
1. Confidentiality – Keep personal and business data private.
2. Integrity – Prevent tampering with apps, OS, or files.
3. Availability – Ensure the device remains usable and responsive.
4. Authentication – Prevent unauthorized access to the device or its data.
🔐 Common Mobile Security Threats
Threat Description
Malware Malicious apps that steal data or control devices.
Phishing Fake emails or messages tricking users into sharing sensitive info.
Device Loss/Theft Physical loss of the device leading to potential data exposure.
Insecure Wi-Fi Eavesdropping on data over untrusted public networks.
App-based threats Apps requesting excessive or unnecessary permissions.
Outdated OS or Apps Vulnerabilities in older software versions.
✅ Mobile Security Best Practices
🔑 1. Device Access Protection
Use strong PINs, passwords, or biometric authentication (fingerprint, face ID).
Enable auto-lock and screen timeout features.
Enable remote wipe in case of loss or theft (e.g., Find My iPhone, Android Device Manager).
🔑 2. App and OS Management
Only install apps from trusted sources (App Store, Google Play).
Review app permissions and deny unnecessary access (e.g., location, mic, contacts).
Keep your OS and apps updated to patch known vulnerabilities.
Avoid jailbreaking or rooting, which bypass built-in security mechanisms.
🔑 3. Secure Network Use
Use VPNs on public Wi-Fi.
Avoid accessing sensitive services (banking, emails) on untrusted networks.
Disable auto-connect to Wi-Fi or Bluetooth when not needed.
🔑 4. Data Encryption and Backup
Enable device encryption (often default in modern iOS and Android).
Regularly backup data to secure cloud or local storage.
Use end-to-end encrypted apps for messaging (e.g., Signal, WhatsApp).
🔑 5. Mobile Device Management (MDM) (for enterprises)
Centralized control of device policies, app installations, and data security.
Can enforce encryption, remotely wipe data, and restrict risky apps or content.
🔐 Mobile Security Tools
Antivirus & anti-malware apps (e.g., Bitdefender, Norton).
Secure messaging apps (e.g., Signal).
Password managers (e.g., Bitwarden, 1Password).
Authenticator apps (e.g., Google Authenticator, Authy) for 2FA.
IEEE 802.11 Wireless LAN
IEEE 802.11 is a set of standards developed by the Institute of Electrical and Electronics
Engineers (IEEE) that defines the protocols for implementing wireless local area networks
(WLANs) — commonly known as Wi-Fi.
These standards cover how data is transmitted over the air, including frequency,
modulation, data rates, and security.
🔐 Key IEEE 802.11 Standards
Frequency
Standard Max Speed Range Year Notes
Band
802.11 2.4 GHz 2 Mbps Short 1997 Original standard (obsolete)
Better range, vulnerable to
802.11b 2.4 GHz 11 Mbps Medium 1999
interference
802.11a 5 GHz 54 Mbps Shorter 1999 Less interference, less range
802.11g 2.4 GHz 54 Mbps Medium 2003 Combines b and a benefits
MIMO support, good
802.11n 2.4 / 5 GHz 600 Mbps Wider 2009
performance
Up to 1.3
802.11ac 5 GHz Medium 2013 Higher speed, beamforming
Gbps+
Up to 10 Very
802.11ax 2.4 / 5 / 6 GHz 2019 Also called Wi-Fi 6/6E
Gbps good
>30 Gbps
802.11be 6 GHz+ TBD Upcoming Known as Wi-Fi 7
(est.)
🔐 Main Features of IEEE 802.11 Standards
Media Access Control (MAC): Uses CSMA/CA (Carrier Sense Multiple Access
with Collision Avoidance) to avoid collisions.
Authentication and Encryption:
o Supports WEP, WPA, WPA2, and WPA3.
Modulation Techniques:
o OFDM (Orthogonal Frequency-Division Multiplexing)
o QAM (Quadrature Amplitude Modulation)
🔐 Frequency Bands in IEEE 802.11
Band Used By Pros Cons
2.4 Longer range, wall
802.11b/g/n/ax Crowded, slower speeds
GHz penetration
Higher speed, less
5 GHz 802.11a/n/ac/ax Shorter range
interference
802.11ax (Wi-Fi 6E), Only new devices
6 GHz High speed, new spectrum
802.11be support it
🔐 Security in 802.11
WEP – Weak and deprecated.
WPA/WPA2 – Stronger encryption with TKIP or AES.
WPA3 – Latest standard, better protection against brute-force attacks.
🔐 Enterprise vs Home Use
802.11i (WPA2-Enterprise) supports 802.1X authentication for enterprise networks.
QoS (802.11e): Prioritizes traffic for voice/video (used in VoIP, streaming).
Roaming support: Fast transitions between APs in larger environments.
IEEE 802.11i – Wireless LAN Security Standard
IEEE 802.11i is a key amendment to the original 802.11 standard that enhances wireless
LAN security, addressing the weaknesses in the older WEP (Wired Equivalent Privacy)
protocol.
It forms the foundation of WPA2 (Wi-Fi Protected Access II) — the industry standard for
Wi-Fi security.
🔐 Background and Purpose
Published in 2004, IEEE 802.11i was developed in response to the severe
vulnerabilities found in WEP.
It introduced robust encryption and authentication mechanisms for Wi-Fi
networks.
🔐 Core Components of 802.11i
Component Description
RSN (Robust Security Framework introduced by 802.11i for secure wireless
Network) communication.
Mandatory encryption method replacing WEP/TKIP; uses AES
AES-CCMP
in Counter Mode with CBC-MAC for strong data protection.
Provides centralized authentication using a RADIUS server,
802.1X Authentication
often used in enterprise networks.
EAP (Extensible Supports multiple authentication methods (e.g., certificates,
Authentication Protocol) smart cards, tokens).
Protocol used to confirm that both the client and access point
4-Way Handshake
possess the correct credentials and to generate encryption keys.
Used for securely distributing group keys for
Group Key Handshake
multicast/broadcast traffic.
🔐 WPA2 and WPA2-Enterprise
IEEE 802.11i is the basis for:
WPA2-Personal: Uses a pre-shared key (PSK) for small networks.
WPA2-Enterprise: Uses 802.1X and a RADIUS server for user-level authentication
— more secure and scalable.
🔐 Encryption Comparison
Algorithm Used In Strength Status
Original
WEP Weak Deprecated
802.11
Medium (legacy
TKIP WPA Obsolete
support)
802.11i
AES-CCMP Strong Recommended
(WPA2)
GCMP (Galois/Counter Mode
WPA3 Strongest Modern
Protocol)
🔐 802.11i Security Workflow (Simplified)
1. User/Device Association → Connect to AP.
2. Authentication via 802.1X (EAP over LAN) or PSK.
3. 4-Way Handshake → Exchange nonces, derive PTK (Pairwise Transient Key).
4. Secure Key Distribution → Group keys for broadcast/multicast.
5. Encrypted Communication begins using AES-CCMP.
🔐 Benefits of IEEE 802.11i
Stronger data encryption (AES)
Robust mutual authentication
Resistance to MITM, replay, and brute-force attacks
Scalable to enterprise networks with centralized access control