Common Protocols (HTTPS, FTP, SSH, etc.) | Cyber Security Tutorial - Learn with VOKS
Advance AI Bootstrap C C++ Computer Vision Content Writing CSS Cyber Security Data Analysis Deep Learning Email Marketing Excel Figma HTML Java Script Machine Learning MySQLi Node JS PHP Power Bi Python Python for AI Python for Analysis React React Native SEO SMM SQL
Back Next

Common Protocols (HTTPS, FTP, SSH, etc.)

Learn this topic step-by-step with VOKS Tutorials.

Introduction to common network protocols

when computers communicate over a network, they follow specific rules called protocols. each protocol is designed for a particular purpose, such as loading websites, transferring files, or remotely controlling another computer.

think of a protocol as a language with strict rules. if both sides follow the same rules, communication works correctly.

Below is a beginner-friendly explanation of some of the most common protocols used on the internet.

1. https (hypertext transfer protocol secure)

https is the secure version of http. it is used for loading websites securely.

when you visit a website like:

https://example.com

your browser and the web server communicate using https.

how https works:

  1. your browser connects to the server (usually on port 443).
  2. they perform a secure handshake.
  3. the server sends a digital certificate.
  4. encryption is established.
  5. data is exchanged securely.

https uses:

  • Hypertext Transfer Protocol (http)
  • Transport Layer Security (tls)

why https is important:

  • encrypts data
  • prevents attackers from reading information
  • protects passwords and credit card data

example using python to make an https request:

import requests

response = requests.get("https://example.com")
print(response.status_code)
print(response.text[:200])

2. ftp (file transfer protocol)

ftp is used to transfer files between computers over a network.

it typically uses:

  • port 21 (control connection)
  • port 20 (data connection)

ftp is not secure by default because it sends data in plain text.

common uses:

  • uploading website files to a server
  • downloading files from remote servers

secure alternatives:

  • ftps (ftp over tls)
  • sftp (ssh file transfer protocol)

example ftp connection in python:

from ftplib import FTP

ftp = FTP("ftp.example.com")
ftp.login(user="username", passwd="password")

ftp.retrlines("LIST")
ftp.quit()

3. ssh (secure shell)

ssh allows you to remotely access and control another computer securely.

it usually runs on port 22.

what ssh does:

  • encrypts communication
  • allows remote command execution
  • supports secure file transfers (sftp)

example use case:

you connect from your laptop to a remote linux server:

ssh user@server_ip

behind the scenes, ssh:

  1. establishes a secure encrypted channel
  2. authenticates the user
  3. allows command execution

ssh uses strong encryption to prevent eavesdropping.

example using python (paramiko library):

import paramiko

ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect("example.com", username="user", password="password")

stdin, stdout, stderr = ssh.exec_command("ls")
print(stdout.read().decode())

ssh.close()

4. smtp

smtp is used to send emails between mail servers.

it usually runs on:

  • port 25 (standard)
  • port 587 (secure submission)

smtp handles sending emails, not receiving them.

example sending email with python:

import smtplib

server = smtplib.SMTP("smtp.example.com", 587)
server.starttls()
server.login("user@example.com", "password")

message = "Subject: Test\n\nThis is a test email."
server.sendmail("user@example.com", "recipient@example.com", message)

server.quit()

5. pop3 and imap

these protocols are used to receive emails.

pop3 (post office protocol version 3):

  • downloads emails to your device
  • usually removes them from the server
  • port 110 (or 995 secure)

imap (internet message access protocol):

  • keeps emails on the server
  • syncs across devices
  • port 143 (or 993 secure)

imap is more modern and commonly used today.

6. dns (domain name system)

dns translates domain names into ip addresses.

example:

when you type:

google.com

dns translates it into something like:

142.250.190.14

dns usually uses:

  • port 53
  • udp (sometimes tcp)

without dns, you would have to remember numeric ip addresses for every website.

7. dhcp (dynamic host configuration protocol)

dhcp automatically assigns ip addresses to devices on a network.

when you connect to wifi:

  1. your device sends a request.
  2. the dhcp server assigns an ip address.
  3. it also provides gateway and dns information.

