Phishing Email Analysis
Phishing Email Analysis
Email Analysis
NELSON OJOVBO
https://www.linkedin.com/in/nelson-ojovbo/
Introduction to Phishing
Phishing attack is a type of attack aimed at stealing personal data of the user in general by clicking on malicious
links to the users via email or running malicious files on their computer.
Phishing attacks correspond to the "Delivery" phase in the Cyber Kill Chain model created to analyze cyber-
attacks. The delivery stage is the step where the attacker transmits the previously prepared harmful content to the
victim systems / people.
The Phishing attack is the most common attack vector for initial access. Of course, the only purpose of the attack
is not to steal the user's password information.
The purpose of such attacks is to exploit the human factor, the weakest link in the chain. Attackers use phishing
attacks as the first step to infiltrate systems.
What is phishing email analysis?
Phishing email analysis involves studying the content of phishing emails to ascertain the techniques the attacker used.
Common indicators of a phishing email include suspicious addresses, links, or domain names, threatening language or a
sense of urgency, errors in the email, the inclusion of suspicious attachments, and emails requesting sensitive information.
Phishing attack flow
Spoofing
Attackers can send emails on behalf of someone else, as the emails do not necessarily have an authentication
mechanism. Attackers can send mail on behalf of someone else using the technique called spoofing to make the
user believe that the incoming email is reliable.
Several protocols have been created to prevent the Email Spoofing technique. With the help of SPF, DKIM and
DMARC protocols, it can be understood whether the sender's address is fake or real. Some mail applications do
these checks automatically. However, the use of these protocols is not mandatory and in some cases can cause
problems.
To find out manually whether the mail is spoof or not, SMTP address of the mail should be learned first. SPF,
DKIM, DMARC and MX records of the domain can be learned using tools such as Mxtoolbox. By comparing the
information here, it can be learned whether the mail is spoof or not.
Since the IP addresses of the big institutions using their own mail servers will belong to them, it can be examined
whether the SMTP address belongs to that institution by looking at the whois records of the SMTP IP address.
An important point here is that if the sender address is not spoof, we cannot say mail is safe. Harmful mails can
be sent on behalf of trusted persons by hacking corporate / personal email addresses. This type of cyber attacks
has already happened, so this possibility should always be considered.
E-mail Traffic Analysis
Many parameters are needed when analyzing a phishing attack. We can learn the size of the attack and the target
audience in the search results to be made on the mail gateway according to the following parameters.
Sender Address
SMTP IP Address
Email Address Domain
Subject (sender address and SMTP address may be constantly changing).
In the search results, it is necessary to learn the recipient addresses and time information besides the mail
numbers.
If harmful e-mails are constantly forwarded to the same users, their e-mail addresses may have leaked in some
way and shared on sites such as PasteBin.
Attackers can find email addresses with theHarvester tool on Kali Linux. It is recommended that such information
should not be shared explicitly, as keeping personal mail addresses on websites would be a potential attack
vector for attackers.
If mails are sent out of working hours, the attacker may be living on a different time -zone line. By gathering such
information, we can begin to make sense of the attack.
In this section, we will explain what the header information in an email is, what can be done with this information and how
to access this information. It is important to follow this section carefully as we will explain how to perform the header
analysis in the next section.
What is an Email Header?
"Header" is basically a section of the mail that contains information such as sender, recipient and date. In addition, there
are fields such as "Return-Path", "Reply-To", and "Received". Below you can see the header details of a sample email.
The "From" field in the internet header indicates the name and email address of the sender.
To
This field in the mail header contains the email's receiver's details.
It includes their name and their email address. Fields like CC (carbon copy) and BCC (blind carbon copy) also fall
under this category as they all include details of your recipients.
If you want to find out more about carbon copy and blind carbon copy, check out how to use CC and BCC.
Date
This is the timestamp that shows when the email was sent.
In Gmail, it usually follows the format of "day dd month yyyy hh:mmss
So if an email had been sent on the 16th of November, 2021, at 4:57:23 PM, it would show as Wed, 16 Nov 2021
16:57:23.
Subject
The subject mentions the topic of the email. It summarizes the content of the entire message body.
Return-Path
This mail header field is also known as Reply-To. If you reply to an email, it will go to the address mentioned in
the Return-Path field.
The Domain Key and Domain Key Identified Mail (DKIM) are email signatures that help email service providers
identify and authenticate your emails, similar to SPF signatures.
Message-ID
The Message ID header field is a unique combination of letters and numbers that identifies each mail. No two emails will
have the same Message ID.
MIME-Version
Multipurpose Internet Mail Extensions (MIME) is an internet standard of encoding. It converts non-text content like
images, videos, and other attachments into text so they can be attached to an email and sent through SMTP (Simple Mail
Transfer Protocol).
Received
The received field lists each mail server that went through an email before arriving in the recipient's inbox. It's listed in
reverse chronological order — where the mail server on the top is the last server the email message went through, and
the bottom is where the email originated.
X-Spam Status
The X-Spam Status shows you the spam score of an email message.
First, it'll highlight if a message is classified as spam.
Then, the spam score of the email is shown, as well as the threshold for the spam for the email.
An email can meet either the spam threshold of an inbox or exceed it. If it's too spammy and exceeds the threshold, it will
automatically be classified as spam and sent to the spam folder.
Reference of Field Definitions: gmass.co
Outlook
Practice Questions
Download the email above, if we want to answer this email, what would the recipient’s address be?
What year was the email sent?
What is the Message-ID value? (without > < )
Here are the key questions we need to answer when checking headings during a Phishing analysis:
password: infected
Download Link: https://drive.google.com/file/d/1x4BQF9zdR2l913elSQtixb-kmi9Jan_6/view
If we look at who is sending the mail ("sender"), we see that it came from the domain Letsdefend.io
So under normal circumstances, "letsdefend.io" should use, "101[.]99.94.116" to send mail. To confirm this situation, We
can query the MX servers actively used by "letsdefend.io"
"mxtoolbox.com" helps by showing you the MX servers used by the domain you searched.
If we look at the image above, the "letsdefend.io" domain uses Google addresses as an email server. So there is no
relationship with the emkei[.]cz or "101[.]99.94.116" addresses.
In this check, it was determined that the email did not come from the original address, but was spoofed.
Returning to the e-mail we downloaded above, all we have to do is compare the email addresses in the "From" and
"Reply-to" fields.
As you can see, the data is different. In other words, when we want to reply to this e-mail, we will send a reply to the gmail
address below. Just because this data is different doesn't always mean it's definitely a phishing email, we need to consider
the event as a whole. In other words, in addition to this suspicious situation, if there is a harmful attachment, URL or
misleading content in the e-mail content, we can understand that the e-mail is phishing.
Course Files
LAB Questions
Static Analysis
It is a fact that mails composed of plain text are boring. For this reason, mail applications provide HTML support, allowing
the creation of mails that can attract more attention of users. Of course, this feature has a disadvantage. Attackers can
create e-mails with HTML, hiding URL addresses that are harmful behind buttons / texts that seem harmless.
As seen in the image above, the address that the user sees can be different when the link is clicked (the real address is
seen when the link is hovered).
Attackers take a new domain address in most phishing attacks and do a phishing attack within a few days and finish their
work. For this reason, if the domain name in the mail is new, it is more likely to be a phishing attack.
It is possible to find out whether the antivirus engines detect the web address as harmful by searching the web addresses
in the mail on VirusTotal. If someone else has already analyzed the same address / file in VirusTotal, VirusTotal does
not analyze from scratch, it shows you the old analysis result. We can use this feature both as an advantage and
a disadvantage.
If the attacker searches the domain address on VirusTotal without containing harmful content on it, that address will
appear harmless on VirusTotal, and if it goes unnoticed, you may be mistaken for this address to be harmless.
In the image above, you can see that umuttosun.com address appears harmless, but if you look at the section marked
with the red arrow, you will see that this address was searched 9 months ago, and this result is 9 months ago. To have
it analyzed again, the button marked with the blue arrow must be pressed.
Performing static analysis of the files in the mail can enable the learning of the capacity / capabilities of that file. However,
since static analysis takes a long time, you can get the information you need more quickly with dynamic analysis.
Cisco Talos Intelligence has search sections where we can learn reputations of IP addresses. By searching the
SMTP address of the mail we detected on Talos, we can see the reputation of the IP address and find out whether
it is included in the blacklist. If the SMTP address is in the blacklist, it can be understood that an attack was made
on a compromised server.
Likewise, the SMTP address can be searched on VirusTotal and AbuseIPDB to determine if the IP address has
previously been involved in malicious activities.
Dynamic Analysis
URLs and files can be found in the mail. These files and URL addresses need to be examined. You don't want your data
to be stolen by hackers by running these files on your personal computer. For this reason, the websites and files in the
mail should be run in sandbox environments and the changes made on the system should be examined, and it should be
checked whether they are harmful or not.
If you want to quickly check the web addresses in the mail, you can see the content of the website using online
web browsers such as Browserling. The good thing about such services is that you will not be affected by a possible
zero-day vulnerability that affects browsers, since you do not go to the web page on your own computer.
The disadvantage of using web browsers such as Browserling is that if the malicious file is downloaded on the
site, you cannot run this file. For this reason, your analysis will be interrupted.
VMRay
Cuckoo Sandbox
JoeSandbox
AnyRun
Hybrid Analysis(Falcon Sandbox)
NOTE
Malware can wait for a certain period of time without any action to make detection difficult. You must wait for the
malware to work before you decide that the examined file is not harmful.
The fact that there are no urls and files in the mail does not mean that this is not harmful. The attacker can also
send it as a picture so as not to get caught up in the analysis products
Additional Techniques
Another technique that attackers use is to perform phishing attacks using normally legal sites. Some of them are as
follows.
A. Using services that offer Cloud Storage services such as Google and Microsoft
Attackers try to click on Google / Microsoft drive addresses that seem harmless to the user by uploading harmful files
onto the drive.
B. Using services that allow creating free subdomains such as Microsoft, Wordpress, Blogspot, Wix
Attackers try to deceive security products and analysts by creating a free subdomain from these services. Since whois
information cannot be searched as a subdomain, it can be seen that these addresses were taken in the past and belongs
to institutions such as Microsoft, WordPress.
C. Form applications
Services are available that allow free form creation. Attackers use these services instead of creating a fishing site
themselves. Since the domain is harmless under normal conditions, it can pass on to the user without getting stuck on
antivirus software. Google Form is an example of these services. When looking at whois information, the domain can be
seen to be Google, so the attacker can mislead analysts.
Some defensive layers to take into consideration to assist in preventing email phishing attacks and credential stealing
from phishing attacks would be:
REFERENCE
https://app.letsdefend.io/training/lessons/phishing-email-analysis
https://www.linkedin.com/pulse/phishing-email-simple-analysis-asif-ali/
https://www.imperva.com/blog/our-analysis-of-1019-phishing-kits/