cover photo

COURSEWORK

V.A's CL-CY-001 course work. Lv 2

V.AAUTHORACTIVE

30 / 10 / 2024


CL-CY Level 1 Report

Task 1: Linux Based Task with Socket.io

  • Socket.IO is an open-source JavaScript library that facilitates real-time, bidirectional communication between web clients and servers. It builds on WebSockets while adding features like automatic reconnection, event-based messaging, and support for fallback mechanisms (e.g., HTTP long polling) when WebSockets are unavailable. This makes it highly reliable for real-time applications such as chat apps, multiplayer games, collaborative tools, and live notifications.

  • Unlike traditional HTTP requests, which require continuous polling for updates, Socket.IO allows both the client and server to emit and listen for events, significantly reducing latency and improving efficiency. It supports rooms and namespaces, enabling better message routing and scalability. Additionally, it ensures cross-browser compatibility and integrates seamlessly with frameworks like Express.js.

**Implementation: ** For this task, I set up a basic chat application on Linux (via WSL) using Node.js, Express, and Socket.IO. The app logs when users connect, disconnect, and send messages, demonstrating real-time data transmission. This practical implementation highlights how event-driven architecture enables efficient, dynamic communication in modern web applications.

Chat-Interface

Terminal

Node socketIO

Task 2: Git Bash and GitHub

GitHub is a widely used platform for hosting, managing, and collaborating on open-source projects. While GitHub Desktop provides a GUI for version control, I found Git Bash more efficient for executing specific commands quickly. Additionally, when creating a new repository, GitHub conveniently displays essential instructions, making it easier to get started.

For this task, I worked with Git Bash to manage repositories and track changes. Some fundamental commands I used include:

git init               # Initializes a new Git repository
git add file.txt       # Stages a file for the next commit
git commit -m "A very descriptive message"  # Saves changes with a meaningful message
git push origin    # Uploads local commits to a remote repository
git clone    # Creates a local copy of a remote repository

Using Git Bash provided better control and flexibility over repository management, helping streamline version control workflows.

Task 3: OSI Model

OSI The OSI Model, which stands for Open Systems Interconnection, is crucial for cloud and cybersecurity analysts. It consists of seven layers, each playing a vital role in data communication:

  1. Application Layer: This layer is where humans process data and information, utilizing protocols like HTTP, FTP, and SNMP.
  2. Presentation Layer: Data is formatted for usability, using standards such as ASCII, UTF encoding, and protocols like SSL and TLS for encryption, as well as GZip for compression.
  3. Session Layer: This layer maintains connections between applications, utilizing protocols like SOCKS, NetBIOS, and SIP.
  4. Transport Layer: Data is forwarded to the service capable of handling it, employing protocols such as TCP, UDP, and QUIC.
  5. Network Layer: This layer determines the path that packets travel using protocols like IPv4, IPv6, ICMP, and IPSec.
  6. Link Layer: Responsible for directing packets to the appropriate physical devices, using technologies like Wi-Fi, NDP, and Ethernet.
  7. Physical Layer: This layer encompasses the physical infrastructure necessary for data transport, including technologies like CAN Bus, Ethernet, and Bluetooth.

Task 4: Encryption techniques

Understanding Encryption and Its Importance Encryption is crucial for protecting sensitive data like passwords, ensuring confidentiality, integrity, and security. It converts plaintext into an unreadable format, preventing unauthorized access. Various encryption methods exist, each serving different security needs.

Types of Encryption

  • Symmetric Encryption
    Uses a single key for both encryption and decryption.  
    Fast and efficient for large datasets but requires secure key exchange.  
    Examples: AES, DES  
    
  • Asymmetric Encryption
    Uses a public key for encryption and a private key for decryption.  
    Common in secure communication (e.g., SSL/TLS, PGP).  
    Examples: RSA, ECC  
    
  • Hashing
    Irreversible transformation of data into a fixed-length hash.  
    Used for data integrity and password storage (e.g., bcrypt, SHA-256).  
    
  • End-to-End Encryption (E2EE)
    Encrypts data from sender to recipient, preventing interception.  
    Used in messaging apps like Signal and WhatsApp.  
    
  • Transport Layer Security (TLS)
    Encrypts internet data transmissions, ensuring secure web browsing.  
    Used in HTTPS for protecting online communication.  
    