dhcp usually uses:

  • port 67 (server)
  • port 68 (client)
  • udp

summary of common protocols

https:

  • secure web browsing
  • port 443
  • encrypted

ftp:

  • file transfer
  • port 21
  • not secure by default

ssh:

  • secure remote login
  • port 22
  • encrypted

smtp:

  • sending email
  • port 25/587

pop3:

  • download email
  • port 110

imap:

  • sync email
  • port 143

dns:

  • domain name translation
  • port 53
  • usually udp

dhcp:

  • automatic ip assignment
  • ports 67/68
  • udp

How these protocols work together

when you open a website:

  1. dhcp gives your device an ip address.
  2. dns translates the website name to an ip.
  3. your browser connects using https.
  4. tcp ensures reliable data transfer.
  5. tls encrypts the communication.

each protocol has a specific role, and together they make the internet function smoothly.

# =========================
# https request example
# =========================
import requests

def https_example():
    response = requests.get("https://example.com")
    print(response.status_code)
    print(response.text[:200])

# =========================
# ftp example
# =========================
from ftplib import FTP

def ftp_example():
    ftp = FTP("ftp.example.com")
    ftp.login(user="username", passwd="password")
    ftp.retrlines("LIST")
    ftp.quit()

# =========================
# ssh example
# =========================
import paramiko

def ssh_example():
    ssh = paramiko.SSHClient()
    ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
    ssh.connect("example.com", username="user", password="password")
    stdin, stdout, stderr = ssh.exec_command("ls")
    print(stdout.read().decode())
    ssh.close()

# =========================
# smtp example
# =========================
import smtplib

def smtp_example():
    server = smtplib.SMTP("smtp.example.com", 587)
    server.starttls()
    server.login("user@example.com", "password")
    message = "Subject: Test\n\nThis is a test email."
    server.sendmail("user@example.com", "recipient@example.com", message)
    server.quit()

# choose which function to run manually
# https_example()
# ftp_example()
# ssh_example()
# smtp_example()
QUICK KNOWLEDGE CHECK

Test Your Understanding

Answer 5 questions generated from this lesson. Your result is calculated instantly and is not saved.

0 / 5 answered
All Courses
Advance AI Bootstrap C C++ Computer Vision Content Writing CSS Cyber Security Data Analysis Deep Learning Email Marketing Excel Figma HTML Java Script Machine Learning MySQLi Node JS PHP Power Bi Python Python for AI Python for Analysis React React Native SEO SMM SQL
Course contents
Cyber Security
01 Introduction 02 Types of Cyber Threats 03 Cyber Security Domains 04 CIA Triad (Confidentiality Integrity Availability) 05 Career paths in Cyber Security 06 Certifications 07 Ethics and Responsible Disclosure 08 Laws and Regulation (e.g. GDPR, NDPR) 09 What is an OS? 10 Types: Window, Linus, macOS 11 Command-line vs GUI 12 OS Internals Overview (filesystems, processes, permissions) 13 Windows command prompt basics 14 Linux Bash Basics 15 File System Navigation 16 Basic Scripting 17 IP Addressing 18 DNS, DHCP 19 Mac Address 20 OSI VS TCP/IP Models 21 Ports and Protocols (TCP, UDP) 22 Common Protocols (HTTPS, FTP, SSH, etc.) 23 Packet structure 24 Firewalls, IDS/IPS, VPNs 25 Common attacks: MITM, Sniffing 26 Secure Network Practices 27 How the Web works 28 HTTP vs HTTPS 29 URLs, Headers, Cookies 30 Client-Server Architecture 31 Introduction To Web Security 32 OWASP Top 10 Overview 33 Common Threats (XSS, SQLi, CSRF) 34 Inpute validation and authentication flow 35 Basic Exploitation demo (e.g. XSS) 36 Burp Suite Introduction 37 Using a Browser For Testing 38 Password security 39 MFA-Antivirus 40 Cyber Hygeine Practice 41 Intro To Tools: Nmap, Wireshark, Netstat