Docsity

OSI LAYERS CHEAT SHEETS, Cheat Sheet of Computer science

Toggle sidebar
bg1
OSI Model & Common Protocols - Formatted Study Notes
Application
User-facing services
User data
Protocols
HTTP
HyperText Transfer Protocol — transfers web pages between clients and servers over the internet.
Port 80 (cleartext) — stateless request/response model — methods: GET, POST, PUT, DELETE, HEAD, OPTIONS
HTTPS
HTTP over TLS/SSL — encrypted variant of HTTP providing confidentiality and server authentication.
Port 443 — uses TLS 1.2/1.3 — mandatory for any sensitive web traffic
FTP / SFTP
File Transfer Protocol — transfers files between hosts. SFTP is the SSH-secured variant.
FTP: ports 20 (data) & 21 (control) — SFTP: port 22 — FTP cleartext = dangerous
SMTP
Simple Mail Transfer Protocol — sends email between mail servers and from client to server.
Port 25 (server-to-server), 587 (submission/STARTTLS), 465 (SMTPS)
IMAP / POP3
IMAP retrieves emails and keeps them on server (multi-device). POP3 downloads and deletes.
IMAP: 143 (plain), 993 (TLS) — POP3: 110 (plain), 995 (TLS)
DNS
Domain Name System — resolves domain names to IP addresses. Hierarchy: root → TLD → authoritative.
pf3
pf4
pf5
pf8
pf9
pfa

Partial preview of the text

Download OSI LAYERS CHEAT SHEETS and more Cheat Sheet Computer science in PDF only on Docsity!

OSI Model & Common Protocols - Formatted Study Notes

Application

User-facing services

User data

Protocols

HTTP

HyperText Transfer Protocol — transfers web pages between clients and servers over the internet.

Port 80 (cleartext) — stateless request/response model — methods: GET, POST, PUT, DELETE, HEAD, OPTIONS

HTTPS

HTTP over TLS/SSL — encrypted variant of HTTP providing confidentiality and server authentication.

Port 443 — uses TLS 1.2/1.3 — mandatory for any sensitive web traffic

FTP / SFTP

File Transfer Protocol — transfers files between hosts. SFTP is the SSH-secured variant.

FTP: ports 20 (data) & 21 (control) — SFTP: port 22 — FTP cleartext = dangerous

SMTP

Simple Mail Transfer Protocol — sends email between mail servers and from client to server.

Port 25 (server-to-server), 587 (submission/STARTTLS), 465 (SMTPS)

IMAP / POP

IMAP retrieves emails and keeps them on server (multi-device). POP3 downloads and deletes.

IMAP: 143 (plain), 993 (TLS) — POP3: 110 (plain), 995 (TLS)

DNS

Domain Name System — resolves domain names to IP addresses. Hierarchy: root → TLD → authoritative.

Port 53 (UDP for queries, TCP for zone transfers) — key attack vector: DNS spoofing, cache poisoning

DHCP

Dynamic Host Configuration Protocol — assigns IP addresses, subnet masks, gateway and DNS automatically.

Client port 68, Server port 67 — uses UDP broadcast — DORA process (Discover, Offer, Request, Ack)

SNMP

Simple Network Management Protocol — monitors and manages network devices (routers, switches).

Ports 161 (queries), 162 (traps) — v1/v2c use cleartext community strings — SNMPv3 adds encryption

SSH

Secure Shell — encrypted remote login and tunneling. Replaces Telnet and rsh.

Port 22 — uses asymmetric auth (RSA/ECDSA keys) or password — supports port forwarding and SCP

Telnet

Remote terminal access — cleartext. Replaced by SSH. Considered insecure.

Port 23 — no encryption whatsoever — never use in production

RDP

Remote Desktop Protocol — Microsoft's graphical remote access for Windows systems.

Port 3389 — common attack surface: brute-force, BlueKeep (CVE-2019-0708)

LDAP / LDAPS

Lightweight Directory Access Protocol — queries and manages directory services (Active Directory, OpenLDAP).

LDAP: 389 — LDAPS (TLS): 636 — used for authentication in enterprise environments

What to know for the exam

Memorise all port numbers — they are heavily tested.

HTTP vs HTTPS: HTTP = port 80, no encryption. HTTPS = port 443, TLS.

FTP: two ports — 20 (data), 21 (control). SFTP is NOT FTP over SSL — it is a completely different protocol over SSH (port 22).

SMTP ports: 25 = server-to-server (often blocked by ISPs), 587 = client submission with STARTTLS, 465 = SMTPS (TLS from the start).

JPEG / PNG / GIF

Image compression formats — handled at the presentation layer when data is prepared for the application.

Lossy (JPEG) vs lossless (PNG). Steganography uses image files to hide data — a cybersecurity topic

What to know for the exam

The presentation layer is often the least-tested layer but TLS/SSL is critical for the cybersecurity exam.

TLS 1.3 key facts: 1-RTT handshake (vs 2-RTT in 1.2), removed weak cipher suites (RC4, MD5, SHA-1 key exchange, RSA key transport), supports 0-RTT resumption.

