0% found this document useful (0 votes)
8 views22 pages

Email Tracking and Forensic Programs

Uploaded by

avadhootisht
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views22 pages

Email Tracking and Forensic Programs

Uploaded by

avadhootisht
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

1. Write a program for Tracking Emails and Investigating Email Crimes. i.e.

Write a program to
analyze e–mail header.

Code:-

def analyze_email_header(header):
lines = [Link]("\n")
for line in lines:
if [Link]("From:"):
print(line)
elif [Link]("To:"):
print(line)
elif [Link]("Subject:"):
print(line)
elif [Link]("Date:"):
print(line)
elif [Link]("Received:"):
print(line)

header = """
Received: from [Link] ([Link])
From: sender@[Link]
To: receiver@[Link]
Subject: Test Email
Date: Sat, 03 May 2025 10:00:00 +5:30
"""

analyze_email_header(header)

Output:
2. Implement a program to generate and verify CAPTCHA image

Code:-

from [Link] import ImageCaptcha


from PIL import Image
import random
import string

def generate_captcha_text(length=5):
letters = string.ascii_uppercase + [Link]
return "".join([Link](letters) for _ in range(length))

def create_captcha_image(captcha_text):
image_captcha = ImageCaptcha()
image = image_captcha.generate_image(captcha_text)
[Link]("[Link]")

def verify_captcha(captcha_text):
user_input = input("Enter The CAPTCHA Shown In the Image: ")
if user_input.strip().upper() == captcha_text:
print("✔CAPTCHA Verified Successfully....")
else:
print("✗CAPTCHA Verification Failed.")

captcha_text = generate_captcha_text()
create_captcha_image(captcha_text)
verify_captcha(captcha_text)

Output:
3. Write a computer forensic application program for Recovering permanent Deleted Files and
Deleted Partitions.

Code:-
import os

def scan_deleted_partitions(disk_image):
print("\n[+] Scanning for deleted/lost partitions in:", disk_image)
# Common filesystem signatures
signatures = {
b'NTFS ': 'NTFS Partition',
b'FAT32 ': 'FAT32 Partition',
b'EXT4': 'EXT4 Partition'
}

try:
with open(disk_image, 'rb') as f:
data = [Link]()
for sig, name in [Link]():
if sig in data:
offset = [Link](sig)
print(f" → Found {name} at byte offset {offset}")
except FileNotFoundError:
print(" [!] Disk image not found. Please provide a valid file path.")

def recover_deleted_files(disk_image, output_folder="recovered_files"):


print("\n[+] Searching for deleted files inside:", disk_image)
# Common file headers and footers
signatures = {
b'\xFF\xD8\xFF': (b'\xFF\xD9', '.jpg'), # JPEG
b'%PDF-': (b'%%EOF', '.pdf'), # PDF
b'PK\x03\x04': (b'PK\x05\x06', '.zip') # ZIP/DOCX
}

# Create folder to save recovered files


if not [Link](output_folder):
[Link](output_folder)

try:
with open(disk_image, 'rb') as f:
data = [Link]()
for header, (footer, ext) in [Link]():
start = 0
while True:
start = [Link](header, start)
if start == -1:
break
end = [Link](footer, start)
if end == -1:
break
end += len(footer)
recovered_data = data[start:end]
filename = [Link](output_folder, f"recovered_{start}{ext}")
with open(filename, 'wb') as out:
[Link](recovered_data)
print(f" → Recovered file saved as {filename}")
start = end
except FileNotFoundError:
print(" [!] Disk image not found. Please provide a valid file path.")

# -----------------------------
# Main Execution
# -----------------------------
if __name__ == "__main__":
print("=== Computer Forensic Application ===")
print("1. Recover Deleted Files")
print("2. Scan Deleted Partitions")
choice = input("\nEnter your choice (1/2): ")

disk_image = input("Enter path to disk image file (e.g., [Link]): ")

if choice == "1":
recover_deleted_files(disk_image)
elif choice == "2":
scan_deleted_partitions(disk_image)
else:
print("Invalid choice! Please enter 1 or 2.")

Output:
4. Write a program for Log Capturing and Event Correlation

Code:-

import time
from collections import defaultdict

log_events = [
{"timestamp":[Link](),"event":"LOGIN_FAIL","user":"admin","ip":"[Link]"},
{"timestamp":[Link](),"event":"LOGIN_FAIL","user":"admin","ip":"[Link]"},
{"timestamp":[Link](),"event":"LOGIN_FAIL","user":"admin","ip":"[Link]"},
{"timestamp":[Link](),"event":"LOGIN_FAIL","user":"admin","ip":"[Link]"},
{"timestamp":[Link](),"event":"LOGIN_FAIL","user":"admin","ip":"[Link]"}
]

