Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Week-12 - Network Forensics Lab 2: Email Reconstruction


Aim

Reconstruct email communications from captured SMTP traffic. You will extract sender/recipient information, decode Base64-encoded credentials, and recover the full email content including attachments.


Learning Objectives

  • Understand the SMTP protocol and how email is transmitted
  • Identify email metadata in packet captures
  • Decode Base64-encoded usernames and passwords
  • Reconstruct complete email messages from network traffic
  • Extract timestamps for forensic timelines

Resources Needed


Background

RECAP: Simple Mail Transfer Protocol (SMTP)

SMTP is used for sending email across the Internet. It is a plain text protocol, meaning data is not encrypted by default.

PortUsage
25Standard SMTP (unencrypted)
587SMTP with STARTTLS
465SMTPS (SMTP over SSL)

SMTP Commands

CommandPurpose
EHLO/HELOClient greeting to server
AUTH LOGINStart authentication
MAIL FROMSender's email address
RCPT TORecipient's email address
DATAStart of message content
QUITEnd session

SMTP Response Codes

CodeMeaning
220Service ready
235Authentication successful
250OK / Command completed
334Server challenge (Base64 encoded)
354Start mail input

Base64 Encoding

SMTP uses Base64 to encode credentials during AUTH LOGIN. Base64 is encoding, not encryption - it can be easily decoded. This is why unencrypted SMTP is a security risk.


Part A: Initial Traffic Analysis

Task 1: Open and Filter SMTP Traffic

  1. Open smtp.pcap in Wireshark
  2. Observe the packet list

Q1.1: How many packets are in this capture?

Your Answer: _______________________________________________

Click to reveal answer

Answer: 53 packets


Q1.2: What is the IP address of the email client?

Your Answer: _______________________________________________

Click to reveal answer

Answer: 10.10.1.4


Q1.3: What is the IP address of the mail server?

Your Answer: _______________________________________________

Click to reveal answer

Answer: 74.53.140.153


Q1.4: What port is used for SMTP communication?

Your Answer: _______________________________________________

Click to reveal answer

Answer: Port 25


Task 2: Identify the Mail Server

  1. Find the first SMTP response packet (look for code 220 "Service ready")
  2. Examine the server's greeting message

Q2.1: What is the hostname of the mail server?

Your Answer: _______________________________________________

Click to reveal answer

Answer: xc90.websitewelcome.com


Q2.2: What mail software is the server running?

Your Answer: _______________________________________________

Click to reveal answer

Answer: Exim 4.69


Q2.3: What warning does the server provide in its greeting?

Your Answer: _______________________________________________


Click to reveal answer

Answer: "We do not authorize the use of this system to transport unsolicited, and/or bulk e-mail."


Part B: Authentication Analysis

Task 3: Find the Authentication Sequence

  1. Look for the AUTH LOGIN command from the client
  2. Examine the server's responses (334 codes) and client's replies

Q3.1: What authentication method is used?

Your Answer: _______________________________________________

Click to reveal answer

Answer: AUTH LOGIN


Q3.2: What packet number contains the AUTH LOGIN command?

Your Answer: _______________________________________________

Click to reveal answer

Answer: Packet 10


Q3.3: The server responds with a 334 code and a Base64 challenge. What is the Base64 string in the server's first challenge?

Your Answer: _______________________________________________

Click to reveal answer

Answer: VXNlcm5hbWU6


Q3.4: What does this Base64 string decode to?

Your Answer: _______________________________________________

Click to reveal answer

Answer: Username:


Task 4: Extract and Decode Credentials

  1. Find the client's response to the username challenge (packet after 334)
  2. Find the client's response to the password challenge

Q4.1: What is the Base64-encoded username string sent by the client?

Your Answer: _______________________________________________

Click to reveal answer

Answer: Z3VycGFydGFwQHBhdHJpb3RzLmlu


Q4.2: What is the Base64-encoded password string sent by the client?

Your Answer: _______________________________________________

Click to reveal answer

Answer: cHVuamFiQDEyMw==


Task 5: Decode the Credentials

  1. Use Python or an online decoder to decode the Base64 strings:

Python method:

import base64
print(base64.b64decode("Z3VycGFydGFwQHBhdHJpb3RzLmlu").decode('utf-8'))
print(base64.b64decode("cHVuamFiQDEyMw==").decode('utf-8'))

Command line method:

echo "Z3VycGFydGFwQHBhdHJpb3RzLmlu" | base64 -d
echo "cHVuamFiQDEyMw==" | base64 -d

Q5.1: What is the decoded username (email address)?

Your Answer: _______________________________________________

Click to reveal answer

Answer: gurpartap@patriots.in


Q5.2: What is the decoded password?

Your Answer: _______________________________________________

Click to reveal answer

Answer: punjab@123


Q5.3: What SMTP response code indicates successful authentication?

Your Answer: _______________________________________________

Click to reveal answer

Answer: 235 (Authentication succeeded)


Q5.4: Why is sending credentials over unencrypted SMTP a security risk?

Your Answer: _______________________________________________


Click to reveal answer