**Implementation: **

I used the PyCrypto library to implement AES (Advanced Encryption Standard), a block cipher that encrypts and decrypts 16-byte blocks of data. This ensures that even if attackers access the database, stored passwords remain encrypted and unreadable.

Output Encryption decryption

Task 5: IP Addressing and Protocols

Web Scraping with Beautiful Soup and Selenium

Web scraping is a technique for extracting data from websites, often used for automation, data analysis, and research. Two key Python libraries for this task are:

  • Beautiful Soup: A powerful library for parsing and navigating HTML/XML. It helps extract specific elements from a webpage using tags, attributes, and CSS selectors.
  • Selenium: A browser automation tool that interacts with dynamic web pages, simulating user actions like clicking buttons and scrolling. This makes it useful for scraping JavaScript-rendered content.

**Implementation: **

When scraping web pages, certain elements may contain server and user IP addresses in the HTML source. While useful for log analysis, security monitoring, and network research, this also raises privacy concerns.

To explore this, I wrote a Python script that:

  • Fetched webpage content using Selenium for dynamic sites and Beautiful Soup for parsing.
  • Used regex to extract IPv4 addresses from HTML source code.

This task introduced me to web scraping techniques, the importance of handling structured and unstructured data, and the ethical considerations of data collection.

IPs

Ip and Protocols

Task 6: Kali Linux and SSH

Kali Linux is a widely used open-source penetration testing distribution based on Debian, equipped with various tools for ethical hacking and cybersecurity research. One such essential tool is SSH (Secure Shell), a cryptographic protocol that enables secure remote access, command execution, and file transfers over unsecured networks.

Network Scanning with Nmap

Nmap (Network Mapper) is a powerful tool for network reconnaissance, commonly used for port scanning, host discovery, and vulnerability assessment. It identifies open ports by sending packets and analyzing responses:

  • SYN-ACK: Indicates an open port.
  • SYN-RST: Indicates a closed port. Nmap is favored in penetration testing because of its stealth scanning capabilities, making it harder for Intrusion Detection Systems (IDS) to detect.

**Implementation: ** For this task, I ran Nmap on my Kali Linux VM to scan my local network. Initially, no ports were open. To test SSH connectivity, I started the SSH service, opening port 22 (TCP).

nmap -sS    # SYN Scan (stealthy port scan)
nmap -O     # OS Detection
nmap -A     # Aggressive Scan (OS, version, and script scanning)
nmap -v     # Verbose Mode (detailed output)

This task provided hands-on experience with network scanning, port enumeration, and secure remote access, which are critical in cybersecurity.

Task 7: Databases

CRUD stands for Create, Read, Update, and Delete, representing the four fundamental operations in any database-driven application. These actions allow users to add, retrieve, modify, and remove data, forming the core of full-stack development.

Project Overview: Bookstore App

For this task, I built a bookstore app where users can manage book records, including title, description, and price. The app follows a full-stack architecture, with:

  • Backend: Built using Express.js with the MySQL plugin for database management.
  • Frontend: Developed using React.js to display and interact with book data.

**Database Operations: **

The backend exposes RESTful APIs to handle CRUD operations:

POST   /books    # Create a new book  
GET    /books    # Retrieve all books  
PUT    /books/:id  # Update book details  
DELETE /books/:id  # Remove a book  

With this implementation, I gained experience in database integration, API development, and state management for dynamic web applications.

UI

Update

Database

UVCE,
K. R Circle,
Bengaluru 01