Cyber Security
Network
Network
A computer network is a group of two or more computers and devices connected together to share resources (like files, printers), exchange data, and communicate with each other.
LAN (Local Area Network)
WAN (Wide Area Network)
Hub
Switch
Router (Wire/Wireless): Distribute traffic
Firewall: Prevent/secure communication
Server: avail services to users
Endpoints: All devices connected to the network
Active
Dos
DDoS
Oversized packet attacks
Spoofing
MITM
Passive
Message pass through 7 layers, from request to response:
7️⃣ Application
Closest to the user; interfaces apps with network
Web browsers, Email clients, FTP apps
Postman, Wireshark (analyze HTTP/SMTP)
6️⃣ Presentation
Data translation, encryption, compression
SSL/TLS, JPEG, MP4
OpenSSL (for encryption), Wireshark
5️⃣ Session
Manages sessions & connections between devices
Remote desktop, NetBIOS, RPC
Wireshark, Netstat
4️⃣ Transport
End-to-end delivery, error checking, flow control
TCP, UDP
Netcat, Wireshark (to view TCP/UDP), iperf
3️⃣ Network
Logical addressing & routing
IP, ICMP, routing protocols
traceroute, ping, Wireshark
2️⃣ Data Link
Physical addressing, error detection on link
Ethernet, MAC, ARP
ARP command, ifconfig, Wireshark
1️⃣ Physical
Transmits raw bits over the medium
Cables, radio signals
Cable testers, oscilloscope
Hacker intercepts traffic between you and the server.
Common on public Wi-Fi.
Can read unencrypted data (non-HTTPS).
Tools: Wireshark, mitmproxy, Ettercap
Resolutions: JWT token/Encryption/Obfuscation
Monitors local network traffic (LAN/Wi-Fi).
Can capture data if not encrypted.
Tools: tcpdump, Wireshark.
Resolutions: JWT token/Encryption/Obfuscation
Malware logs traffic or data before it's encrypted.
Can steal session tokens, passwords, or cookies.
Resolution: OS upgrade patches/AntiVirus/Limit access/Block USB/Training awareness
Downgrades HTTPS to HTTP.
Hacker sees data in cleartext.
Tool: sslstrip.
Resolution: Disable HTTP, use HSTS, Enable TLS 1.2
Redirects your traffic to a fake server.
Can capture login credentials or sensitive data.
Some extensions or spyware log traffic or user input.
Always use HTTPS (look for 🔒).
Use VPN on public networks.
Enable HSTS, CSP headers on websites.
Keep antivirus and system updated.
Enable HSTS (HTTP Strict Transport Security) at all layers: Strict-Transport-Security
Enable TLS 1.2 or higher, in order to secure connection
Enable WAF services(Web application firewall) that to prevent overengineering the solution by security aspects, as it applies machine learning mechanisms for anomaly detection, and OWASP best practices.
Definition
(Web Application Firewall) is a specialized security solution that monitors, filters, and blocks HTTP/HTTPS traffic to and from a web application, protecting it from various attacks.
How does It Increase Security?
🔍 Traffic Inspection
⛔ Automatic Blocking
🔧 Custom Rules
🧠 Machine Learning (some WAFs)
Vulnerabilities
SQL Injection
Cross-Site Scripting (XSS)
File Inclusion (LFI/RFI)
Command Injection
CSRF (Cross-Site Request Forgery)
Popular Solutions:
Commercial: AWS WAF, Azure WAF, Cloudflare, Imperva, F5
Open Source: ModSecurity (Apache/Nginx), NAXSI
Implementation Guidelines
WAF complements but does not replace secure coding.
It’s strongest against input-based attacks (e.g., injections).
Less effective against logic-based or role-based vulnerabilities.
Definition
A mechanism used in software systems to control the number of requests or actions a client can make to a server or API within a specified time window. It ensures system stability, prevents abuse, and ensures fair resource distribution.
Advantages
Prevents Overloading
Improves Security DDoS and prevents injection retrials
Ensure fair Usage
Protects Backend Services
Prevent Brute Force Attacks
Prevent Web Scraping & Data Harvesting
Prevent Account Takeover (ATO)
Implementation Strategies
Token Bucket Algorithm: Allows a fixed number of tokens (requests) per time period.
Leaky Bucket Algorithm: Processes requests at a constant rate regardless of bursts, ensuring smooth traffic flow.
Fixed Window: Limits requests within a fixed time window (e.g., 100 requests per minute).
Sliding Window: Maintains a rolling time window for request counting, offering better accuracy than fixed windows.
Quota-Based Limits: Allocates a set number of requests per day, week, or month.
IP-Based Rate Limiting: Limits requests based on the user's IP address.
User-Specific Limits: Sets personalized limits based on user accounts or API keys.
Define strict ingress/egress policies
Use a service mesh (Istio, Linkerd) with strict policies.
Configure firewalls at every layer
Minimize attack surface with subnetting
Enforce TLS 1.3 everywhere.
Harden DNS (DNSSEC, internal DNS)
Organizational Policy : High-level rules (e.g., no USB use, MFA mandatory)
System Policy: How systems are configured securely
Access Control Policy: Who can access what and how
Incident Response: How to handle breaches or suspicious activity
Network Security: Firewalls, IDS, segmentation rules
A reverse proxy is a server that sits between clients and backend servers. It accepts client requests, forwards them to one or more backend servers, and then returns the server’s response to the client — all while hiding the identity and structure of the backend servers.
How it enhances security
Hides backend infrastructure — attackers see only the reverse proxy’s IP and not the real servers.
Acts as a gatekeeper — can filter, block, or sanitize malicious traffic before it reaches the backend.
DDoS mitigation — absorbs or limits excessive requests.
TLS/SSL termination — ensures secure encrypted connections and relieves backend servers from handling encryption.
Integrates with WAFs & IDS/IPS — to detect and block known attacks like SQL injection, XSS, etc.
Rate limiting & access control — to prevent abuse and unauthorized access.
NATting = Network Address Translation — a networking process where a router or firewall modifies IP addresses in packet headers as traffic passes between networks.
Purpose:
IP conservation: Multiple private IPs share a single public IP.
Security: Hides internal IP structure from the internet.
Routing flexibility: Allows internal address changes without affecting external communication.
Types:
Static NAT – 1-to-1 mapping between a private IP and a public IP.
Dynamic NAT – Private IPs mapped to available public IPs from a pool.
PAT (Port Address Translation) / Overloading – Many private IPs share a single public IP using different port numbers.
Example:
Your laptop (192.168.1.10) sends a request to Google → router changes it to public IP (e.g., 203.0.113.5) → Google replies → router maps it back to your laptop.
how it can route to internal multiple different IPs
It routes to multiple internal IPs using PAT (Port Address Translation) or port-forwarding rules.
How it works:
NAT device keeps a translation table mapping:
(Public IP, Port) → (Internal IP, Port)
When packets arrive from the internet, the router checks the destination port and forwards them to the correct internal IP.
Example:
Public IP: 203.0.113.5
Internal Mapping for public ports:
80 192.168.1.10:80 Web Server 1
8080 192.168.1.20:80 Web Server 2
22 192.168.1.30:22 SSH Server
Like ZenMap & NMap
Tradditional Vs Next generation
Full inspection approach
FWAAS: Firewall as a service
TLS (Transport Layer Security) is the modernization of SSL (Secure Sockets Layer).
TLS is the replacement of SSL, but people still use the SSL as a name for the certificate, while it's TLS certificate.
We are now buying TLS certificates for it's benefits, not SSL one.
Here is the difference between them:
🎯 Purpose
SSL: Encrypts communication over networks
TLS: Same purpose — improved & more secure
📅 Age
SSL: Older (SSL 2.0: 1995, SSL 3.0: 1996)
TLS: Newer (TLS 1.0: 1999, TLS 1.3: 2018)
🔒 Security
SSL: Weaker, now considered insecure
TLS: Stronger, supports modern ciphers
🛠️ Cryptography
SSL: Outdated algorithms (e.g., RC4)
TLS: Supports AES, ECC, Perfect Forward Secrecy
🌐 Usage Today
SSL: Deprecated — browsers block it
TLS: TLS (1.2, 1.3) is the standard today
On-Prim (Enterprise data center)
🎯 Owned & operated by the organization
📍 Located on-site or dedicated building
💻 Full control, high CapEx
📋 Example: Banks, governments
Cloud
🎯 Massive, distributed facilities operated by cloud providers
📍 You rent virtual resources, not physical space
🌐 Scalable, OPEX-based
📋 Example: AWS, Azure, Google Cloud
Availability zones and regions
Hybrid
Dr. Ghoniem Lawaty
Tech Evangelist @TechHuB Egypt