How To Catch A Phish
How To Catch A Phish
a Phish
A Practical Guide to
Detecting Phishing Emails
―
Nicholas Oles
How to Catch a Phish
A Practical Guide to Detecting
Phishing Emails
Nicholas Oles
How to Catch a Phish: A Practical Guide to Detecting Phishing Emails
Nicholas Oles
Severn, MD, USA
Acknowledgements�����������������������������������������������������������������������������xi
iii
Table of Contents
iv
Table of Contents
Index�������������������������������������������������������������������������������������������������143
v
About the Author
Nick Oles is a cybersecurity expert with over 15 years of operational
experience in military, industry, and academic environments. He has
worked on incident response and threat hunting teams and consulted
with Fortune 150 organizations, small businesses, and US Department
of Defense entities. Nick has served his country for over a decade in the
cyber and special operations communities, earning multiple military
accolades, completing worldwide deployments, and serving in joint
special operations environments. He has advised award-winning
academic centers on cyber-program development and management, as
well as created and taught academic and certification courses on a variety
of cybersecurity topics. Nick has detected, analyzed, and responded to
thousands of security incidents over his career. He continues to actively
contribute to the cybersecurity community and teach students at all skill
levels while still serving his country.
vii
About the Technical Reviewer
Ron Scott is a former coder, professor, rock climber, and mountain biker,
and is currently working for a non-profit in Cleveland, Ohio, that supports
people as they strive to become economically self-sufficient.
ix
Acknowledgements
I would have never completed this book, or much of anything frankly,
without the support of my beautiful wife, children, and parents. I’ve
stood on the shoulders of giants, and I thank all my mentors, friends, and
weekend warrior Fernandez boys for the continuous stream of poorly
crafted insults, coaching, and occasional encouragement along the way.
I wasn’t always the smartest person in the room, but I was always the
best looking.
xi
CHAPTER 1
Step 1
The message is composed in the mail application. This is where you—the
sender—open the email and input an email message. This includes the
recipient’s email address, the subject, a brief description of the email
message, and the body—the content of the message. The mail client
should preconfigure the sender’s address. Once you click the Send button,
the message disappears and begins a mystical journey.
2
Chapter 1 How Email Works
Step 2
The sender’s email server is always the first stop for your email message.
This can be a Windows or Linux server, and communication from your
device to the sending email server is done over port 25 using the protocol
Simple Mail Transport Protocol, or SMTP. Ports are only discussed briefly
in this section, the overall concept is more important than memorizing
specific port numbers. The message travels from your desktop through a
series of routers and network switches and stops at its first destination—
the SMTP server.
Once the SMTP server receives the message, it examines the sender
and recipient information. The message is delivered internally if the
recipient and the sender are members of the same domain. The domain
for email purposes is simply the name after the @ symbol in the email
address (@aol.com, @gmail.com, @yahoo.com). For instance, suppose
[email protected] sends an email to [email protected].
3
Chapter 1 How Email Works
Because the message domains (thenetdefender) are the same, the message
can be delivered internally. The SMTP server sends the message to a
POP3/IMAP server to be delivered to the recipient.
Step 3
If the sender address and recipient address have different domains,
the message needs to be sent out externally through the Internet to
be delivered. This would occur if [email protected] sent an
email to [email protected]. The SMTP server would identify the domains’
differences and must resolve the domain @aol.com to an internet
protocol (IP) address. Networking equipment on the Internet function on
IP addresses instead of domain names. This means the devices resolve
and communicate with unique IP addresses; for AOL, this might be
106.10.248.150 or 124.108.115.100. To resolve or look up a particular IP
address for a supplied domain name, the SMTP server uses a domain
name server, also known as a DNS server.
The DNS server operates similarly to a phone book. For those
unfamiliar, phone books were physically delivered to every residential
home and contained the names and phone numbers of individuals and
businesses within the area. This allowed residents to look up an individual
or business name and find the associated phone number to call.
A DNS server works similarly but with domain names and IP
addresses. For example, a server has no idea where www.cnn.com is
located or where any email addresses with the domain @cnn.com might
be located on the Internet. It must resolve cnn.com to an IP address. The
DNS server checks a list of internally stored domains and IP addresses to
see if it has a match for cnn.com. If it does, it locates and provides the IP
address, which for cnn.com is 151.101.1.67. The DNS server then sends the
data packet containing the email message to the appropriate SMTP server
identified through the domain to IP address lookup.
4
Chapter 1 How Email Works
Step 4
The message packet has arrived at the recipient’s SMTP server. The path
it takes from here is executed in reverse order of the sending mail traffic.
After hitting the SMTP server, the data packet travels to the POP3/IMAP
server over port 110/143. It then waits on this server for the appropriate
mail client to request any new messages and deliver the message.
Step 5
Contrary to popular belief, a message doesn’t simply appear through
sorcery and magic in your inbox. Once you open your mail client, the
application checks in with the POP3/IMAP server and requests any
messages it has for delivery. The POP3/IMAP server checks its mail and
delivers any messages stored in the queue for the identified mailbox. It is
then delivered to the recipient and downloaded for your viewing pleasure.
Now you know the basic path an email message takes—from the
client, through a series of servers and networking devices, to the intended
recipient. This happens flawlessly in most cases. But what happens if the
recipient’s address is mistyped or no longer a valid email address? What
if the company closes and or the person has moved on? In this case, the
recipient cannot receive the email message; but hopefully, the sender will
receive a notification that the email was undeliverable. An undeliverable
message is sent to the sender, informing them that the intended recipient’s
address is invalid. The following are some of the common reasons emails
are not delivered.
5
Chapter 1 How Email Works
6
Chapter 1 How Email Works
7
Chapter 1 How Email Works
Once you have entered the More menu, you can locate and click the
Show Original option. This should open a new browser tab and return the
results shown in Figure 1-4. You are now accessing the header information
for the email you selected. You can follow this process for any message
received in the Gmail web application.
8
Chapter 1 How Email Works
When using Yahoo!, you must locate the More options menu. In
Yahoo!, this is located in the center of the page when hovering over the
original email. See Figure 1-6 below for a screenshot of a current message,
the More options button is in the bottom and center of the page. Once
located, you must select the View Raw Message option. This opens the raw
message header in a new browser tab.
10
Chapter 1 How Email Works
11
Chapter 1 How Email Works
12
Chapter 1 How Email Works
You have now learned some options to view and collect email headers
from three main email applications. A number of other mail applications
exist, but covering each application would be exhausting and minimally
useful. Instead, it is far better to understand the basic concepts and
apply them to your specific mail application. Finally, it is important to
understand that you must locate the mail header for the original message.
A forward or reply to the message results in a new and vastly different
email header. Always locate the original email and use it to examine the
header information. It provides the most forensically sound and accurate
information.
13
Chapter 1 How Email Works
MxToolbox
The MxToolbox Email Header Analyzer is a mail vendor-agnostic tool that
parses and reads headers from any mail client or application. It also offers
several free and paid services to analyze IP addresses, domains, and email
traits. Figure 1-11 shows the initial landing page at https://mxtoolbox.
com/Public/Tools/EmailHeaders.aspx.
14
Chapter 1 How Email Works
Simply paste the raw header information into the dialog box and click
the Analyze Header button. The page refreshes with a report showing
the information analyzed from the raw header message. The information
displayed is much easier to read and identify key details from the message.
Let’s review each section, as shown in Figure 1-12, and highlight some
of the relevant points.
15
Chapter 1 How Email Works
16
Chapter 1 How Email Works
17
Chapter 1 How Email Works
18
Chapter 1 How Email Works
19
Chapter 1 How Email Works
20
Chapter 1 How Email Works
Summary
This chapter discussed many of the technical details and topics regarding
email. This information is crucial in beginning your journey investigating
and identifying malicious email messages. Understanding the path and
underlying technologies associated with a particular message aid in your
adventures and thwarting activities. You explored how a message goes
from a mail client through a series of servers and is delivered to its final
destination anywhere in the world. The chapter also explained email
headers, how to locate email headers on various mail platforms, and tools
to help read and use the information stored in an email header. Now it is
your turn to try analyzing email headers on your own; find some email
messages and plug them into a few tools!
This chapter explained how email works, starting with the desktop or
web application, through multiple servers, traversing the Internet, and
being delivered to the intended recipient.
21
CHAPTER 2
Phishing Tactics
and Techniques
Chapter 1 covered the basic components of email messages and headers.
Now it is time to get into attack techniques. Attackers use techniques
and tricks to entice end users to click a link, open an attachment, or send
sensitive information unwittingly. Understanding these techniques helps
you identify and scrutinize email messages that employ these or similar
tactics. Before jumping into the nitty-gritty details, let’s go over some of
the basics.
Social engineering is the art of manipulating people to provide
sensitive information or take a specific action. Art is an important word
here, as this typically requires some soft skills and persuasion to achieve
the desired results. The types of information sought varies, but the
attackers usually try to trick you into providing sensitive information such
as passwords or sensitive banking information, or attempt to access your
computer secretly using installed malicious software. This software is often
referred to as malware.
Social engineering is a technique that can be used both in person
and remotely. In this book, I refer almost exclusively to the remote or
digital use of social engineering. Figure 2-1 shows some of the main social
engineering tactics.
24
Chapter 2 Phishing Tactics and Techniques
• The offer feels too good to be true. Have you ever won
the lottery without having bought a lottery ticket? This
typically doesn’t happen. Attackers often promise fame
and fortune for completing a desired action. It could
be the promise of a large sum of money if you first send
a small amount, provide your banking information,
or click a link to claim your prize. If it seems like your
lucky day, it probably isn’t.
25
Chapter 2 Phishing Tactics and Techniques
• You’re receiving help that you didn’t ask for. This often
comes in the form of technical support in which the
attackers offer to fix a problem you didn’t know existed.
If you didn’t request help, it’s likely suspicious and
potentially malicious. Verify the assisting party through
a different mode of communication, like a phone call,
before providing information.
26
Chapter 2 Phishing Tactics and Techniques
27
Chapter 2 Phishing Tactics and Techniques
Attack techniques and methods are developed and altered every day.
No single, fully comprehensive list exists that can cover every possible
scenario. These attacks have been continual and are rising in popularity.
The methods explained can and are often combined to increase
effectiveness. Visually inspecting and identifying suspicious traits is a
critical step in catching a phish.
Figure 2-4 shows a message sent regarding a password reset for a
university account.
28
Chapter 2 Phishing Tactics and Techniques
In Figure 2-4, you first read the subject and see it instantly portrays a
sense of urgency and panic in the reader, stating their password will expire
in one day. This instantly heightens our emotions and makes the request
time-sensitive. The message contains a link that could be suspicious and
uses a generic greeting instead of the recipient’s name. Stay calm, don’t
click, we will examine this in more detail later.
29
Chapter 2 Phishing Tactics and Techniques
30
Chapter 2 Phishing Tactics and Techniques
Summary
This chapter covered some of the many methods used by attackers.
These techniques continue to change and evolve over time. The chapter
also explored various attack techniques, defined social engineering, and
provided some key indicators of suspicious messages to look out for. The
coming chapters expand on these methods and identify ways to handle
suspicious messages safely. This is an iterative process, which we continue
to build on as you progress through this book!
31
CHAPTER 3
Incident Response
In addition to identifying suspicious messages, you need to have a plan to
respond appropriately. Several frameworks or models exist to help support
and lead the response efforts. The SANS organization has created and
teaches one of the easiest and most relevant frameworks, PICERL, which is
explained in this chapter. First, let’s discuss some terms that help us better
understand this framework and then we will dive into PICERL.
A security incident is an occurrence that jeopardizes the confidentiality,
integrity, or availability of an information system. The incident can come
in many shapes and sizes, but this book focuses on suspicious email
messages. The messages are sent from attackers to victims, containing
malicious links,attachments, or eliciting sensitive information. An attacker
could compromise the system if a user interacts with a nefarious message.
Incident response is an organized approach to addressing and
managing the aftermath of a security incident. It is the combined effort or
actions taken to investigate, mitigate, and recover from an identified event.
Malware is software designed to disrupt, damage, or gain unauthorized
access to a computer system. It is commonly delivered in malicious links
or attachments through email messages. We previously referenced this as
malicious software in a previous chapter.
An incident response framework is a process or procedure used to
guide the response efforts of an incident. PICERL is near and dear to
my heart and is my recommended response framework, although other
frameworks exist and contain similar or overlapping information.
PICERL
Sans.org is one of the world’s leading cybersecurity training and
certification organizations. It attracts some of the communities best and
brightest researchers, students, and instructors. They created the PICERL
process; and teach this incident response framework to students in several
certification courses. Figure 3-1 depicts the six-step incident response
process.
Let’s break down each phase and discuss how it applies to phishing
emails and responses.
34
Chapter 3 Incident Response
Preparation
Preparation entails everything done before an incident occurred. These are
the security controls you are using, any data you have proactively restored,
and the plan you must execute if your machine becomes compromised.
Users should back up sensitive data daily or weekly to minimize the impact
of lost or compromised information systems. Ideally, data should be stored
on two different media types, such as a USB drive and an external hard
drive. The following cyber-hygiene recommendations help users minimize
the impact of security incidents and recover faster.
Identification
Identification involves searching, documenting, and researching indicators
of suspicious or malicious activity. Phishing messages focus on the sender,
the body’s content, and any links and attachments. These are all potential
35
Chapter 3 Incident Response
Containment
Containment involves isolating the impacted information system and
preventing any further damage. You want to place the information system
in a self-contained space to keep it from interacting or spreading to other
systems. With phishing emails, you should immediately disconnect the
machine from the wireless or wired network to stop or limit the spread to
36
Chapter 3 Incident Response
other devices on the network. If not done already, you would then begin
to scrutinize the links and attachments you received in emails. You should
run a full antivirus scan and ensure you are up to date with your operating
system and installed applications. Figure 3-3 depicts a potentially infected
machine being isolated and contained on the network.
Eradication
Eradication removes the malicious software from the machine. Often this
is done automatically by the antivirus program, but if not, you may need
to remove the malware manually. In most cases, if malware is identified
and cannot be removed using antivirus software, it is advised to reimage
the laptop or restore it to its factory default settings. Any data stored on the
laptop that was not backed up is likely lost. This is why daily and weekly
backups are critical to minimizing a computer incident’s impact.
The following are steps to eradicate malicious software from a machine.
37
Chapter 3 Incident Response
Recovery
Once you have identified and removed the malware, it is time to return
our machine to a good, known working state. This entails installing all
necessary software and ensuring the proper configurations are in place.
You want to test your machine and confirm that you can do everything on
the machine that you could do prior to the incident. You are putting the
device back into full functionality, and now is the time to ensure things are
set up correctly and safely. Figure 3-4 depicts a machine being restored to
its good known state prior to the incident.
38
Chapter 3 Incident Response
Lessons Learned
The final phase of the incident response process is to identify ways to
improve your system and incident response plan moving forward. You
should identify what went well before, during, and after your incident. You
should then identify what didn’t go well and ways to improve. Examples
might include restoring and testing your stored data monthly, reviewing
emails closer, or switching to better antivirus software. The lessons
learned section is intended to make this an iterative and self-improving
process. See Figure 3-5 depicting the PICERL process in a flow chart.
39
Chapter 3 Incident Response
Summary
You learned about the PICERL process and how you can apply this to your
environment while responding to security incidents. This iterative and
extensible framework can be applied in any environment, regardless of
size, including your home network or office environment. The process is
intended to help guide you through responding to an incident. Your plan
should be practiced and prepared before the incident occurs for the best
results, which helps minimize the impact of an attack and quickly recover.
The more time and thought put into your plan before the incident, the
better chance that the results will be in your favor.
40
CHAPTER 4
Analyzing Message
Content
How you say something is often far more important than what you say.
This saying is relevant in our digital age as more human-to-human
communication is moved from in-person to discussion using digital
communication. The latest and greatest gadgets have given us the pleasure
of carrying around supercomputers in each of our pockets capable of
nearly any form of communication imaginable, including voice, data,
video, and screen-sharing abilities. Attackers understand that more
communication occurs in the digital realm and have looked at non-
technical ways to persuade, illicit, and trick victims into providing sensitive
information through message content. This chapter explains some of these
techniques and how to identify things that don’t seem right.
What Is Content?
Before diving into all the details of how and why attackers craft
messages the way they do, let’s discuss the content of an email message.
The information in the email message is typically written words, but
sometimes images or symbols. It is how the sender of the message conveys
information to the recipient. This comes in all shapes, sizes, and levels of
sophistication, but nearly all email messages have some form of content
to convey information from one entity to another. Figure 4-1 shows an
example of message content.
The highlighted box in red shows the message content from the sender
to the recipient. By reading the content, you can see that the sender starts
with a greeting to the recipient of Hello Friend and then requests a location
and time for lunch. The sender finished the message with a simple closing
stating Thanks!. The greeting and closing become more pertinent as you
progress through the chapter. Right now, focus on understanding the
content is the written information the sender provides to the recipient.
Text is not the only method to communicate an intended message
via email. Many messages, frequently marketing related, contain images
and graphics that convey the intended content. This can be as simple as
an advertisement for your favorite movie, clothing brand, or sports drink.
The advertiser could send a billboard-type message to the recipient to
promote the product or service of their choosing. Clicking any portion of
the image directs you to a website determined by the sender. This activity
can be used for marketing or advertising purposes and nefarious activity.
Figure 4-2 shows an example of a message containing a clickable image
with some text built into the image.
42
Chapter 4 Analyzing Message Content
Now that you understand the basics of message content let’s discuss
how attackers use content to target victims. In most phishing campaigns,
the attacker’s desired outcome is for the victim to act. The attacker plans
out his strategy much like a sports team or the coach plans out a game
strategy. They first evaluate the intended audience learning as much as
they can to help improve their odds of success. This information gathering
process is often referred to as reconnaissance. They then evaluate the
technologies and processes needed to create, deliver, and capitalize on the
phishing message sent to the victim. This is often referred to as the actors
43
Chapter 4 Analyzing Message Content
44
Chapter 4 Analyzing Message Content
The way the attacker convinces the victim to click the link is often
referred to as a tradecraft. They use this specific theme or process to
convince the victim to click the link, download the attachment, or provide
sensitive information. Each attacker takes a slightly different approach,
but it is possible to identify these trends with enough time and resources.
Using well-crafted content is the easiest and fastest way for an attacker to
spin up a campaign. This requires very little technology or infrastructure
setup to send a convincing email. These are often the hardest emails to
detect with modern security tools and technologies that focus on link
analysis and email attachment scanning.
The best way to defend against these attacks is through training. To aid
in the training value, look at some phishing emails, such as Figure 4-4, and
review each message’s suspicious components. This habit becomes more
natural with practice and time, and soon you are catching phishing emails
on your own without even realizing it!
Figure 4-4 shows an email message sent from one email account to
another. The content of the message looks to be an automated email
regarding an invoice. The sender appears to be from an organization
or person named Rackspace, which happens to be a large information
45
Chapter 4 Analyzing Message Content
Message Greetings
Attackers often use these types of generic greetings to reach a larger
audience without needing customization. Greetings such as Valued
Vustomer, Friend, Dear Account Holder, Hi Dear, and other variations
should all alert you that this greeting is not specific to you and therefore
has the potential to be an indicator of suspicious activity. Furthermore,
misspellings of these or other greetings could also cause concern.
Attackers are located all over the world, and English is often not always
the first spoken language. Spelling errors could indicate an attacker hastily
writing a phishing email and sending it out without proper proofreading.
These are both signs of potential suspicious activity. None of them should
be used as sole sources for identification, but rather a series of clues with
other factors that can aid you in your determination.
Next, let’s look at the body of the message. The message says you have
an unpaid balance. To solve this situation, you must click the provided link
to settle your bill. The link is only good for 24 hours, insinuating that you
only have a short period of time to take action. The content of this message is
inciting a sense of urgency and action for the recipient. A past-due account
46
Chapter 4 Analyzing Message Content
and a link to remediate the issue within only 24 hours puts the reader on
edge. Seeing all these things makes the reader think they must act quickly
to fix this problem or face some adverse action. This is a good example of
inciting urgency and eliciting the action of clicking a specified link.
47
Chapter 4 Analyzing Message Content
here. First, the sender is trying to appear as if the message is coming from
McAfee by displaying the name McafeeRenewal. However, the attackers
did a poor job of masking the sender address, and the mail application
rendered a different sender address. This could have also been determined
using email header analyzer tools that we discussed in previous chapters.
The sender’s address looks suspicious at best and likely malicious. It
contains several letters and numbers that appear to be thrown together
randomly. The domain, which is everything after the @ symbol, is almost
unreadable. When reviewing the sender’s message, you want to ask if this
looks like something the sender should be using as a valid email address.
For example, someone working at McAfee likely has an email address
that ends in @mcafee.com, like [email protected]. I wouldn’t expect any
legitimate organization to use the domain xypkathgtvpg.waylytic.com.
Would you?
48
Chapter 4 Analyzing Message Content
After reviewing the subject and sender address of the message, let’s
now look at the content in the body of the email. The top of the email
contains a hyperlink informing you it’s your “final notice” on your
McAfee subscription expiring. They are nice enough to tell us that our
devices will no longer be protected. No one wants to have expired licenses
or unprotected devices. As you continue reviewing the content of the
message, you see a photo of a smiling woman using her laptop and a
limited offer for a 50% discount on McAfee Antivirus. This deal is too good
to be true. How could you ever pass this up?
Did you pick up any these or other indicators while reviewing the
content of this message? If so, what were they? Below are some points to
consider.
The initial line is an urgent request that results in our devices no longer
being protected if you do not take immediate action. This claims to be
our final notice, but did you get any notices before this? Do you use this
product at home or in the office? If the answer is no, add these to your list
of growing indicators regarding the validity of this message. You see the
woman smiling at her laptop in the photo. Images like this are often used
in the message to entice or further distract the recipient. We close out the
content with a lucrative offer to save 50% on purchasing the software and a
large red button to redeem this offer. Looking at the totality of the indicators
identified, this message would be suspicious at best and likely malicious, as
it uses urgency and adverse activities occurring if an action is not taken.
Impersonation Attempts
Attackers often impersonate or mask their identity to appear as someone
they are not, as a figure of authority or a trusted party to achieve a desired
action. Research is conducted before the attack to determine the ideal
individual to impersonate and potential targets to send messages to.
Often, the attackers impersonate a person with prestige and power within
49
Chapter 4 Analyzing Message Content
Next, look at the greeting and content of the message. The greeting
used in this message is a basic Hello Tim. You see that the sender is using
the recipient’s first name, which could be a sign that they trust, respect,
and know this person well enough to use the individual’s first name in
the greeting. It might be a sign of rapport or verification that the sender
knows who they are talking to. When you get to the content body, the
50
Chapter 4 Analyzing Message Content
sender states they are in a meeting and have an urgent request asking for a
response as soon as possible. The signature says the message is from John
Smith, the CEO of Mr. Robot Corp.
Now that you’ve read the entire message, let’s work through what
was identified and discuss potential suspicious indicators. First is the
subject, no apparent signs of suspicious activity in the subject by itself.
The sender claims to be the CEO of Mr. Robot Corp. Usually, you would
expect the email to come from someone like [email protected] or CEO@
mrrobot.com. This sender’s address is suspicious, but by itself is not
enough for us to stamp this email as malicious. If you look at the content,
the sender claims to be in a meeting and needs you to respond as soon
as possible. Is this normal activity? Does the CEO regularly email you
during meetings with immediate requests? Possibly, but in most cases,
probably not. The recipient would have to evaluate the totality of the
circumstances and determine if this is normal. In most cases, the CEO is
not making this request, which is the start of an impersonation attack. The
attacker typically asks the recipient to purchase gift cards, money orders, or
to send money in some other form to the CEO quickly while they are still in
a time sensitive meeting. The employee often oblige to avoid letting down
the CEO or in hopes of earning some brownie points with the company’s
leadership.
Multiple indicators lead us to believe that messages are suspicious
or likely malicious. To analyze email message content effectively, it is
important to review the email slowly and understand what the sender asks
you and the details surrounding the request. Does this make sense? Is this
something the sender should be requesting of me? Are there any specific
flags or areas of concern? Have I reviewed this email from top to bottom
to understand the full context and indicators that might exist? Answering
these questions and using the tips covered in this chapter and others help
you determine if the message is valid and how to proceed.
51
Chapter 4 Analyzing Message Content
Summary
This chapter dove deep into message content and how attackers can use
it to trick you. It explained spear phishing and different methods attackers
use to quickly establish credibility and entice a recipient to act. This
information should help you pick up on additional suspicious indicators as
you continue learning and improving your “Spidey senses”.
52
CHAPTER 5
What Is a Link?
A link is short for hyperlink and refers to a data point. The data point is
usually a website, but it can also point to files, folders, or documents stored
locally on the network or workstation. For phishing and email purposes,
most links are associated with websites. The website contains content that
is created and maintained by the website owner. This content can cover
any topic desired and contain various forms of data such as text, audio,
software code, or video. The content is created, stored, and modified on
a web server. Let’s pause here and help explain this a little better with an
example.
Mr. Nick wants to create a website detailing the latest cybersecurity
news articles he reads daily. Once he comes up with this idea, he must
determine how he shares it with his intended audience. He decides that a
website is the best way to attract and share content with his fellow nerds.
(Think computer enthusiast if the word nerd offends you.) Mr. Nick has
two options for storing his content. He can buy and manage his own web
server or rent one from a company. Mr. Nick decides to rent a server from a
company, as it is cheaper, easier, and faster than managing his own. Once
the server is up and running, he can start creating his content.
Next, Mr. Nick needs to make his web server accessible to the
Internet through an Internet Service Provider (ISP). Everyone with an
Internet connection has dealt with an ISP. An Internet connection allows
you to create and publish content. Mr. Nick finds a website-hosting
platform where he can quickly create and publish content. For most sites,
this free or cheap platform, such as WordPress, allows users to create
and publish content in minutes with little technical knowledge and no
development needed. Platforms like WordPress let you publish the site
through their domains for free, but many serious content creators register
their own domains.
Finally, Mr. Nick is super savvy and needs to register a domain for his
new site. The domain is the website’s name; it is used to find the content
Mr. Nick publishes. Examples of domains include cnn.com, yahoo.com,
and espn.com. Domains are registered through a domain registrar, which
is an organization that buys and sells domain names. Typically domains
are purchased for one to three years with the option to renew if desired.
The domain is very important for people to remember and recognize your
page. Once you’ve created the content, domain, and platform, you can share
hyperlinks directing people to your site. Again, the hyperlink is simply the
pointer or reference to a resource; in this case, it would be your web page.
Links in Emails
Email messages are sent at an alarming rate across the Internet, with
some resources estimating nearly 300 billion emails are sent each day.
Many of these emails are marketing and advertising; a small percentage
54
Chapter 5 All About Links
of the overall messages are used for legitimate email purposes. Links
often accompany email messages to help direct the end user to a resource
typically related to the email content. Email links are embedded into the
content of the email message. Chapter 4 discussed content, and the links
can be stored in various locations. Attackers can add links to message
content in various locations to entice the recipient to click the message and
visit an intended page.
Let’s look at a few examples of embedded links in the coming figures.
Figure 5-1 shows a full-size image of a delivered phishing email, followed
by a zoomed-in picture of the message content.
55
Chapter 5 All About Links
56
Chapter 5 All About Links
As you scan through this message from top to bottom, you can start
to evaluate this message for suspicious indicators. Let’s focus on the links
within the message. The very top of the message contains a hyperlink named
Nicholas Camp Lejune Justice Act of 2022 - New Claims. The senders have
inputted the first name of the intended recipient and a bogus government act
that appears to be new, all inciting the recipient to review this message closer
and click something sooner rather than later. As explained in Chapter 4, the
personalized greeting is a way to build rapport and convey trust quickly with
the recipient. This should have raised a few flags initially.
Continuing down the message content, you are greeted with the word
ATTENTION in large block text. The image then conveys information
regarding one million military and civilian staff being compensated for
contaminated drinking water. The image ends with a WHAT’S MY CLAIM
WORTH? button. What the reader can’t see is that in addition to the
hyperlink at the top of the email and the button at the bottom of the email,
the entire image is a hyperlink. Clicking anywhere in the image direct the
recipient to the sender’s intended resource. Attackers use this little trick to
increase the odds of the recipient clicking the message potentially in error or
purposefully. The end user might not be aware that the image itself contains
a hyperlink. This is why it is especially important to interact with suspicious
messages with caution. It is a good practice to use the scroll bar or down
arrow when examining an email in question to avoid accidental clicking.
Let’s now discuss the footer, which is the end portion of an email
message. This typically contains two sections. The first is the ability to
unsubscribe or remove the recipient’s address from the mailing list or
preferences that the company used to send the message. The unsubscribe
button or feature can sometimes work by removing the recipient from
the list. But, attackers have caught onto this feature and can use the
unsubscribe link as a final attempt to dupe the recipient into clicking a
malicious link. Be cautious with interacting with the unsubscribe link.
Blocking the recipient or closely examining the link before clicking it is
typically preferred. Figure 5-2 enhances the message, focusing on the footer.
57
Chapter 5 All About Links
The final section in this and many emails contain the sending
organization’s contact information. In Figure 5-2 you see an address and
yet another link to stop incoming messages from being delivered. This is
oddly similar to the unsubscribe link provided and is commonly used by
attackers to insert a link in another section of the message. The bottom
line is that links in any part of the message can be malicious. They are
strategically placed throughout the content and disguised as a multitude of
things used to obscure their intended purpose.
58
Chapter 5 All About Links
What to Do
Unfortunately, attackers have continued to embed malicious links in emails
for many years. This technique is quite effective and continues to have a
rapidly increasing pool of potential victims. Several hardware and software
solutions exist to scan emails for malicious links, but these are typically
only feasible in corporate offices. For everyday end users like you and me,
the best risk mitigation method for these attacks is through training and
vigilance. To further help detect malicious activity, you need to examine
links manually or with tools. If you are not tech-savvy—fear not, we will
walk through this process slowly, and it is something any email user can do.
Link Hovering
One of the easiest approaches to reviewing a link for validity before
clicking is to hover over the link. This simple method typically displays
the website or resource the hyperlink points to. The key here is to review
the resource the link is directing you to and ensure that it coincides with
the supporting content. For instance, a hardware store sends an email
to potential or previous customers regarding a sale of lumber. The email
contains a link to the hardware store website with the sale details. So
far, nothing in this theorteical message appears abnormal or suspicious,
59
Chapter 5 All About Links
but being a computer enthusiast, you want to review the link before
clicking. You simply hover your mouse slowly over the link and review
the intended resource that it is pointing to. You expect to see a domain
or resource that aligns with the hardware store, like the name of the
hardware store. If you see a domain name or resource that isn’t related
to the hardware store or lumber, it could indicate a malicious message.
It is important to do this before clicking, as once the link is clicked, your
computer starts its journey to the intended resource, which could result
in a malicious page or code.
Figure 5-4 shows an example of link hoving.
60
Chapter 5 All About Links
Now that you understand link hovering make it a part of your review
routine. You are learning additional tips and tricks to help improve
your email evaluation process. The good news is that the more you do this,
the better you become. The bad news is link hovering sometimes isn’t
enough. Sometimes it is necessary to extract the link and use additional
tools to check the site’s validity. Doing this may sound advanced, but
anyone can safely analyze embedded links with a few free tools and a
working mouse.
61
Chapter 5 All About Links
Link Extraction
A computer mouse is the first and potentially most important link
extraction tool. Every computer has a mouse ( an input device) that allows
the user to navigate a pointer throughout the monitor. You can use your
finger on the touchpad or display screen to act as a mouse for laptops or
tablets. For desktops and laptops, it is typically more common for the user
to have a physical hardware mouse that connects to the computer using
the universal serial bus (USB). For effective link extraction, it is strongly
recommended that you purchase a mouse if you do not have one natively.
Extracting links can be done without a hardware mouse, but it is much
easier and lessens your odds of clicking a suspicious link in error. They cost
less than $20 online or in any retail store with an electronics section.
The mouse can come with bells and whistles, but you are concerned
with only two buttons. They are the right-click and left-click buttons.
Figure 5-6 shows a graphic of a mouse depicting the left and right mouse
click buttons. The left-click button is the default to click, select, or highlight
an object with the pointer. The left-click is what you use every day on your
computer. Clicking a hyperlink with the left-click button takes you to the
intended resource. The right-click provides additional functionality, often
in drop-down menus or additional options. Clicking a hyperlink with the
right-click button in an email presents additional options but does not
direct you to the intended resource. This is very important to know when
extracting links.
62
Chapter 5 All About Links
Figure 5-7 uses the right-click button on the mouse to click the link.
Again to stress these very important points, if you use the left-click button,
you visit the intended resource, which could be malicious. To extract
links safely, you must use the right-click button for the additional menu
options and features. The example shows that the option to copy the link
appears at the top of the menu box, which is precisely what you want to
do for link extraction. You are attempting to copy the link to review it in a
safe environment. You do not want to visit the link if you are unsure of its
validity until you can further research and decide on its validity. Select the
Copy Link option at the top of the menu bar to copy the link.
63
Chapter 5 All About Links
What to do with the copied link now? Wouldn’t it be swell to view the
page on the link or see if others identified the site as malicious? This can
be done in seconds with just a few more mouse clicks. The best part is all
of the tools needed for this are also free and readily available to anyone on
the Internet.
VirusTotal
VirusTotal (www.virustotal.com) analyzes links and attachments to
detect malicious software and content. It leverages information from over
94 different antivirus and security companies. The number of security
organizations that participate changes, so this ebb and flow over time.
Once a link is provided, VirusTotal scans the page and checks to see if any
security vendors have classified the page as malicious or benign. It also
features a community option for users to comment or discuss a site or
malware sample. Figure 5-8 shows the landing page of VirusTotal and the
sample URL.
64
Chapter 5 All About Links
You simply need to right-click the search box and select paste. You
then click the search button to begin the page analysis. The results return
rather quickly, displaying any known matches for malicious activity based
on the security vendors. Figure 5-9 shows the link submitted had zero signs
of malicious activity.
65
Chapter 5 All About Links
66
Chapter 5 All About Links
VirusTotal is one of the best tools for link analysis. It provides a safe
way to leverage the knowledge and expertise of the world’s best and
brightest security companies. Sometimes using VirusTotal is not enough,
and if a link is new and has never been seen by one of the security
companies, it might not have been evaluated yet. The site also could
be highly targeted and specifically created for a user. For this and other
reasons, seeing the page or resource the sender is trying to point you to
might be useful. Visiting the page yourself could be dangerous, but having
a service visit the page on your behalf and take a screenshot would be
much better. This might sound difficult and expensive, but this is free and
takes mere seconds.
67
Chapter 5 All About Links
urlscan.io
urlscan.io (https://urlscan.io) is a free service that scans and analyzes
submitted links. It has an automated process that browses the page like
a regular user and records the activity that the navigation creates. The
page analysis is stunning, providing a very in-depth analysis leveraging
IP information, geolocation services, a screenshot of the page, statistics,
and if it classifies the site as malicious. If you can only use one tool for
your analysis, urlscan.io is the Swiss Army knife you want in your arsenal.
Figure 5-11 shows the landing page for where you begin. Again, safely copy
the link of choice, right-click to paste, and select the Public Scan button.
Once the scan is submitted, the page load momentarily while the
automated process visits the page. You are then delivered a complete
report of the page detailing the information available. Study this
information from top to bottom and review the screenshot. You can click
the screenshot to view the page but be cautious. Clicking other links on
this page could direct you to the site you intended to scan. urlscan.io does
not stop you from visiting a malicious site. It only provides a snapshot at a
specific time.
68
Chapter 5 All About Links
For this purpose, however, you want to focus on the screenshot section
and the urlscan.io verdict. Refer to Figure 5-12 for more details on the
benign page. These are two critical pieces of information that help us
determine more about the submitted link. The screenshot is a snapshot
of the page. This visually displays what the page looks like in a safe
environment. The urlscan.io verdict is the determination made by urlscan.
io on the site’s validity. Much like VirusTotal, urlscan.io checks security
vendor organizations for known signs of malicious activity associated
with a site. The completed report has far more information which can be
useful as you get more advanced in your analysis, including the IP address,
hosting provider, and certificates. For our purposes, let’s focus on viewing
the page screenshot safely and checking the site verdict.
69
Chapter 5 All About Links
Not all sites submitted are benign. For this reason, I have provided
a malicious site for reference. Let’s submit the link in the same manner
as previously explained and again review the screenshot and urlscan.
io verdicts. Figure 5-13 shows the urlscan.io report. Reviewing the same
sections as the previous submission, the urlscan.io verdict identifies
this site as potentially malicious. The screenshot can be viewed as an
additional indicator.
70
Chapter 5 All About Links
URLVoid
Sometimes a tool cannot analyze a link or is not functioning properly.
For this reason, it is important to always have a secondary or tertiary tool.
URLVoid (www.urlvoid.com) checks the reputation of a submitted website
against a list of security vendors. It is similar to VirusTotal, but they do not
share the same security vendors. The process for copying and submitting
links remains constant. Figure 5-14 shows the landing page for URLVoid’s
website reputation checker.
71
Chapter 5 All About Links
To submit a link, right-click and paste it in the box and click the Scan
Website button. The tool takes a few seconds to run and returns a report
on the submitted link. Figure 5-15 shows a site that returned no signs of
malicious activity. It is important to reiterate that the results of these tools
should not be taken as sole sourcing for the validity of a site. Figure 5-16
shows a site that had signs of malicious activity.
72
Chapter 5 All About Links
73
Chapter 5 All About Links
You now know how to safely extract links from a website and analyze
them for malicious activity. The tools explained in this chapter are highly
regarded and used in some of the top cybersecurity organizations in
the world. It is important to be cautious when interacting with links in
email messages, an error when interacting with an email could result in
the machine being compromised. Following the steps discussed in this
chapter and exercising caution, give you one more tool in your arsenal for
detecting malicious activity.
Summary
This chapter focused on identifying and investigating links in emails. You
learned a safe process to copy links out of emails without interacting with
the intended resource. You saw multiple tools that can be used for link
analysis to help determine the legitimacy of a link. This is one of the more
important chapters because a large percentage of phishing emails use
malicious links as a primary infection vector. The chapter also featured
some sample content containing links with malicious content; visiting
these or other malicious sites can infect your machine. Be extremely
cautious when interacting with the malicious links in this book or other
materials.
74
CHAPTER 6
How to Handle
Attachments
The next component to explore is email attachments. You know now
that emails can contain content and links to help convey a message to
the recipient. The possibilities do not stop here; attachments can also be
included to supplement the links and content. Many attachments are used
legitimately, but attackers have taken advantage of this email component
and used it to deliver malicious software to recipients.
76
Chapter 6 How to Handle Attachments
77
Chapter 6 How to Handle Attachments
These are all questions you want to consider when evaluating the
attachment and can also help you with content and link analysis. As you
work through the email from top to bottom, ask yourself these questions
while looking at all the email components. While doing this, take note of
the suspicious indicators and, when complete, review and make the best
determination of how to proceed. Sometimes asking these questions won’t
be enough, and you must evaluate the attachments closer for signs of
malicious activity.
78
Chapter 6 How to Handle Attachments
Malware
Attachments come in various shapes and sizes. You can use the content
and behavior of the sender to determine some level of confidence in
the validity of a message, but in some cases, you need to take this a step
further. Luckily, there are tools that examine attachments and provide a
report with additional context and information. First, let’s discuss a few
terms and concepts.
You must first understand the basic concept of computer code before
exploring signatures. Computer code is the written language used to
execute specific functions on a computer. A human programmer writes
the code the computer reads and executes to complete a specific task. This
compiled code is often called an application or, more commonly known,
a program. Programs provide functionality on a computer and are part of
every interaction with a computer.
Malicious software, also known as malware, is written in computer
code. The code is used to damage data or software. Malware comes in a
variety of shapes, sizes, and levels of complexity. In addition to stealing or
damaging data, most malware is written for financial gain of the attackers.
In most cases, attackers are trying to monetize the implications of the
malware and generate money. This can come in direct payment, sensitive
information that can be sold, or access to the infected machine for another
party. The intricacies of malware can be a very technical and difficult topic.
This book focuses on malware being bad software sent from an attacker to
a victim. It is sent to users for bad things to happen, and it is our job to try
and identify this and avoid interaction.
79
Chapter 6 How to Handle Attachments
Evaluating Attachments
You now know that attachments contain files capable of many different
things and can be safe or malicious. But what if you review the content
and behavior of the email and are still unsure? How can you evaluate
an attachment if it is potentially dangerous? Luckily, another suite of
free online tools allow you to learn more about attachments. The tools
discussed operate in two main fashions when evaluating the file for
suspicious or malicious activity indicators: static and dynamic analysis.
80
Chapter 6 How to Handle Attachments
new or altered files created. Dynamically analyzing a file is great for new
malware not previously categorized. It can help determine the validity of a
file based on its actions rather than the code. This approach sounds more
difficult than static analysis, but some tools can help.
Extracting Attachments
Before evaluating the files, let’s discuss how to safely collect the email
attachments for analysis. This must be a direct and deliberate process
to ensure that you handle the attachment in a safe matter and avoid
unnecessary risk or potential infection. These files may be malicious, and
it is important to act with caution until deemed otherwise. Fortunately,
you only need a mouse and a few clicks to start. Our goal is to save the
attachment to our computer and not open or execute the file inadvertently
in the process.
The first step depends on your mail application. Figure 6-3 shows a
menu option on the far right of the attachment; it looks like a downward-
pointing arrow. Right-clicking the arrow offers additional features,
which include the Save As option. You want to save this attachment,
without running it, to use for further analysis. This can be accomplished
in many ways, depending on the preferred mail application. I provide
a few examples, but these are not the only platforms or ways to save
email attachments, but rather a guide to aid in the process you take
with your specific mail platform. Figure 6-4 shows a symbol highlighted
showing a Download button. Clicking this button downloads the file to a
specific location without executing it.
81
Chapter 6 How to Handle Attachments
Once the file has been saved or downloaded, it typically stores the
file in the Downloads folder of your operating system unless otherwise
specified. You can find this by navigating to this folder on your C Drive in
Windows or through the Finder feature on your Macbook.
VirusTotal
VirusTotal (www.virustotal.com) checks a repository of security vendors
to identify malicious activity for websites. It also does this for attachments
and works in a similar process. In addition to links, VirusTotal conducts
82
Chapter 6 How to Handle Attachments
static analysis of submitted files. As mentioned earlier, this means the file’s
code is scanned and checked against a repository of known signatures for
malicious activity. VirusTotal then produces a report of the findings, which
can aid in determining the validity of the file.
Once the file is saved, visit the same initial VirusTotal webpage to
submit the attachment for analysis. Click the File button at the top left of
the page, then navigate to the centrally located Choose File button. Once
you click this button, you need to navigate to the location of our stored file.
In most cases, this is in the Downloads folder on your computer. Figure 6-5
shows the initial landing page highlighting the Choose file button for
submission.
83
Chapter 6 How to Handle Attachments
Once the file has been chosen, you can submit it for analysis. The
tool quickly produces a hash of the file, which is a fingerprint or unique
value assigned to this specific file. Any changes to the file would produce a
different hash. The concept of hashing gets more prevalent with advanced
analysis. For us, it’s just good information to know at our level. VirusTotal
takes a few seconds to analyze the file and check against its repository.
If no known security vendors have identified this file as malicious, you will
receive a report like the one shown in Figure 6-6.
The file submitted in Figure 6-6 shows that 0 out of 62 vendors
classified this file as malicious. You can tell this by looking at the top left of
the page. In the center of the page are additional details of the file analysis
process, including the size, name, and when the file was last scanned.
VirusTotal checks internally to see if a submitted file has previously been
scanned. If the file has been scanned previously, it produces the most
recent report. If not, it runs a new report for the submitted file. In large
phishing campaigns, it is common for hundreds or thousands of users to
get the same link or attachment. This could result in the same attachment
or link being submitted multiple times to a tool such as VirusTotal for
analysis. To remove redundant scanning and information, VirusTotal can
review a previously submitted report to save time and resources.
84
Chapter 6 How to Handle Attachments
Figure 6-7 shows a file submitted with multiple malicious flags. This
time in the top left, 9 out of 60 security vendors identified the file as
malicious. Looking again at the file details in the center of the page, this
is a .zip file and was submitted on August 29. VirusTotal has provided
us with a hash for the file and listed the nine security vendors that have
identified this file as malicious. Next to each security vendor is the
detection name for the signature that identified this file. The signature
name can sometimes allude to additional details about what the file does.
Figure 6-6 shows BitDefender on the second column of security vendors.
Next to BitDefender is the signature as JS.Heur.Backdoor.2.9930B40D.Gen.
This likely means the file submitted is malicious and used as a backdoor
for actors to enter the system. You ascertain this information from the
signature name that lists Backdoor with unique numbers and characters.
VirusTotal was used to statically scan a file and tell us more about the
file in question. Specifically, what if any security vendor has classified
this file as malicious? If any security vendors have flagged the submitted
file, you should proceed very cautiously because it is likely malicious.
You can learn more about the potential nature of the file by looking at the
name of the signature provided by the security vendor. If the file returns
no flags, that does not inherently determine that the file is safe to interact
85
Chapter 6 How to Handle Attachments
with. It is possible that no vendors have seen the file previously, or this is
a new attack for which signatures are not yet available. For this reason,
it might be necessary to use additional tools to execute the file in a safe
environment.
Sandboxing
You previously discussed static and dynamic analysis. You know that
dynamic analysis is when the file is executed in a safe environment and
monitored for suspicious activity or changes to the system. A sandbox
is a specially prepared environment that mimics an end-user personal
computer or device. The sandbox prevents compromise by blocking
communication out to the Internet, containing no user or critical data,
and maintaining the ability to restore and remove any previous artifacts.
Sandboxing can be done in hardware, software, and web or cloud-based
environments. Utilizing a web or cloud-based service is the easiest and
most reliable method to run a file in a sandbox. Let’s explore a cloud-based
dynamic sandbox environment to aid our attachment analysis.
ANY.RUN
www.any.run
ANY.RUN is a free online tool offering both web-based sandboxing and
link analysis. Access to ANY.RUN requires a user to sign up for the platform
using a valid email address. It is available to anyone with an Internet
connection and can quickly execute a file in a controlled environment
for analysis. Once a file is submitted, it creates a detailed report of any
suspicious findings. When registered and logged in, you begin this journey
at the home page shown in Figure 6-8. To submit a file for analysis, click
the New Task button in the top left of the screen.
86
Chapter 6 How to Handle Attachments
When clicking the new task, a dialog box shows the new options.
Figure 6-9 shows the available options for the new task. Here you have the
option to submit a file or URL. To analyze an attachment, select the Upload
button on the right side of the box and navigate to our saved attachment.
Next, select the desired operating system. This is the virtual system the file
is executed on. Once this is done, select the Run a Public Task button.
87
Chapter 6 How to Handle Attachments
88
Chapter 6 How to Handle Attachments
Once submitted, it takes a few minutes for the file to process. Upon
completion, you are directed to a page similar to Figure 6-11. As you
examine this page, you start with the left side of the screen, which shows
a screen capture of the file executed in our virtual operating system. This
sample file contained a simple Word document with no malicious activity.
The screen capture shows the document opened and a preview of what is
contained in the file.
89
Chapter 6 How to Handle Attachments
On the right-hand side are the file details. At the top is the file name,
which for this example is Attached Document (1).docx. You then see the
file hash, start time, and total time run. There are a series of additional
buttons and a list of all the executed processes in Figure 6-12. The first box
allows you to download the sample file. Since you submitted the file, this is
not very useful to us but could be for security researchers. The next option
is labeled IOC, which stands for indicator of compromise and contains
specific details or clues that can identify compromise associated with this
particular file. The MalConf is not available in the free account, and the
Restart button restarts the machine and runs the sample again.
Moving to the second row reveals more report and graphics-based
options. The Text Report button leads us to a detailed technical description
of the file submitted. The process graph shows any processes executed by
running this file. A process is a set of instructions executed to complete a
task. Executed files often call processes to complete tasks. This behavior
and the specific processes can be signs of malicious activity when
analyzed. Finally, there is the ATT&CK matrix. The ATT&CK matrix is a set
of techniques attackers use to accomplish a specific objective. The details
are outside this book’s scope, but you can learn more at attack.mitre.org.
90
Chapter 6 How to Handle Attachments
Figure 6-13 shows a sample malicious document. The left pane shows
that an application has been executed and a password box has appeared.
The right side of the page shows that ANY.RUN has flagged this file as
malicious. The file has several processes that are executed that have been
identified as malicious. You can learn more by exploring the various details
and reports made available.
91
Chapter 6 How to Handle Attachments
The report from 6-13 has flagged this file as suspicious and identified
processes that indicate malicious activity. This is a strong indicator of a
malicious file, and it would be highly recommended not to execute this
on your personal devices. Other tools exist for dynamic file analysis, and
it is advantageous to have additional options for analysis. Hybrid Analysis
is another great option for dynamic analysis.
Hybrid Analysis
www.hybrid-analysis.com
Hybris Analysis is a web-based sandboxing and link analysis tool.
Much like our previous tool exploration, you must safely save the
attachment for submission and navigate to the Hybrid Analysis home page.
Figure 6-14 shows the home page for file submission. Centrally located on
the page is the file submission button with the instructions Drag & Drop
For Instant Analysis. You can drag the saved file to this box or click for the
file explorer to appear and locate the file in question for analysis.
92
Chapter 6 How to Handle Attachments
93
Chapter 6 How to Handle Attachments
where you can provide additional context for your records. This might
include the email sender, identifying context, or the topic of the message to
allow you to reference this at a later date and time if needed.
Below the comments section, there are a few options and a captcha.
Options include three boxes, with only one being mandatory to proceed.
To proceed, you must consent to the Terms & Conditions and Data
Protection Policy to submit a file for analysis. You should review these
terms closely, but the files submitted are shared amongst the community.
This typically only becomes a concern for specific malware or advanced
cybersecurity organizations. For most users sharing the sample is not
a major concern. The remaining boxes can be checked based on your
preferences to share the information submitted. Finally, you have a
captcha that determines that a human submitted the request and not a
computer-automated process. Check the captcha box at the bottom and
select continue.
94
Chapter 6 How to Handle Attachments
95
Chapter 6 How to Handle Attachments
operating system you are using to mirror how the file would act on your
PC. Unfortunately, that isn’t always possible. For our example, let’s select
Windows 7 32-bit and click the Generate Public Report button, as seen in
Figure 6-16.
Once the file is processed, it displays a report of its findings. The report
is captured in Figure 6-17 with a summary of the analyzed file. At the very
top are the file details, which show us the file name, size, type, and hash.
If any threats are identified, they are shown both on the top right of the
screen and within the Anti-Virus Results section. Our antivirus results are
provided by three reputable security vendors: CrowdStrike, MetaDefender,
and VirusTotal. The report summary is at the top of the page, and more
96
Chapter 6 How to Handle Attachments
97
Chapter 6 How to Handle Attachments
98
Chapter 6 How to Handle Attachments
99
Chapter 6 How to Handle Attachments
100
Chapter 6 How to Handle Attachments
Summary
This chapter reviewed the basics of email attachments and ways to identify
suspicious attachments. You learned the fundamentals of static (think
code review) and dynamic (think file execution) analysis and explained
how some tools could aid your analysis. The tools explored in this section
can scan attachments and gather signs of potentially malicious activity
before interacting with them on your computers. Attachments can be used
in both malicious and nefarious ways; understanding how to identify signs
of suspicious attachments and tools to evaluate attachments are critical to
catching a phish.
101
CHAPTER 7
Log Searching
and Response
This chapter explores log records on a local machine and from a
centralized repository. This section is useful to home techies, security
analysts, and technicians working in corporate environments that might
ingest and store log sources from multiple devices for correlation. Now
might be a good time to start if you work in a corporate environment and
aren’t storing log records. Tell your boss you have a great idea that pays
huge dividends when an incident occurs. First, let’s discuss local logs that
are stored natively on Windows devices and then discuss searching using
common log repository tools.
machine. They are stored locally on the machine and viewable in the
Windows Event Viewer. This easy-to-use program lets you review and
search for log records on your local machine. The Windows Event Viewer is
installed natively on all modern versions of Windows.
So, the Event Viewer can show you the logs, but how do you get to it?
You can find it by searching for Event Viewer using the magnifying glass on
your taskbar or following these instructions: Start menu ➤ Control Panel
➤ Administrative Tools ➤ Event Viewer.
The Event Viewer (see Figure 7-1) organizes your local log sources and
allows for quick and easy access for viewing. It is important to note that the
log sources stored in the Event Viewer are not natively saved externally to
the program and, thus, typically, are overwritten within a few hours. It is
often referred to as “logs rolling”, which means newer log records overwrite
older log records as they come in. If anyone mentions that the log records
have likely rolled, they are no longer available.
104
Chapter 7 Log Searching and Response
Select the Windows Logs on the far-left panel in the Event Viewer.
Expanding this menu option reveals five subfolders. The following are brief
descriptions of each.
105
Chapter 7 Log Searching and Response
Next, let’s look at the different types of log records. Windows has the
following five different log types.
The various categories and types of log sources can help explain
what the log record shows in the system. Reviewing log records is a good
troubleshooting approach to learning more about a technical problem
on a pc and determining the next appropriate action. Figure 7-2 shows an
example log record for a successful logon event.
106
Chapter 7 Log Searching and Response
107
Chapter 7 Log Searching and Response
108
Chapter 7 Log Searching and Response
109
Chapter 7 Log Searching and Response
Security Onion
Security Onion is a Linux distribution designed for network security
monitoring (NSM) and event correlation. It is based on Ubuntu and
includes several open source tools for network analysis, such as Snort (an
intrusion detection system), Suricata (another IDS), and Sguil (a security
information and event management tool).
Security Onion also includes many other tools for network analysis,
such as Bro (a network analysis framework), ELSA (an event-based logging
and analysis system), and OSSEC (a host-based intrusion detection
system).
One of the key features of Security Onion is its ability to automatically
detect and analyze network traffic to identify suspicious activity. This is
done through intrusion detection and prevention systems known as Snort
and Suricata, which can detect a wide range of network-based attacks.
These systems use pre-defined or custom-made rules to detect and alert
on identified traffic that may be malicious or suspicious.
Another important feature of Security Onion is its ability to collect
and store large amounts of network data for analysis. It is done using
Sguil, designed to help security analysts quickly and easily search through
large amounts of network data. Sguil is useful for analysts searching for
phishing email records to see how many people at the organization were
targeted, when the emails were sent, and any unique characters that can
be identified from the metadata.
110
Chapter 7 Log Searching and Response
In addition to its core features, Security Onion has other NSM and
analysis tools. For example, it includes tools for visualizing network data,
such as Kibana and Grafana, and tools for automating network data
analysis, such as Moloch and Squert.
Overall, Security Onion is a powerful and flexible NSM and analysis
tool. Its combination of open source tools and automation capabilities
make it well-suited for use in a wide range of security-related tasks, from
incident response to threat hunting.
You can download Security Onion for free from
securityonionsolutions.com. Locate the Software tab to take you to the
webpage to download the software (see Figure 7-3).
111
Chapter 7 Log Searching and Response
Splunk
Splunk is a mostly paid software platform that allows users to collect,
analyze, and visualize machine-generated data from a wide variety of
sources. Splunk does offer a free version for small amounts of data, but
most organizations quickly outlive this restriction and need a paid model.
Splunk is commonly used for log analysis, security, IT operations, and
business intelligence.
One of the key features of Splunk is its ability to collect data from
various sources, including log files, network traffic, and system metrics.
This data can then be indexed and searched using Splunk’s powerful
search engine, allowing users to quickly and easily find the information
they seek. Figure 7-4 is a sample image of the search engine used
for Splunk.
112
Chapter 7 Log Searching and Response
In addition to its core features, Splunk includes several other tools and
capabilities that can aid in data analysis and visualization; for example,
tools for real-time data analysis, machine learning, predictive analytics,
and a software development kit that allows users to create custom
applications and integrations.
One of the most powerful aspects of Splunk is the ability to create and
use search commands that allow users to retrieve specific information
from the indexed data and perform specific actions such as filtering,
113
Chapter 7 Log Searching and Response
114
Chapter 7 Log Searching and Response
Both Splunk and Security Onion store and categorize data differently
depending on the data provided and the specific configurations. If you
can ingest email log records, you should be able to search through logs
and find metadata records, such as date/time, subject, sender, recipient,
IP information, and email size. When a phishing email is reported or
investigated, these centralized log management tools can help you quickly
identify how widespread the issue may be. With simple search terms, you
can determine how many emails were sent, to whom, and when they were
delivered. I recommend the following search approach to identify the
targeted audience of the attacker.
1. Search for the sender’s address. This tells you if the
specific sender sent emails to other individuals in
the organization.
Summary
This chapter explored log records and how valuable they can be when
investigating incidents. Log records can be reviewed on any computer and
aid in troubleshooting benign and nefarious activities. You learned how to
search these records and some of the information that can be contained in
various records. Go ahead and try it out. Review some log records on your
own devices!
116
CHAPTER 8
Remediation and
Lessons Learned
Thus far, this book has largely discussed identifying and detecting
phishing messages and suspicious activity deriving from email messages
impacting a computer or network. Once you identify this behavior, what
should you do next? You learned the PICERL process and are nearing
the final stages of our incident response process. These stages include
eradication, remediation, and lessons learned. When complete, this
closes out our process and brings our systems back to a normal state while
analyzing what you’ve learned.
I discussed and demonstrated how to detect and handle a suspicious
email message, but what should you do with the message once identified?
Should you simply delete the message, ignore it, or share it with all of
your friends? The answer lies somewhere between these responses and
depends on your internal factors and circumstances. In many cases
deleting the message makes sense. However, if you want to help improve
detection methods and help prevent others from receiving similar email
messages, most mail applications allow the ability to report or block a
suspicious message.
Reporting suspicious messages allows a security team or automated
process to analyze the message, adjust security controls, and help
protect others. When a message is reported, it gets broken down in a
similar process explained in the book, and key indicators are removed.
118
Chapter 8 Remediation and Lessons Learned
119
Chapter 8 Remediation and Lessons Learned
120
Chapter 8 Remediation and Lessons Learned
121
Chapter 8 Remediation and Lessons Learned
122
Chapter 8 Remediation and Lessons Learned
123
Chapter 8 Remediation and Lessons Learned
124
Chapter 8 Remediation and Lessons Learned
You’ve learned how to report a message if you want to; if not, you can
simply delete the message. But what if you accidentally click one of those
pesky links or attachments you are trying to avoid? This could infect your
machine with malicious software, commonly known as malware, and may
impact your machine’s operation or the data stored on your device. If you
suspect your machine is impacted by malicious software, remove it quickly.
In our process, this is the eradication stage in which you strive to remove
unwanted software from your device with as minimal impact as possible.
Eradication involves permanently removing a threat or vulnerability
from a system or network. Eradication can be accomplished through a
variety of methods.
125
Chapter 8 Remediation and Lessons Learned
• Symantec
• McAfee
• Trend Micro
• Bitdefender
• Avast
• AVG
• ESET
• F-Secure
• Avira
• Sophos
126
Chapter 8 Remediation and Lessons Learned
If you find that the antivirus software cannot remove the malware, you
may need to install and run another program for removal. One of the best
programs that specializes in removing malware is called Malwarebytes.
Malwarebytes is an anti-malware software that detects and removes
malicious software, including viruses, trojans, worms, spyware, and other
potentially unwanted programs from a computer system. It offers real-time
127
Chapter 8 Remediation and Lessons Learned
protection against online threats and can scan for malware on demand.
This is a great supplement to run in tandem with your antivirus software. It
can help detect and remove malware your antivirus software fails to detect.
An initial trial version can be run for 14 days on your computer, which can
help remove a pesky malware file you cannot get off of your pc. If you still
want to use the program after the trial period, it costs you a few dollars
a month. At the time of writing this book, it was under $5 a month for
personal use. See Figure 8-5 for the Malwarebytes homepage.
128
Chapter 8 Remediation and Lessons Learned
129
Chapter 8 Remediation and Lessons Learned
130
Chapter 8 Remediation and Lessons Learned
Figure 8-9 depicts an active scan and Figure 8-10 shows the results
from our recent scan. This scan took 3 minutes to complete and had
12 findings. To remove the findings, click the Quarantine button on the
bottom right of the screen. By default, Malwarebytes has many of the
settings enabled. It automatically checks for, and installs updates every
hour. It is set to scan weekly with the ability to adjust this to daily if desired
and has real-time scanning enabled. Other anti-malware programs
exist and are successful at removing malicious files. Malwarebytes has
131
Chapter 8 Remediation and Lessons Learned
been tried and true for many years and continues to lead in this space.
If you haven’t played around with Malwarebytes or another reputable
anti-malware software before, it is a good tool to add to your arsenal of
detection and eradication applications.
132
Chapter 8 Remediation and Lessons Learned
133
Chapter 8 Remediation and Lessons Learned
Reimaging Your PC
Reimaging or resetting a machine is one of the most secure ways to remove
a malicious application from an end-user device. However, this is the most
drastic and time-consuming process that could remove important data
you failed to back up elsewhere. The operating system gets a fresh start,
and you can be relatively sure that whatever infected you before does not
infect you moving forward. The Windows operating system is likely what
most of you are using, and they have made this process easy. A quick
reminder, if you have critical data, you need to back this up somewhere
right now and periodically moving forward. You will likely have malware
or experience a hardware issue at some point in time on your machine that
could result in the loss of data. This should also only be done if you own
the pc, do not reimage your employer-provided laptop without checking
with the IT department.
Reimaging a device can be done in several ways and varies slightly
based on your operating system version. Windows allows you to remove
or attempt to keep all your files and transfer them to a fresh install. It is still
advised to save critical files regardless of which option you choose.
You can find your operating system by navigating to the My Computer
settings or reviewing any documentation you received with the computer.
Chances are you are running Windows 7, 10, or 11. Start by searching for
the Windows Settings in your Windows search box. Once on the main
settings page, you can select the Recovery menu option and be brought to
the screen in Figure 8-11.
134
Chapter 8 Remediation and Lessons Learned
The image in Figure 8-12 shows two options for resetting your device.
The first attempt is to save your files and applications. When the device is
booted up, it will likely look similar to how you left it. The problem is that
if the malicious application isn’t removed, it can remain stored on your
device and execute again. The malicious file executing could reinfect your
machine and bring you back to square one. The remove everything option
is preferred, removing all files and applications and providing a fresh start.
It is difficult for the malware to remain on the device with a fresh restart.
Upon resetting the PC, you should ensure that functionality is resumed,
and you can begin restoring necessary applications and files.
135
Chapter 8 Remediation and Lessons Learned
Remediation
Now it is time to move to remediation. In this step, you must ensure that all
artifacts are removed from the machine or network and that the impacted
device or devices are restored to a good known and operational state. You
want the impacted devices to return to the same or better state before the
incident, with the same permissions, features, and applications needed
to perform the intended purpose. This is a critical component of an
organization’s incident response plan and is designed to return operations
to normal after an incident has occurred.
Eradication focuses on removing the artifacts left by malicious
software or actors. Now let’s focus on restoring access, fixing any identified
vulnerabilities, and hardening the system to prevent this from happening
again. Once the malicious software or artifacts are removed, complete the
following remediation steps.
136
Chapter 8 Remediation and Lessons Learned
Windows Updates
Periodically updates are released containing bug fixes, security updates,
and new features for the Windows operating system. These fixes can
sometimes address security or configuration issues and vulnerabilities
that have been identified and impact Windows operating systems. The
updates must be installed and run on the local computer, often requiring
a reboot to complete the update process. Microsoft releases updates on
a monthly interval, currently on the second Tuesday of every month. It
is often called Patch Tuesday, the day when all available patches for the
month are released. Microsoft also releases patches that are deemed
critical or emergency in nature outside of the Patch Tuesday cycle. This is
less common but does happen.
The update process involves downloading and installing updates onto
a user’s device to keep their system up-to-date and secure. The updates
are usually installed automatically, but users can manually check for
and install updates. Windows users can quickly check the status of their
last update, any missing updates, and the next scheduled update. In the
137
Chapter 8 Remediation and Lessons Learned
Windows search box, type Windows Update. You are brought to a screen
that shows your update status and allows you to check or install updates.
Figure 8-13 shows a system that has all available patches installed.
138
Chapter 8 Remediation and Lessons Learned
139
Chapter 8 Remediation and Lessons Learned
need? Are you able to print? Can you download and install files if needed?
These settings must be restored to ensure that the computer is returned to
a good known state with the proper accesses in place.
Lessons Learned
Reflecting on the lessons you learned is the final step in the process, where
you take a step back, look at what happened, how you responded, and
what you can do to improve our process moving forward. It focuses on past
security incidents and identifying areas for improvement to better prepare
for and respond to future incidents. This keeps your process continuously
improving, making it better and harder for attackers to successfully exploit
and steal your data.
To be effective, you should focus on a few key simple elements. These
work for all shapes and sizes. Let’s focus on the following.
140
Chapter 8 Remediation and Lessons Learned
141
Chapter 8 Remediation and Lessons Learned
Summary
You’ve come a long way, and it’s time to finish strong. Lessons learned in
cybersecurity are a critical process that allows organizations and people
to reflect on past security incidents and identify improvement areas to
better prepare for and respond to future incidents. This involves analyzing
the details of past incidents, assessing the effectiveness of the incident
response, identifying areas for improvement, and sharing information
and best practices with other organizations. By implementing effective
lessons-learned processes, you can improve incident response capabilities,
reduce the likelihood and impact of security incidents, and better protect
systems, networks, and data. Additionally, it is important to note that
lessons learned are an ongoing process that requires constant monitoring
and review to ensure that you are always prepared and ready to respond to
security incidents.
You now have the proper training and information to catch a phish!
Remember, this is a continuous and evolving process that requires
repetition and diligence. Stay vigilant and always be learning. Attackers
tend to modify techniques. With the skills you have learned here, you are
now ready to begin phishing and help protect others!
142
Index
A C
Antivirus program Centralized log management, 108
real-time scanning, 127 components, 108, 109
schedule scans, 127 Chief executive officer (CEO),
update automatically, 127 27, 50, 51
ANY.RUN Chief financial officer (CFO), 50
access, 86 Chief information security officer
file report, 90 (CISO), 50
file submission, 89 Cloud-based storage system, 133
landing page, 87 Confirmation Receipt, 47
malicious file, 91 Cyber-hygiene, 35
new task, 88 Cybersecurity, 34, 47, 53, 74, 88, 94,
public task, 89 109, 110, 141, 142
Attacker plans, 43
Attackers, 23, 25, 26, 30, 31, 33, 41,
43, 46–49, 55, 57–59, 79, 90, D
140, 142 Domains, 4, 14, 54
Attack techniques, 23–30 Dynamic sandbox, 86
B E, F
Billboard-type message, 42 ELSA, 110
BitDefender, 85, 126 Email, 1
Bro, 110 client, 2
Business Email Compromise Gmail web application, 6–8
(BEC), 27 header analysis tools, 14
144
INDEX
M
MalConf, 90 P, Q
Malware, 23, 33, 37, 38, 64, 66, Phishing email, 34, 36, 45, 46, 48,
79–81, 94, 125–128, 55, 74, 110, 115, 120, 122,
133–135, 141 123, 125, 126
Malwarebytes, 127 PICERL process
console, 131 containment, 36, 37
download page, 129 eradication, 37, 38
install wizard, 130 identification, 35, 36
scan, 132, 133 interative process, 40
webpage, 128 preparation, 35
McAfee, 35, 47–49, 125 recovery, 38, 39
McafeeRenewal, 47, 48
Message content, 42
clickable image, 42, 43 R
written, 42 Rackspace, 45
Microsoft Message Header Reimaging, 133–136
Analyzer, 20, 21 Remediation, 117–142
145
INDEX
S U
Sandbox, 86, 92 Undeliverable messages, 5, 6, 17
Sans.org, 34 Universal serial bus (USB),
Security incident, 33, 35, 40, 116, 35, 62, 133
122, 140–142 Update process, 137
Security Onion, 109 urlscan.io, 68–70
download page, 111 URLVoid, 71–73
network analysis, 110
network traffic, 110
NSM, 111 V
Sguil, 110 Valued Vustomer, 46
Signature, 51, 59, 61, 79, 80, 83, VirusTotal, 64–67, 69, 71,
85, 86, 127 82–86, 96
Simple Mail Transport Protocol VirusTotal webpage, 83, 84
(SMTP), 3–5, 17, 19
Snort, 110
Social engineering, 23 W, X
tactics, 23–30 Web server, 2, 53, 54
Spear phishing, 44 Website-hosting platform, 54
Spelling errors, 46 Windows Defender, 126
Splunk, 109 Windows Event Viewer, 104
dashboard, 113 application, 105
146
INDEX
147