LEVEL 1

Internet & Cybersecurity Basics

Beginner

🎯 Learning Objectives

🛡️ What is Cybersecurity?

Cybersecurity is the practice of protecting computer systems, networks, and data from unauthorized access, attacks, theft, and damage. It encompasses a wide range of technologies, processes, and practices designed to safeguard digital assets.

The CIA Triad - Three Pillars of Security:

🔒 Confidentiality

Ensuring that information is accessible only to those authorized to access it. Protects sensitive data from unauthorized disclosure.

  • Encryption
  • Access Controls
  • Authentication

✅ Integrity

Maintaining the accuracy and consistency of data. Ensures information has not been altered or tampered with.

  • Hashing
  • Digital Signatures
  • Checksums

⚡ Availability

Ensuring that authorized users have access to information and resources when needed.

  • Redundancy
  • Backups
  • Load Balancing

🌐 How the Internet Works

The Internet is a global network of interconnected computers that communicate using standardized protocols. Understanding this foundation is crucial for cybersecurity.

The Journey of a Web Request:

1

DNS Resolution

Your computer contacts a DNS (Domain Name System) server to translate the human-readable domain name (example.com) into an IP address (like 93.184.216.34).

# Example DNS lookup
nslookup example.com
Server:     8.8.8.8
Address:    8.8.8.8#53

Name:      example.com
Address:    93.184.216.34
2

TCP Connection

Your computer establishes a TCP (Transmission Control Protocol) connection with the target server using a three-way handshake:

SYN → (Client sends connection request)
SYN-ACK → (Server acknowledges)
ACK → (Client confirms)
→ Connection established!
3

HTTP/HTTPS Request

Your browser sends an HTTP request to the server asking for the webpage content.

GET /index.html HTTP/1.1
Host: example.com
User-Agent: Mozilla/5.0
Accept: text/html
4

Response & Rendering

The server sends back the requested content, and your browser renders the webpage for you to see.

🔐 HTTP vs HTTPS

Understanding the difference between HTTP and HTTPS is fundamental to web security.

⚠️ HTTP (Port 80)

  • No Encryption - Data sent in plain text
  • Vulnerable to Interception - Anyone can read the data
  • No Authentication - Can't verify server identity
  • Vulnerable to MITM - Man-in-the-middle attacks
Not Secure

✅ HTTPS (Port 443)

  • Encryption - TLS/SSL encrypts all data
  • Data Protection - Only sender/receiver can read
  • Server Authentication - Certificate verifies identity
  • Data Integrity - Detects tampering
Secure

📜 SSL/TLS Certificate

HTTPS uses SSL (Secure Sockets Layer) or TLS (Transport Layer Security) certificates to establish secure connections. These certificates are issued by Certificate Authorities (CAs) like Let's Encrypt, DigiCert, or Comodo.

🚨 Common Cybersecurity Threats

🦠 Malware

Malicious software designed to damage, disrupt, or gain unauthorized access to systems.

  • Viruses
  • Worms
  • Trojan Horses
  • Ransomware

🎣 Phishing

Deceptive attempts to obtain sensitive information by pretending to be a trustworthy entity.

  • Email Phishing
  • Spear Phishing
  • Smishing (SMS)
  • Vishing (Voice)

👤 Social Engineering

Psychological manipulation to trick people into making security mistakes.

  • Pretexting
  • Baiting
  • Tailgating
  • Quid Pro Quo

🌐 Man-in-the-Middle

Attacker secretly intercepts communications between two parties.

  • WiFi Eavesdropping
  • Session Hijacking
  • SSL Stripping
  • DNS Spoofing

💻 Practical Examples

Secure Password Check (Python)

import hashlib
import secrets

def check_password(password: str, stored_hash: str, salt: str) -> bool:
    """Verify a password against a stored hash."""
    # Create hash with salt
    password_hash = hashlib.pbkdf2_hmac(
        'sha256',
        password.encode('utf-8'),
        salt.encode('utf-8'),
        100000  # Number of iterations
    )
    return password_hash.hex() == stored_hash

# Example usage
salt = secrets.token_hex(16)
password = "MySecureP@ssw0rd!"
password_hash = hashlib.pbkdf2_hmac(
    'sha256',
    password.encode('utf-8'),
    salt.encode('utf-8'),
    100000
).hex()

print(f"Salt: {salt}")
print(f"Hash: {password_hash}")

Basic HTTPS Check (Python)

import ssl
import socket

def check_https(domain: str) -> dict:
    """Check if a domain supports HTTPS."""
    result = {
        'domain': domain,
        'https_supported': False,
        'ssl_grade': None,
        'error': None
    }
    
    try:
        # Create SSL context
        context = ssl.create_default_context()
        
        # Connect to the server
        with socket.create_connection((domain, 443), timeout=10) as sock:
            with context.wrap_socket(sock, server_hostname=domain) as ssock:
                result['https_supported'] = True
                result['ssl_grade'] = ssock.version()
                result['cipher'] = ssock.cipher()
                
    except Exception as e:
        result['error'] = str(e)
    
    return result

# Check example.com
check = check_https("example.com")
print(check)

🎯 Mini Project: Secure Login Interface

Create a secure login form with HTML5 security features:


Requirements:

  • Use HTTPS form action
  • Include CSRF protection token
  • Implement proper input validation
  • Use secure password field type
  • Add autocomplete attributes

🏋️ Practice Challenge

Challenge: Analyze a URL for Security

Given the following URLs, identify which are secure and explain why:

  1. http://bank.example.com/login
  2. https://mail.google.com/mail/u/0/
  3. http://192.168.1.1/admin
  4. https://api.example.com/v1/users

Bonus Challenge:

Create a Python script that checks whether a given list of websites supports HTTPS and reports the SSL certificate details.

📝 Summary

Key Takeaways:

  • Cybersecurity protects digital assets through Confidentiality, Integrity, and Availability (CIA Triad)
  • The Internet works through DNS resolution, TCP connections, and HTTP/HTTPS protocols
  • HTTPS provides encryption, authentication, and data integrity through TLS/SSL
  • Common threats include malware, phishing, social engineering, and MITM attacks
  • Security best practices include using strong passwords, enabling 2FA, and verifying HTTPS

Vocabulary:

  • DNS - Domain Name System, translates domain names to IP addresses
  • HTTP - HyperText Transfer Protocol, foundation of data communication
  • HTTPS - HTTP Secure, encrypted version of HTTP
  • TLS/SSL - Transport Layer Security/Secure Sockets Layer, encryption protocols
  • MITM - Man-in-the-Middle attack, intercepting communications