Cyber Security Lab Manual
Cyber Security Lab Manual
FACULTY OF SCIENCE
SCHOOL OF INFORMATION TECHNOLOGY
SESSION :- 2024-2025
LAB MANUAL
BCA VI SEMESTER
CYBER SECURITY
FACULTY NAME :- Shagun Tiwari
LIST OF EXPERIMENTS
Objective:
To understand and identify different types of cyber threats such as malware and phishing attacks.
Theory:
Cyber threats consist of various malicious techniques. Malware (viruses, worms, Trojans,
ransomware) refers to software specifically designed to damage, disrupt, or gain unauthorized
access to systems. Phishing involves fraudulent communications that appear to come from a
reputable source, aiming to trick individuals into revealing sensitive data. Learning these basics
helps in understanding attack methodologies and reinforces the need for robust security
measures.
Tools Used:
Procedure:
1) Malware Simulation:
Create a Python script that simulates malware behavior (for example, generating multiple files
automatically):
import os
for i in range(5):
Run an antivirus scan (e.g., using ClamAV) to see if it detects the simulated activity.
2. Phishing Demonstration:
Clone a sample login page (such as a generic email login) and send a test phishing email (only in
a secure, lab-controlled network).
Result:
The malware simulation created unwanted files automatically, demonstrating how unauthorized
scripts might operate.
The phishing demo successfully captured test credentials, reinforcing the idea that users are
vulnerable to social engineering if security awareness is lacking.
Practical 2: Information Security – Demonstrating the CIA Triad
Information security is the practice of protecting digital and physical data from unauthorized
access, modification, destruction, or disclosure. A foundational concept in this field is the CIA
Triad, which stands for Confidentiality, Integrity, and Availability. These three principles form the
backbone of all information security policies and practices, ensuring that data is secure,
trustworthy, and accessible when needed.
Integrity refers to the accuracy and trustworthiness of data. It ensures that information remains
unaltered during storage or transmission, except by authorized individuals. Integrity is crucial in
situations where the accuracy of data can have serious consequences—such as financial records,
academic transcripts, or software code. To maintain data integrity, systems use cryptographic
hash functions, digital signatures, and checksums. These methods detect unauthorized changes
to data and alert administrators to potential tampering or corruption.
Availability ensures that information and systems are accessible to authorized users when
needed. This principle is especially important for systems that must be operational around the
clock, such as banking services or emergency response systems. Availability can be disrupted by
technical failures, natural disasters, or cyberattacks like Denial of Service (DoS) attacks. To
maintain availability, organizations implement redundancy (e.g., backup servers), failover
systems, and regular maintenance schedules.
This practical involves demonstrating each component of the CIA Triad in a hands-on lab
environment. For confidentiality, students might use encryption tools to protect files and observe
how unauthorized access is blocked. For integrity, they might create a file, apply a hash function,
then alter the file to see how the hash changes.
Objective:
To understand the core principles of the CIA Triad (Confidentiality, Integrity, Availability).
To demonstrate file encryption and integrity verification as practical implementations of these
principles.
Theory:
Applying encryption (to maintain confidentiality) and hashing (to verify integrity) are two practical
techniques derived from this model.
Tools Used:
Linux Terminal
Procedure:
1) File Encryption:
2) Integrity Verification:
Compare the two hash files to verify if any integrity breach occurred.
Result:
The file encryption process successfully concealed the content from unauthorized access.
Hash comparison clearly indicated whether the file’s content was altered, thereby enforcing the
principle of integrity.
Unit II: Network Security
Network scanning and packet sniffing are essential techniques used in cybersecurity to analyze,
monitor, and secure network communications. These processes help identify vulnerabilities,
detect unauthorized devices, and understand how data moves across a network. This practical
introduces students to two key tools and techniques: network scanning, which discovers active
hosts and services, and packet sniffing, which captures and analyzes network traffic. The tool
primarily used here is Wireshark, a powerful and widely used packet analysis software.
Network scanning involves probing a network to find out what systems are active, what services
are running, and what vulnerabilities may exist. Tools like Nmap (Network Mapper) are commonly
used for this purpose. By scanning IP addresses and ports, an analyst can determine whether a
system is online, which ports are open, and what services are available. This is particularly useful
for identifying misconfigured devices, outdated software, or unauthorized systems within a
network.
Objective:
To capture and analyze live network traffic, thereby understanding how data packets, including
sensitive information, traverse the network.
Theory:
Packet sniffing involves capturing data packets on a network. Tools like Wireshark allow security
analysts to inspect packets transmitted over various protocols (HTTP, DNS, FTP) and identify
potential vulnerabilities or data leaks. This is critical for diagnosing network issues and detecting
unauthorized data exfiltration.
Tools Used:
Wireshark
Procedure:
1) Launch Wireshark and select the appropriate network interface.
Result:
Analysis revealed key details such as unencrypted HTTP transmissions, highlighting the need for
encryption on sensitive networks.
A firewall is a network security device or software that enforces access control policies. It filters
incoming and outgoing network traffic based on rules such as IP addresses, port numbers, and
protocols. There are two main types of firewalls: network-based and host-based. Network
firewalls protect entire segments, whereas host-based firewalls operate on individual machines.
Firewalls can be either stateless, filtering traffic based on static rules, or stateful, which track
active connections and make filtering decisions based on context.
A properly configured firewall prevents common attacks like port scanning, unauthorized access,
or outbound data leaks. For instance, a rule can be set to block all traffic from a suspicious IP
address or to allow only HTTP/HTTPS traffic to a web server.
Intrusion Detection Systems (IDS) and Intrusion Prevention Systems (IPS) add another layer of
defense. While a firewall blocks traffic based on rules, an IDS monitors network traffic for patterns
of known threats or anomalies. It generates alerts when suspicious activity is detected. An IPS, by
contrast, can actively block or quarantine malicious traffic in real time. IDS/IPS systems use
techniques such as signature-based detection (matching known attack patterns) and anomaly-
based detection (detecting unusual behavior).
In this practical, students are introduced to tools such as pfSense, Snort, or Suricata to simulate
firewall and IDS/IPS behavior. The exercise may involve creating custom firewall rules to block
specific types of traffic and then testing the rules using tools like Nmap or Metasploit. Similarly,
students can simulate attacks like port scanning, brute-force login attempts, or malformed packet
injection and observe how the IDS/IPS reacts—logging or blocking the suspicious traffic.
Through testing, students learn the importance of correct configuration, tuning sensitivity levels,
and managing false positives. They also understand how to monitor logs and alerts for signs of
intrusion attempts.
Objective:
To understand how firewalls and Intrusion Detection/Prevention Systems (IDS/IPS) work to block
unauthorized access and detect intrusions.
Theory:
A firewall filters incoming and outgoing network traffic based on a set of security rules. An IDS/IPS
monitors network traffic for suspicious behavior and takes action against possible attacks. These
systems together form a defensive barrier for network security.
Tools Used:
Procedure:
Simulate an attack (e.g., port scan using Nmap) from a secondary VM.
Monitor pfSense and Snort logs to check if the attack is detected and blocked.
Result:
The IDS detected the simulated attack, demonstrating its ability to monitor and alert for
suspicious activities.
Symmetric encryption uses a single key for both encryption and decryption. This means that the
sender and the receiver must both possess the same secret key and keep it confidential. It is fast
and suitable for encrypting large volumes of data, such as files or disk drives. Common symmetric
algorithms include:
AES (Advanced Encryption Standard) – widely used for its strong security and efficiency.
DES (Data Encryption Standard) – older and now considered insecure due to its small key size.
The main drawback of symmetric encryption is key distribution. If the key is intercepted during
exchange, the entire security of the communication is compromised.
Asymmetric encryption, also known as public-key cryptography, solves this problem by using a
pair of keys: a public key (used to encrypt data) and a private key (used to decrypt it). The public
key can be shared openly, while the private key is kept secret by the owner. Well-known
asymmetric algorithms include:
RSA (Rivest-Shamir-Adleman) – one of the earliest and most widely used public-key algorithms.
ECC (Elliptic Curve Cryptography) – offers similar security with smaller key sizes and faster
performance.
Objective:
To learn encryption methods by implementing both symmetric (AES) and asymmetric (RSA)
algorithms to secure communication.
Theory:
Symmetric encryption uses the same key for both encryption and decryption (e.g., AES), which is
fast but requires secure key exchange. Asymmetric encryption uses a public key for encryption
and a private key for decryption (e.g., RSA), offering improved security over unsecured channels
but at a slower speed. Combining both can provide secure and efficient data protection.
Tools Used:
Procedure:
openssl rsautl -encrypt -inkey public.pem -pubin -in sample.txt -out sample.txt.enc
Result:
The AES process successfully encrypted and decrypted the file using a shared password.
The RSA method secured the file using a public/private key mechanism, thereby demonstrating
both encryption approaches.
A hash function takes input data of any size and produces a fixed-size string of characters, usually
in hexadecimal format. This output is called a hash value or message digest. Hash functions are
one-way, meaning the original input cannot be reconstructed from the hash, and they are
deterministic, so the same input will always produce the same output. Additionally, even a small
change in input should produce a significantly different hash—a property called the avalanche
effect.
• SHA-256 and SHA-3: Current standards offering strong security and used in blockchain, file
integrity checks, and more.
Hashing is used in many areas, including verifying file downloads, storing passwords securely
(with added salts), and detecting data tampering.
Digital signatures build on hashing by using asymmetric encryption. When a sender wants to sign
a message, they first hash the data and then encrypt the hash with their private key. The result is
the digital signature, which is sent along with the original message. The recipient can then verify
the signature by:
1. Decrypting the signature with the sender’s public key to retrieve the hash.
This process ensures data integrity (the message hasn’t been altered), authenticity (it came from
the claimed sender), and non-repudiation (the sender can’t deny sending it).
In this practical, students use tools like OpenSSL, GPG, or built-in Python libraries to:
Objective: To study hashing algorithms for data integrity and utilize digital signatures to verify
authenticity.
Theory:
Hashing creates a unique fixed-size string (hash) from any data input. Even a minor change in data
changes the hash. Digital signatures use cryptographic techniques (usually based on RSA) to sign
and verify digital documents, ensuring that data has not been tampered with.
Tools Used:
OpenSSL
Procedure:
1) Hash Generation:
Generate a SHA256 hash of a file:
2) Digital Signature:
Result:
The digital signature verification confirmed the authenticity and integrity of the file.
Reconnaissance (or recon) is the first phase where ethical hackers collect as much information as
possible about a target. This step is crucial because it forms the foundation for later exploitation.
Reconnaissance is typically divided into two types:
• Passive Reconnaissance: Involves collecting data without interacting directly with the
target system. This may include using public sources such as WHOIS databases, DNS
records, websites, social media, and public IP information.
• Active Reconnaissance: Involves directly interacting with the target through methods like
ping sweeps or port scans, which may be detectable.
Tools used for reconnaissance include Google Dorking, Shodan, theHarvester, and Maltego. These
tools help identify IP ranges, domain names, email addresses, and more.
Once sufficient information is collected, the next phase is scanning. Scanning involves probing the
target to discover open ports, active services, operating systems, and potential vulnerabilities.
The goal is to map the target’s attack surface.
• Port Scanning: Determines which ports are open and which services are running.
• Nikto: A web server scanner that detects outdated software and security
misconfigurations.
• Netcat and Masscan: For high-speed port scanning and network analysis.
Theory:
Tools Used:
Nmap
Kali Linux
3) Use Wireshark simultaneously to capture any unusual traffic during the scan.
Result:
Detailed network scan results showing active ports, services, and potential vulnerabilities.
Metasploit provides a comprehensive platform for developing, testing, and executing exploit code
against a remote target machine. It offers a wide array of pre-built exploits, payloads, and auxiliary
modules that allow security professionals and ethical hackers to simulate real-world attacks. The
goal of this phase is not to harm the system but to understand how vulnerabilities can be abused
and how organizations can defend against them.
An exploit is a piece of code or a method used to take advantage of a security flaw. A payload is
the code that runs on the target once the exploit is successful—often giving the attacker control
of the system. Examples of payloads include command shells, reverse shells, or Meterpreter
sessions (Metasploit's advanced payload offering post-exploitation tools).
In a controlled lab setup, students perform ethical exploitation of a vulnerable system (e.g.,
Metasploitable or DVWA). They use Metasploit to scan, select an exploit, configure a payload,
and execute the attack. Once access is gained, they may explore directories, take screenshots, or
dump password hashes—always within legal and educational boundaries.
Objective: To exploit a known vulnerability on a test system and generate a concise report
detailing the steps and findings.
Theory:
Tools Used:
Kali Linux
Metasploit Framework
Procedure:
3) Set required options (target IP, payload) and execute the exploit.
4) If successful, document the process, including screenshots, commands used, and the shell or
access gained.
5) Write a short report describing the vulnerability exploited and remediation strategies.
Result:
Successful exploitation of a known vulnerability.
A cybercrime can include activities such as hacking, data theft, identity fraud, cyberbullying,
ransomware attacks, and unauthorized access to systems. When such an incident occurs,
investigators must follow strict procedures to ensure the integrity and admissibility of digital
evidence.
Digital forensics is the science of identifying, acquiring, examining, and reporting on digital data
in a legally acceptable manner. The process typically follows a structured methodology:
2. Preservation – Ensuring that data is not modified or destroyed. This involves creating
forensic images (bit-by-bit copies) of drives or devices.
3. Analysis – Extracting and examining relevant information using forensic tools. This
includes recovering deleted files, analyzing timestamps, or identifying unauthorized
access.
4. Documentation and Reporting – Recording all findings, procedures, and tools used.
Reports must be clear, accurate, and able to stand up in court.
An incident response plan (IRP) outlines how a team identifies and mitigates security threats to
minimize damage and ensure business continuity. The goal is not only to resolve the incident but
also to learn from it and improve future preparedness.
3. Containment – Taking immediate steps to isolate the affected systems and prevent further
spread. Containment strategies may be short-term (e.g., disconnecting a compromised
device) or long-term (e.g., network segmentation).
4. Eradication – Removing the root cause of the incident, such as deleting malware or
disabling unauthorized accounts.
5. Recovery – Restoring normal operations, which may involve restoring systems from clean
backups, testing them for stability, and monitoring for re-infection.
Theory:
Digital forensics involves the recovery, investigation, and analysis of material found in digital
devices. It plays a crucial role in cybercrime investigations by preserving evidence in a legally
admissible format. Investigators use tools to recover deleted files and assess system logs and
browser histories.
Tools Used:
Autopsy or FTK Imager
Procedure:
3) Recover deleted files and analyze web browsing history, USB logs, and system event logs.
Result:
The forensic report provided a clear timeline of events and evidence that could be used in further
investigation.
Objective: To simulate a cyber incident (e.g., ransomware attack) and develop an incident
response plan that aligns with current cyber laws and best practices.
Theory:
Tools Used:
Procedure:
4) Map relevant cyber laws and discuss compliance (e.g., GDPR reporting requirements, IT Act
guidelines).
Result:
A comprehensive incident response plan was developed and tested via simulation.
The exercise highlighted the importance of timely action and legal compliance in handling cyber
incidents
VIVA QUESTIONS AND ANSWERS
General Cybersecurity
Cybersecurity refers to the practice of protecting systems, networks, and data from digital attacks.
These attacks often aim to access, modify, or destroy sensitive information or disrupt services.
Cybersecurity involves tools, technologies, and practices such as firewalls, encryption, and
intrusion detection systems.
The CIA Triad stands for Confidentiality, Integrity, and Availability. It represents the three primary
principles of information security. Confidentiality ensures data privacy, integrity ensures data
accuracy, and availability ensures that information is accessible to authorized users when needed.
A firewall monitors and filters incoming and outgoing traffic based on security rules. It creates a
barrier between trusted internal networks and untrusted external sources, helping to block
malicious traffic and unauthorized access attempts.
Malware is any malicious software designed to harm, exploit, or disable computers. Types include
viruses, worms, Trojans, ransomware, spyware, and adware. Each type has a unique behavior, but
all can compromise system security.
Phishing is a social engineering attack where attackers trick users into revealing sensitive
information like passwords or credit card numbers, often through fake emails or websites. Victims
are usually lured by urgent messages or offers.
Encryption converts data into unreadable code to prevent unauthorized access. Only someone
with the correct key can decrypt it. It protects data confidentiality in transit and at rest.
7). Difference between symmetric and asymmetric encryption?
Symmetric encryption uses one key for both encryption and decryption, while asymmetric
encryption uses a public-private key pair. Symmetric is faster but less secure in key exchange;
asymmetric provides secure communication.
AES (Advanced Encryption Standard) is a symmetric key encryption algorithm used worldwide for
secure data transmission. It supports key sizes of 128, 192, and 256 bits and is known for its speed
and security.
RSA is an asymmetric encryption algorithm used for secure data exchange, digital signatures, and
encryption. It relies on the mathematical difficulty of factoring large prime numbers.
A digital signature is a cryptographic technique that verifies the authenticity and integrity of
digital messages or documents. It uses the sender's private key and is validated with their public
key.
Network Security
11). What is network scanning?
Network scanning identifies active devices, open ports, and running services in a network. Tools
like Nmap help find vulnerabilities, aiding both attackers (in reconnaissance) and defenders (in
securing networks).
Port scanning involves probing ports on a host to identify open or closed ones. It helps determine
which services are running and if there are any exploitable weaknesses.
Wireshark is a packet-sniffing tool used to capture and analyze network traffic in real time. It helps
in protocol analysis, troubleshooting, and detecting anomalies or intrusions.
Packets are small units of data transmitted over a network. Each packet contains control
information and the data payload. They’re essential for reliable data transmission.
Reconnaissance is the first stage of ethical hacking where information about a target system is
collected. It includes passive and active methods like DNS queries or network scans.
It’s an automated process to identify known vulnerabilities in systems or applications. Tools like
Nessus or OpenVAS are used for regular security assessments.
Metasploit is a penetration testing framework that helps in developing and executing exploits. It
allows testers to simulate attacks and evaluate system vulnerabilities.
A payload is the part of an exploit that performs the intended malicious action after the system
is compromised, such as opening a backdoor or executing commands.
Digital forensics involves the identification, preservation, analysis, and presentation of electronic
evidence. It is used in cybercrime investigations and legal proceedings.
FTK Imager is a digital forensic tool used to create exact copies (images) of hard drives or storage
devices, allowing investigators to analyze data without altering the original.
Autopsy is an open-source forensic platform used to investigate hard drives and recover deleted
files, emails, browser history, and other digital evidence.
Incident response is a structured process for managing and mitigating cyberattacks. It includes
preparation, detection, containment, eradication, recovery, and post-incident review.
SIEM (Security Information and Event Management) tools collect and analyze log data from
multiple sources in real-time to detect security incidents.
Containment involves isolating affected systems or networks to prevent further damage or spread
of the attack. It can be temporary or permanent depending on the situation.
Post-incident analysis helps in understanding how the attack occurred, what went wrong, and
how to improve defenses to prevent future incidents.
Playbooks are predefined procedures for responding to specific types of cyber incidents. They
help teams respond quickly and consistently during high-pressure situations.
A security policy is a formal document that outlines how an organization protects its assets and
data. It includes rules for acceptable use, access control, and incident handling.
Data integrity means data remains accurate and unaltered during storage, transmission, or
processing. It is critical for trustworthy systems and transactions.
Access control ensures that only authorized individuals can view or use certain resources. It
includes mechanisms like role-based access, authentication, and authorization.
Ransomware is a type of malware that encrypts a victim’s data and demands payment (usually in
cryptocurrency) to restore access. It is one of the most damaging forms of attack today.
A zero-day is an unknown security flaw with no patch available, making it highly dangerous.
Attackers exploit it before developers can fix it.
PhaaS is a dark web business model where attackers rent phishing kits or platforms to carry out
phishing attacks without deep technical knowledge.
Endpoint security refers to securing end-user devices like laptops, smartphones, and desktops,
which are often entry points for cyberattacks.
Most cyberattacks exploit human error. Cybersecurity awareness educates users on identifying
threats, practicing safe behaviors, and reducing risks, making it a key defense layer.