Answer: Base64 is encoding, not encryption. Anyone capturing the network traffic can easily decode the credentials. The username and password are effectively transmitted in plain text.


Part C: Email Reconstruction

Task 6: Extract Email Metadata

  1. Find the MAIL FROM command
  2. Find the RCPT TO command

Q6.1: Who is the sender of the email (MAIL FROM)?

Your Answer: _______________________________________________

Click to reveal answer

Answer: gurpartap@patriots.in


Q6.2: Who is the recipient of the email (RCPT TO)?

Your Answer: _______________________________________________

Click to reveal answer

Answer: raj_deol2002in@yahoo.co.in


Task 7: Follow the TCP Stream

  1. Right-click on any SMTP packet → Follow → TCP Stream
  2. This displays the complete SMTP conversation

Q7.1: What email client software was used to send this email? (Look for X-Mailer header)

Your Answer: _______________________________________________

Click to reveal answer

Answer: Microsoft Office Outlook 12.0


Q7.2: What is the Subject of the email?

Your Answer: _______________________________________________

Click to reveal answer

Answer: SMTP


Q7.3: What is the Date header of the email?

Your Answer: _______________________________________________

Click to reveal answer

Answer: Mon, 5 Oct 2009 11:36:07 +0530


Q7.4: What is the Message-ID?

Your Answer: _______________________________________________

Click to reveal answer

Answer: 000301ca4581$ef9e57f0$cedb07d0$@in


Q7.5: What is the sender's display name (From header)?

Your Answer: _______________________________________________

Click to reveal answer

Answer: Gurpartap Singh


Task 8: Extract Email Content

  1. In the TCP stream, find the email body (after the DATA command and headers)

Q8.1: What is the Content-Type of the email?

Your Answer: _______________________________________________

Click to reveal answer

Answer: multipart/mixed (contains both text and attachments)


Q8.2: What is the plain text content of the email message?

Your Answer: _______________________________________________



Click to reveal answer

Answer:

Hello

I send u smtp pcap file

Find the attachment

GPS

Q8.3: Is there an attachment? If so, what is the filename?

Your Answer: _______________________________________________

Click to reveal answer

Answer: Yes, there is an attachment named "NEWS.txt"


Part D: Timeline Construction

Task 9: Build a Forensic Timeline

Using packet timestamps and the email headers, complete this timeline:


Q9.1: What is the timestamp of the first packet in the capture?

Your Answer: _______________________________________________

Click to reveal answer

Answer: 2009-10-05 06:06:07 UTC (approximately)


Q9.2: What is the total duration of the SMTP session?

Your Answer: _______________________________________________

Click to reveal answer

Answer: Approximately 8 seconds


Q9.3: Complete this SMTP session timeline:

StepEventPacket #
1TCP handshake begins
2Server ready (220)
3Client greeting (EHLO)
4AUTH LOGIN
5Username sent
6Password sent
7Authentication successful (235)
8MAIL FROM
9RCPT TO
10DATA command
11Email content transferred
12Message accepted
Click to reveal answer
StepEventPacket #
1TCP handshake begins1-5
2Server ready (220)6
3Client greeting (EHLO)7
4AUTH LOGIN10
5Username sent12
6Password sent14
7Authentication successful (235)15
8MAIL FROM16
9RCPT TO18
10DATA command20
11Email content transferred21+
12Message acceptedNear end

Part E: Export and Verification

Task 10: Export Email Objects

  1. Go to File → Export Objects → IMF (Internet Message Format)
  2. Check if Wireshark can extract the email message

Q10.1: Was Wireshark able to extract the email as an .eml file?

Your Answer: _______________________________________________

Click to reveal answer

Answer: Yes, Wireshark can export SMTP emails via Export Objects → IMF


Q10.2: What additional analysis could you perform on the exported email?

Your Answer: _______________________________________________


Click to reveal answer

Answer:

  • Open in email client to view formatted content
  • Extract and examine the attachment
  • Analyse full headers for routing information
  • Check for additional metadata or hidden content

Key Findings

In this lab, you reconstructed an email with the following details:

FieldValue
SenderGurpartap Singh gurpartap@patriots.in
Recipientraj_deol2002in@yahoo.co.in
SubjectSMTP
DateMon, 5 Oct 2009 11:36:07 +0530
Client IP10.10.1.4
Mail Serverxc90.websitewelcome.com (74.53.140.153)
Email ClientMicrosoft Office Outlook 12.0
AttachmentNEWS.txt
Password Recoveredpunjab@123

Useful Wireshark Filters

FilterPurpose
smtpAll SMTP traffic
tcp.port == 25Traffic on SMTP port
smtp.req.command == "AUTH"Authentication commands
smtp.req.command == "MAIL"MAIL FROM commands
smtp.req.command == "RCPT"RCPT TO commands
smtp.response.code == 235Successful authentication

Base64 Decoding Reference

import base64
decoded = base64.b64decode("encoded_string").decode('utf-8')
print(decoded)

Best,

Ali.

Copyright © 2026 • Created by Ali Jaddoa

Page last updated: Tuesday 21 April 2026 @ 07:28:28 | Commit: e7be396