SSL vs TLS: SSL is deprecated and broken. POODLE attack exploited SSLv3 padding. TLS 1.0 and 1.1 are also deprecated.

TLS handshake order: ClientHello → ServerHello + Certificate → Key Exchange (ECDHE) → Finished (both sides). Know this sequence.

Cipher suite format: TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 — Key exchange _ Authentication _ Encryption _ Hash.

Steganography operates at this layer — hiding data inside image/audio files. Relevant for covert channel and data exfiltration questions.

Session

Manages sessions and dialogues

Sessions

Protocols

NetBIOS

Network Basic Input/Output System — provides session layer services for Windows file sharing and name resolution on LANs.

Ports 137 (name), 138 (datagram), 139 (session) — superseded by DNS but still present in Windows environments

RPC

Remote Procedure Call — allows a program to request a service from another program on a remote machine.

Dynamic ports (assigned by portmapper/epmap — port 135 on Windows) — used by Windows services and Active Directory

PPTP

Point-to-Point Tunnelling Protocol — creates VPN tunnels. Considered weak and deprecated.

Port 1723 — MS-CHAPv2 authentication is crackable — replaced by L2TP/IPsec, OpenVPN, WireGuard

SIP

Session Initiation Protocol — sets up, manages and tears down VoIP (voice/video) sessions.

Port 5060 (UDP/TCP plain), 5061 (TLS) — used in VoIP systems — vulnerable to eavesdropping if not using SRTP

H.

ITU standard for VoIP and video conferencing session management. Older alternative to SIP.

Port 1720 — complex protocol stack — largely replaced by SIP

NFS

Network File System — allows remote file access as if local. Session layer manages state.

Port 2049 — v3 lacks authentication — v4 supports Kerberos authentication and is preferred

What to know for the exam

The session layer is conceptually important but lighter in terms of direct protocol testing than layers 3/4/7.

NetBIOS port 139: still found in Windows environments. Know that NBT (NetBIOS over TCP/IP) uses ports 137-139.

SMB often associated here — operates over NetBIOS (port 139) or directly via port 445. EternalBlue (MS17-010) exploited SMBv1 on port 445 → WannaCry.

SIP and VoIP security: SIP calls can be intercepted without encryption. SRTP (Secure RTP) is needed for the media stream. TLS protects SIP signalling.

PPTP is weak: if asked to choose a VPN protocol, PPTP should never be the answer. Prefer IKEv2/IPsec or WireGuard.

Session hijacking is a session-layer attack concept — attacker steals a session ID (cookie) to impersonate an authenticated user.

Transport

End-to-end delivery, ports, reliability

Segments

Network

Logical addressing, routing

Packets

Protocols

IP (IPv4)

Internet Protocol v4 — provides logical addressing and routing of packets across networks. 32-bit addresses.

Classes A/B/C/D/E — subnet masks — CIDR notation — private ranges: 10.x, 172.16-31.x, 192.168.x — TTL field

IPv

128-bit successor to IPv4 — eliminates NAT need, built-in IPsec support, stateless address autoconfiguration (SLAAC).

128-bit hex addresses — link-local fe80::/10 — multicast FF::/8 — no broadcast — ICMPv6 replaces ARP

ICMP

Internet Control Message Protocol — used for diagnostics (ping = echo request/reply) and error reporting.

Not routable in all networks — type 8 = echo request, type 0 = echo reply, type 3 = destination unreachable — used in DDoS amplification and ICMP tunnelling (covert channel)

IPsec

IP Security — suite of protocols for authenticating and encrypting IP packets. Used for VPNs.

Two modes: Transport (encrypts payload only) and Tunnel (encrypts entire IP packet). Protocols: AH (authentication), ESP (encryption). IKEv2 for key exchange. Ports: UDP 500 (IKE), UDP 4500 (NAT-T)

BGP

Border Gateway Protocol — exterior routing protocol, routes traffic between autonomous systems (AS) on the internet.

TCP port 179 — path-vector protocol — BGP hijacking = attacker announces false routes to redirect traffic (major attack)

OSPF

Open Shortest Path First — interior routing protocol using link-state algorithm (Dijkstra). Used within an AS.

Protocol number 89 (not a TCP/UDP port) — areas concept — DR/BDR election — more scalable than RIP

RIP

Routing Information Protocol — simple distance-vector routing protocol. Max 15 hops (16 = unreachable).

UDP port 520 — slow convergence — vulnerable to routing loops — largely replaced by OSPF and EIGRP

NAT

Network Address Translation — maps private IP addresses to a public IP. Provides basic obscuring of internal topology.

PAT (Port Address Translation) = most common variant — does NOT provide real security — hides internal structure

What to know for the exam

IPv4 private ranges to memorise: 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16. These never route on the public internet.

IP spoofing: attacker forges the source IP address. Used in DDoS amplification (UDP), SYN flood, and MITM. Counter: ingress filtering (BCP38), Unicast Reverse Path Forwarding (uRPF).

ICMP: ping uses ICMP type 8 (request) / type 0 (reply). ICMP type 3 = destination unreachable. ICMP tunnelling hides C2 traffic inside ICMP payload.