def capture_logs(events,filename="log_file.txt"):
with open(filename,'w') as f:
for event in events:
log_line = f"{event['timestamp']}-{event['event']}-{event['user']}-{event['ip']}\n"
[Link](log_line)

print("Logs captured to the file")

def correlate_logs(filename="log_file.txt"):
fail_count = defaultdict(int)
with open(filename,"r") as f:
for line in f:
if "LOGIN_FAIL" in line:
ip = [Link]().split("-")[-1]
fail_count[ip] += 1

for ip,count in fail_count.items():


if count>=3:
print(f"Suspicious Activity Detected from IP {ip}:{count} failed attempts")

capture_logs(log_events)
correlate_logs()
Output:
5. Study of Honeypot

1. Introduction
In today’s digital world, cybersecurity has become an essential part of every organization’s IT
infrastructure. With the rapid increase in cybercrimes, there is a growing need for proactive security
mechanisms to protect systems from unauthorized access. One such technique that plays a vital role in
monitoring and analyzing malicious activity is the use of Honeypots.

A Honeypot is a trap system intentionally designed to appear vulnerable and attractive to attackers. It
mimics a legitimate target for hackers and captures their attempts to breach security. The primary purpose of
a honeypot is not to protect the system directly but to observe attacker behavior, techniques, and motives. It
acts as a decoy, diverting attackers from real systems and gathering intelligence about their actions.

The concept of honeypots is widely used in research and enterprise environments to improve the overall
security posture. They help security professionals to gain insight into emerging threats, zero-day exploits,
and malware behavior. Honeypots can be deployed in various forms and configurations based on the
security objectives.

2. Objectives and Importance


Objectives:
 To monitor unauthorized access and intrusion attempts.
 To mislead attackers and gather forensic evidence.
 To detect unknown vulnerabilities and malware.
 To analyze the behavior and tools used by attackers.

Importance:
 Improves understanding of cyber threats.
 Enhances security infrastructure through real-time threat intelligence.
 Provides an environment to test and evaluate security policies.
 Useful for academic research, threat modeling, and training purposes.

3. How Honeypots Work


A honeypot is configured to appear as a legitimate system or service, such as a server with open ports, fake
databases, or unpatched software. When a hacker tries to exploit the vulnerabilities, the honeypot records
every interaction made by the intruder.

Internally, honeypots consist of the following components:


 Decoy Systems: Simulated services, servers, or files.
 Monitoring Tools: Logs, packet sniffers, event trackers.
 Data Capture Mechanisms: Used to collect inputs, commands, IP addresses, and malware samples.
The honeypot must be isolated from the actual network to avoid spreading infection or allowing access to
sensitive resources. It acts as a sandbox for attackers, enabling safe observation of real-time threats.

Once data is captured, it is analyzed using machine learning models or manually by security analysts to gain
insights. These insights help organizations patch vulnerabilities and strengthen defenses.

4. Classification of Honeypots
A. Based on Interaction Level:
1. Low-Interaction Honeypots:
o Simulate limited services.
o Easy to set up.
o Suitable for detecting automated attacks and bots.

2. Medium-Interaction Honeypots:
o Offer more realistic interaction (partial OS emulation).
o Better data collection.
o Higher risk than low-interaction.

3. High-Interaction Honeypots:
o Real operating systems are used.
o Complete interaction with attackers.
o Risky if not properly isolated, but provides detailed data.

B. Based on Purpose:
1. Production Honeypots:
o Deployed within production networks.
o Detect real-time intrusions.

2. Research Honeypots:
o Used for academic or industry research.
o Analyze new hacking techniques, malware, and threat trends.

5. Applications and Use Cases


 Detecting intrusion attempts and network scanning.
 Collecting malware and analyzing its behavior.
 Diverting attention away from real servers.
 Insider threat monitoring in sensitive environments.
 Observing APTs (Advanced Persistent Threats).
 Training cybersecurity professionals.
6. Advantages and Limitations
Advantages:
 Reduces false alarms compared to traditional IDS.
 Helps in discovering zero-day exploits.
 Improves incident response strategies.
 Supports threat intelligence generation.
 Acts as a legal evidence source in some jurisdictions.

Limitations:
 Cannot prevent attacks on real systems directly.
 Needs expert configuration and monitoring.
 Advanced attackers can detect and avoid honeypots.
 If misconfigured, can become a liability.

7. Tools Used for Honeypots


Some of the widely used honeypot tools include:
 Honeyd – Lightweight and flexible tool for low-interaction honeypots.
 Kippo – SSH honeypot designed to log brute-force attacks.
 Dionaea – Designed to collect malware samples.
 Snort - Honeypot Integration – Combining IDS with honeypots.
 Cowrie – Advanced SSH/Telnet honeypot based on Kippo.

