📌 1. OSI Model & TCP/IP Model
📜 OSI Model (7 Layers)
- Physical Layer – Bits, cables, wireless signals.
- Data Link Layer – MAC addresses, ARP, switches.
- Network Layer – IP addresses, routing.
- Transport Layer – TCP/UDP, port numbers.
- Session Layer – Session establishment (e.g., SSL/TLS).
- Presentation Layer – Encryption, data formats (JPEG, MP3, etc.).
- Application Layer – HTTP, FTP, DNS, etc.
🌐 TCP/IP Model (4 Layers)
- Network Interface – Physical + Data Link layer.
- Internet Layer – IP addresses, routing.
- Transport Layer – TCP/UDP, port numbers.
- Application Layer – HTTP, FTP, DNS, etc.
📌 Important Notes:
- OSI is theoretical; TCP/IP is practical.
- TCP/IP combines layers (e.g., No "Presentation" or "Session" layer).
📌 2. IP Addressing (IPv4/IPv6, Subnetting, CIDR)
📌 IPv4 (32-bit, 4 octets)
- Example:
192.168.1.1
- Private IP Ranges:
10.0.0.0 – 10.255.255.255
172.16.0.0 – 172.31.255.255
192.168.0.0 – 192.168.255.255
📌 IPv6 (128-bit, 8 blocks)
- Example:
2001:0db8:85a3:0000:0000:8a2e:0370:7334
- Uses hexadecimal.
- No subnetting needed like IPv4.
📌 Subnetting & CIDR
- Subnet Mask: Divides network & host.
255.255.255.0
→/24
(CIDR notation)255.255.0.0
→/16
- CIDR (Classless Inter-Domain Routing): Efficient IP allocation.
/24
= 256 IPs (1 network, 254 usable)./30
= 4 IPs (2 usable)./32
= 1 IP (single host).
📌 Commands to Check IP:
📌 3. MAC Addresses & ARP
MAC Address (Media Access Control)
- Unique identifier (48-bit) for network interfaces.
- Example:
00:1A:2B:3C:4D:5E
- Can't be routed like IP addresses.
ARP (Address Resolution Protocol)
- Maps IP to MAC in LAN.
- Command to check ARP table:
🔥 Hacking Use-Case: ARP Spoofing (Man-in-the-Middle Attack)
📌 4. Ports & Protocols (TCP, UDP, ICMP, etc.)
🔗 Common Protocols
Protocol | Port | Usage |
---|---|---|
TCP | - | Reliable, connection-oriented |
UDP | - | Fast, connectionless |
ICMP | - | Ping, network diagnostics |
HTTP | 80 | Web traffic |
HTTPS | 443 | Secure web traffic |
FTP | 21 | File transfer |
DNS | 53 | Domain name resolution |
SMTP | 25 | Sending email |
SSH | 22 | Secure shell (remote access) |
📌 Checking Open Ports
Or using Nmap:
📌 5. DNS Resolution (nslookup, dig, host)
DNS (Domain Name System) converts domain names into IPs.
📌 Commands for DNS Lookup
📌 Check all DNS Records:
🔥 Proxy, VPN, and Tor Basics (Anonymity Techniques) 🔥
📌 1. Proxy Servers
A proxy acts as an intermediary between you and the internet.
Types of Proxies:
- Forward Proxy – For users accessing the internet.
- Reverse Proxy – For servers to protect web apps.
- SOCKS Proxy – Handles multiple protocols (SOCKS5 supports UDP).
- Transparent Proxy – Invisible to the user.
📌 Using a Proxy (Linux)
For Nmap Scan via Proxy:
📌 2. VPN (Virtual Private Network)
A VPN encrypts your internet traffic and routes it through a secure server.
📌 Benefits:
✅ Hides IP address.
✅ Bypasses geo-restrictions.
✅ Encrypts traffic.
📌 VPN Services:
- NordVPN
- ExpressVPN
- ProtonVPN (Free)
- OpenVPN (Self-hosted)
📌 Check VPN Connection:
📌 3. Tor (The Onion Router)
Tor encrypts your traffic through multiple relays, making tracking difficult.
📌 Install Tor on Linux:
📌 Start Tor Service:
📌 Use Tor with Curl:
📌 Anonymize Browsing (TOR Browser)
- Download from https://www.torproject.org/
- Routes traffic through multiple nodes.
🔥 Conclusion & Hacking Use Cases 🔥
🚀 Mastering networking helps in:
✅ Bug Bounty (Understanding network vulnerabilities).
✅ Penetration Testing (Exploiting network misconfigurations).
✅ Anonymity (Using VPN, Proxy, and Tor for privacy).
🛠 Next Steps
1️⃣ Practice with Wireshark for packet analysis.
2️⃣ Learn MITM attacks (Ettercap, Bettercap).
3️⃣ Explore dark web using Tor safely.
0 Comments