Avoid these email attachments if you don't want to get phished

Fish hook on a keyboard
(Image credit: Shutterstock)

Cybercriminals are always looking for new ways to help their phishing attempts get past antivirus engines and attaching HTML documents to an email is an increasingly common technique used to do so.

Instead of inserting links to a phishing page in the body of an email where they’ll likely be found by email filters, malicious HTML attachments make it easier to camouflage phishing content. 

According to Kaspersky, there are two main types of HTML attachments used by cybercriminals: HTML files with a link to a fake website or a full-fledged phishing page. The first type allows an attacker to hide a link in the attached file as well as to automatically redirect a potential victim to a fraudulent site while the second type of HTML attachment allows an attacker to skip creating a fake website while saving on web hosting costs.

Malicious HTML attachments are a growing threat and in the first four months of this year alone, Kaspersky detected nearly 2 million emails that contained them.

FYI: Planning your next big summer trip? Watch out for these scams

instagram hackers

(Image credit: Getty Images)

Hiding phishing pages in attachments

The phishing content found in HTML attachments is usually written in JavaScript in order to handle redirecting users to phishing sites or to harvest their credentials. Typically the HTML page sends data to a malicious URL that is specified in the script itself. However, if an attachment contains malicious scripts or links in plaintext, antivirus and other security software can block it — that's why cybercriminals use JavaScript obfuscation instead.

This technique involves moving code around in such a way that it’s difficult to read and make sense of. While some cybercriminals do this manually to make the original code harder to restore, others rely on any number of ready-made tools to do so.

Another tactic used to hide phishing content in email attachments is encoding or compressing their code so that it appears much smaller than it really is. In one recent instance, Kaspersky came across an email with a malicious HTML attachment that contained a full-fledged phishing page encoded in a tiny, two-line script.

How to spot a phishing site or email

Phishing sites come in all shapes and sizes but they are often designed in such a way that they mimic legitimate web pages so that users don’t think twice when entering their credentials. Even if a cybercriminal makes an almost identical copy of a business’ webpage, looking for spelling errors on the page itself or checking its URL in your browser’s address bar can be a dead giveaway that it’s a fake site.

To avoid having the credentials to your online accounts stolen by cybercriminals, you should always head to a business’ login page via its website or through a search engine as opposed to through your email. This way you’ll know that you’re going to the actual site instead of to a fake one impersonating a brand or business.

When it comes to phishing emails, you should always avoid opening emails from unknown senders. Another trick cybercriminals use to lure you in is instilling a sense of urgency in their messages. Businesses and even the government will rarely if ever ask you to respond to one of their messages in a timely manner. At the same time, it’s worth noting that certain government organizations like the IRS will never contact you by email and any problems with your taxes will be communicated to you via the mail instead.

To avoid falling victim to phishing scams, you should avoid opening emails from unknown senders and this also holds true for any attachments they contain. Although Word files, PDFs and other office documents are commonly attached to emails, very few people send over websites as HTML attachments and if you see an email with one in your inbox, you can be almost certain it’s a phishing email.

As phishing is often used to steal the credentials to commit fraud or even identity theft, you can use a password manager to securely store your passwords and even generate strong and complex passwords for each of your accounts to make them harder to crack or guess.

TOPICS
Anthony Spadafora
Managing Editor Security and Home Office

Anthony Spadafora is the managing editor for security and home office furniture at Tom’s Guide where he covers everything from data breaches to password managers and the best way to cover your whole home or business with Wi-Fi. He also reviews standing desks, office chairs and other home office accessories with a penchant for building desk setups. Before joining the team, Anthony wrote for ITProPortal while living in Korea and later for TechRadar Pro after moving back to the US. Based in Houston, Texas, when he’s not writing Anthony can be found tinkering with PCs and game consoles, managing cables and upgrading his smart home. 

Read more
A person typing on a computer while hackers use phishing to steal a file from their computer
Phishing: What is it, and how to avoid it
iPhone 15 Pro Max shown in hand
iMessage under attack from scammers sending phishing messages — don’t fall for it
An FBI agent typing on a computer
FBI issues warning to millions of Americans to avoid these websites that can steal your passwords and banking info
MacBook Pro 2023
New Mac attack is tricking users into thinking their computer is locked — how to stay safe
PayPal logo on iPhone
Watch out! Scammers are using this PayPal setting to take over your PC
A hacker typing quickly on a keyboard
Hackers can steal your accounts, and all it takes is a double-click — don’t fall for this new form of clickjacking
Latest in Email
Image of Gmail's logo on a laptop
Need a hand? Gmail’s ‘Help me write’ comes to web users — everything you need to know
The Microsoft Outlook app open on a phone
Microsoft Outlook went down — what to do if it's not working for you
Image of Gmail logo on a laptop
Google is deleting inactive Gmail accounts — here's how to save yours
Yahoo Mail icon on a phone home screen
Yahoo Mail is the latest service to get in on the AI craze
An image of the Gmail app, representing an article on how to create a new gmail account
Gmail's Quick Reply feature lets you react to emails like they were text messages
An image of the Gmail app, representing an article on how to create a new gmail account
One inbox to rule them all — how to transfer emails between Gmail accounts
Latest in News
Apple Watch Series 10
Future Apple Watch models could get a surprising new feature — what we know
iPhone 16 Pro vs iPhone 16 Pro Max in hand showing displays
Forget iPhone 17 — iPhone 18 could get this huge upgrade
The new Husqvarna iQ series robot lawn mower.
Husqvarna’s new robot mowers offer GPS for less
Rendered images of rumored foldable iPhone.
Foldable iPhone report just revealed key details — here's what we know
NYTimes Connections
NYT Connections today hints and answers — Sunday, March 23 (#651)
NYT Strands on a cellphone
NYT Strands today — hints, spangram and answers for game #385 (Sunday, March 23 2025)