8. Conclusion
Honeypots are a powerful and strategic cybersecurity solution for detecting, analyzing, and understanding
cyber threats. While they are not a replacement for firewalls, antivirus, or intrusion detection systems, they
provide valuable intelligence that can enhance overall network security.

With increasing sophistication in cyberattacks, honeypots provide a proactive approach to gather real-world
data, test defense mechanisms, and prepare for future threats. When deployed and maintained properly, they
serve as an indispensable tool for both academic research and enterprise defense strategies.

9. References
1. William Stallings, "Network Security Essentials"
2. [Link]
3. [Link]
4. [Link]
5. Research Paper: “Survey on Honeypot Tools and Techniques”, IEEE Xplore
7. Write TEST Scenario for Gmail Login Page

Code:
I. Mini_gmail.html :

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Mini Gmail</title>
</head>
<body>
<h2>Login</h2>
<form>
<label>Email:</label>
<input type="text" id="email"><br><br>
<label>Password:</label>
<input type="password" id="password"><br><br>
<button type="button" onclick="login()">Login</button>
</form>
<p id="message"></p>

<script>
function login() {
const email = [Link]("email").value;
const pass = [Link]("password").value;
const msg = [Link]("message");
if (email === "" || pass === "") {
[Link] = "Please fill all fields!";
} else if (email === "student@[Link]" && pass === "12345") {
[Link] = "Login Successful!";
} else {
[Link] = "Invalid Email or Password!";
}
}
</script>
</body>
</html>

II. test_mini_gmail.py:

from selenium import webdriver


from [Link] import By
from [Link] import Service
from webdriver_manager.chrome import ChromeDriverManager
import time

# Open Chrome browser


driver = [Link](service=Service(ChromeDriverManager().install()))
[Link]("[Link]

# ---------- TC1: Blank fields ----------


driver.find_element(By.TAG_NAME, "button").click()
[Link](1)
msg = driver.find_element([Link], "message").text
print("TC1 Blank fields:", "PASS" if "Please fill" in msg else "FAIL")

# ---------- TC2: Wrong password ----------


driver.find_element([Link], "email").send_keys("student@[Link]")
driver.find_element([Link], "password").send_keys("wrong")
driver.find_element(By.TAG_NAME, "button").click()
[Link](1)
msg = driver.find_element([Link], "message").text
print("TC2 Wrong password:", "PASS" if "Invalid" in msg else "FAIL")

# ---------- TC3: Correct login ----------


driver.find_element([Link], "email").clear()
driver.find_element([Link], "password").clear()
driver.find_element([Link], "email").send_keys("student@[Link]")
driver.find_element([Link], "password").send_keys("12345")
driver.find_element(By.TAG_NAME, "button").click()
[Link](1)
msg = driver.find_element([Link], "message").text
print("TC3 Correct login:", "PASS" if "Successful" in msg else "FAIL")

[Link]()

Output:-
This page contains the email and password input fields with a login button.

Selenium automatically opens Chrome and performs login validation.

Console output showing PASS/FAIL results for each test case.


[Link] Test cases in excel sheet for Social Media application or website.

1. Aim: To perform manual functional testing of the OrangeHRM web application and verify that core
modules such as Login, Logout, and Forgot Password work as intended.

2. Objective: The objective of this practical is to understand the step-by-step process of manual testing,
prepare test cases, execute them on a live application, capture actual results, and record findings in a test
report.

3. Scope : This practical focuses on the authentication module of OrangeHRM:


 Login with valid and invalid credentials
 Logout functionality
 Forgot Password link operation
1. Tools & Environment
Item Description
Application OrangeHRM Demo
URL [Link]
Browser Google Chrome
OS Windows 10
Tester Your Name
Date Current Date

2. Test Cases Executed :

TC ID Test Scenario Expected Result Actual Result Status

Login with valid Dashboard page should Dashboard loaded;


TC001 ✅ PASS
credentials appear Admin profile visible

Login with invalid “Invalid credentials” Error message


TC002 ✅ PASS
password message shown displayed correctly

Login page displayed


TC003 Logout functionality Redirect to Login page ✅ PASS
again

Message “Reset link


Forgot Password Confirmation message
TC004 sent to email” ✅ PASS
functionality shown
displayed
3. Test Summary
Metric Count
Total Test Cases 4
Passed 4
Failed 0
Defects Logged 0

4. Screenshots:

Valid Username & Password :Dashboard loaded; Admin profile visible

Login with invalid password


Forgot Password functionality: Message “Reset link sent to email” displayed

Excel sheet displaying all executed test cases (TC001–TC005) for the OrangeHRM
demo application
[Link] Defect Report for Any application or web application.

1. Aim
To test the validation of the email field in the DemoQA Practice Form and to prepare a defect report using
GitHub Issues.

2. Objective
 To verify if the form properly detects invalid input.

 To understand how to record evidence using screenshots, console logs, and network logs.

 To learn how to create and close a defect report in GitHub.

2. Tools and Technologies


Tool Purpose
Google Chrome Testing the web form
Chrome DevTools Console & Network analysis
GitHub Defect reporting
Snipping Tool Capturing screenshots
Windows 10 Operating environment

4. Test Scenario
Scenario Name: Email Field Validation Test
URL: [Link]

5. Test Steps

1. Open the DemoQA Practice Form in Chrome.


2. Enter invalid data:
o Name: Test Student
o Email: teststudent(at)gmail
o Gender: Male
o Mobile: 1234567890
3. Click Submit.
4. Observe the validation result on the form.
5. Open DevTools → Console to see any warnings/errors.
6. Open DevTools → Network tab and check if any data is sent to the server.
7. Create a GitHub Issue to record your result.

6. Expected Result
The form should show validation errors (red border) for the invalid email and should not submit.

7. Actual Result
The form correctly displayed red validation messages for invalid Email and Mobile fields and did not submit
the data.

8. Observations
a) Form Validation Result