IPsec modes: Transport = host-to-host, only payload encrypted. Tunnel = gateway-to-gateway, full packet encrypted (used for VPNs). ESP provides confidentiality. AH provides integrity only (no encryption).

BGP hijacking: a classic exam topic — attacker announces more specific routes to redirect traffic. Example: YouTube hijacking by Pakistan Telecom (2008).

TTL (Time To Live): decremented by 1 at each router hop. Reaches 0 → ICMP Time Exceeded sent back. Used by traceroute.

OSPF vs RIP: OSPF = link-state, fast convergence, no hop limit, uses Dijkstra. RIP = distance-vector, max 15 hops, slow convergence. For any modern network OSPF is preferred.

Data Link

Node-to-node delivery, MAC addresses

Frames

Protocols

ARP poisoning: attacker broadcasts fake ARP replies associating their MAC with the gateway's IP → all traffic flows through attacker → MITM. Counter: Dynamic ARP Inspection (DAI) on managed switches.

MAC address structure: OUI (3 bytes, identifies vendor) + NIC-specific (3 bytes). MAC spoofing = changing your MAC address — trivially done on most OSes.

VLAN hopping: double-tagging attack — attacker on native VLAN sends frame with two 802.1Q tags; switch strips outer tag, forwards frame to target VLAN. Counter: never use VLAN 1 as native VLAN, disable unused ports, use dedicated native VLAN.

WEP is completely broken (RC4 keystream reuse). WPA2 uses AES-CCMP (strong). WPA3 uses SAE (Dragonfly handshake, resistant to offline dictionary attacks).

Deauthentication attack (Wi-Fi): attacker sends spoofed deauth frames to disconnect clients (used to force WPA2 handshake capture for offline cracking). WPA3 / 802.11w (Management Frame Protection) addresses this.

STP root bridge attack: attacker with lowest bridge priority becomes root bridge → all traffic flows through attacker. Counter: BPDUGuard, PortFast, Root Guard on access ports.

Ethernet vs Wi-Fi: Ethernet = CSMA/CD (wired). Wi-Fi = CSMA/CA (wireless, avoid collisions rather than detect).

Physical

Bits over physical medium

Bits

Protocols

Ethernet physical (10BASE-T, 100BASE-TX…)

Defines electrical/optical signalling for Ethernet over copper (UTP) or fibre. Specifies cables, connectors, speed.

Cat5e: up to 1 Gbps — Cat6: up to 10 Gbps (55 m) — RJ-45 connector — 100 Mbps (Fast Ethernet), 1 Gbps (Gigabit), 10 Gbps

RS-232 / RS-

Serial communication standards for point-to-point (RS-232) or multi-drop (RS-485) physical connections.

RS-232: DB-9 connector, up to 15 m — RS-485: differential signalling, up to 1200 m — used in industrial SCADA systems

USB

Universal Serial Bus — common physical interface for peripherals and serial communication at short range.

USB 2.0: 480 Mbps — USB 3.x: up to 20 Gbps — USB attacks: BadUSB (HID injection), juice-jacking (charging ports)

Bluetooth (IEEE 802.15.1)

Short-range wireless physical protocol (2.4 GHz ISM band). Uses frequency-hopping spread spectrum.

Range: Class 1 = 100 m, Class 2 = 10 m — BLE (Low Energy) for IoT — attacks: Bluejacking, Bluesnarfing, BIAS

Fibre optic

Transmits data as light pulses. Immune to electromagnetic interference. Used for high-speed backbone links.

Single-mode: long distance (up to 100 km). Multi-mode: shorter distance (up to 2 km). Difficult to tap — eavesdropping requires physical access

DSL / ADSL

Digital Subscriber Line — broadband over existing phone lines. ADSL = Asymmetric (download faster than upload).

ADSL2+: up to 24 Mbps download — VDSL2: up to 100 Mbps — physical security: DSLAM access

What to know for the exam

The physical layer has no protocols that carry port numbers — questions focus on media types, attack vectors, and physical security.

Physical attacks to know: cable tapping, shoulder surfing, dumpster diving, tailgating, Tempest (electromagnetic eavesdropping on unshielded cables).

BadUSB: a USB device programmed to act as a HID (keyboard) and inject malicious keystrokes automatically. Defences: USB port locking, USB device whitelisting.

Juice jacking: charging via a compromised USB port installs malware or exfiltrates data. Counter: use data-blocking USB cables ('charge-only'), or AC adapters.

Bluetooth attacks: Bluejacking = sending unsolicited messages. Bluesnarfing = unauthorised data access. BIAS = Bluetooth Impersonation AttackS (exploits BR/EDR pairing).

Fibre optic vs copper: fibre cannot be tapped without causing detectable signal loss (unlike copper). Preferred for high-security backbone links.

Coaxial cable: bus topology — if cable breaks, entire segment fails. Historical but may appear in exam scenarios.

Physical security is a cybersecurity topic: an attacker with physical access can bypass most logical controls. Always classify physical access controls as part of a defence-in-depth strategy.