Email and Mobile fields turned red.

b) Console Log
Console showed general site warnings like permissions
d) GitHub Issue Report

A GitHub issue titled “BUG-DF-001 — Practice Form accepts invalid email” was created.

Result Table

Test
Test Case ID Input Expected Actual Result
Description
Should show Error shown,
Verify email
TC-001 teststudent(at)gmail error and not form not ✅ PASS
validation
submit submitted

10. Conclusion
The DemoQA Practice Form correctly performed client-side validation on the Email and Mobile fields.
Invalid data was detected, and the form did not send any request to the server.
Console and network logs confirmed that validation works as expected.
The issue was documented on GitHub for record-keeping and marked as Closed — Working as Expected.
Thus, the purpose of learning defect reporting, evidence collection, and issue tracking is successfully
achieved.

11. References
1. DemoQA Practice Form
2. GitHub Issues Documentation
3. Google Chrome DevTools
10. Installation of Selenium grid and selenium Web driver java eclipse (automation tools).

Code:-

package seleniumdemo;

import [Link];
import [Link];

public class FirstTest {


public static void main(String[] args) {
[Link]("[Link]", "/usr/local/bin/chromedriver");

WebDriver driver = new ChromeDriver();


[Link]("[Link]
[Link]("Page Title: " + [Link]());
[Link]();
}
}

Screenshots:
1. Java version check :

Java JDK installed

2. Eclipse Build Path:

Selenium JARs added


3. Eclipse code view:

Selenium program

4. Eclipse code view:

Browser automation success


11. Prepare Software requirement specification for any project or problem statement.

Software Requirement Specification (SRS)


Project Title: Student Attendance Management System

1. Introduction
1.1 Purpose
The purpose of this software is to digitize and automate the attendance process in
schools/colleges. It will allow teachers to record attendance, students to view their own
attendance history, and administrators to generate reports.

1.2 Scope
 Teachers → Can mark daily attendance.
 Students → Can check their attendance percentage.
 Admin → Can generate monthly/subject-wise reports.
 System → A web-based application accessible on both PC and mobile.

1.3 Definitions
 Admin = School/College management authority
 User = Teacher/Student

1.4 References
 IEEE SRS template
 Existing manual attendance registers

2. Overall Description
2.1 Product Perspective
Currently, attendance is maintained manually on paper. This software will automate the process,
making it faster and more reliable.

2.2 User Characteristics


 Teacher: Basic computer knowledge
 Student: Familiar with mobile/web browsing
 Admin: Ability to manage reports and system access

2.3 Constraints
 Internet connection required
 Data must be secure
 Attendance records can only be modified by authorized users

3. Functional Requirements
 Login Module:
o Teachers, students, and admins must be able to log in securely.
 Attendance Module:
o Teachers can mark attendance for classes.
o Students can view their attendance records.
 Report Module:
o Admin can generate reports (monthly, subject-wise, or student-wise).
 Notification Module:
o Students with &lt;75% attendance will receive an email/SMS alert.

4. Non-Functional Requirements
 Performance: Attendance for a class of 100 students should be saved within 2 seconds.
 Security: Encrypted passwords, role-based access.
 Reliability: System must be available 24x7.
 Usability: User-friendly interface, mobile compatibility.

5. External Interface Requirements


 User Interface: Responsive web pages (HTML, CSS, JS).
 Hardware Interface: PC or Mobile device with Internet access.
 Software Interface: Web server + MySQL database.

6. System Models

Use Case Diagram (simplified):


 Actor: Teacher → Mark Attendance
 Actor: Student → View Attendance
 Actor: Admin → Generate Reports

7. Appendix
 Tools: Java/PHP with MySQL, Bootstrap for UI.
 Future Scope: Integration with face-recognition for automatic attendance.

You might also like