In my day job as the communications guy for ValiMail, I spend a lot of time explaining how easy it is to create fraudulent emails using an email address that doesn’t belong to you.
A faked “from” address, in fact, how the majority of email attacks happen. And email attacks (aka phishing) are how the majority (actually the vast majority) of cyberattacks begin. So the ease of faking emails from people is a major vulnerability.
But, you ask, why would I bother faking an email from “company.com” when I could just register a fake lookalike domain (like c0mpany.com) and use that? Or create a Gmail account (email@example.com) and give it a friendly name that looks like the CEO of a company?
Well, actually, it’s significantly easier to forge the address of a real person at a real company than it is to register a fake domain, or even to create a throwaway Gmail account.
Here’s how easy it is.
Find a website like deadfake, which describes itself as “a site that lets you send free fake emails to anyone you like.” Or anonymailer.net. Or spoofbox.com. There are dozens. Many of them are free, some cost a little money to send mail. Then:
- Enter your recipient’s email address in the To: field.
- Put whatever email address you want in the From: field.
- Craft your message and press the Send Now! Button.
Here’s a message I sent to myself using President Trump’s address. Note that Gmail is a suspicious of the source — that’s why it put a little red question mark next to the address.
Unix command line
If you have a computer that’s set up with mail services — or you can telnet or SSH to a computer that has mail services — you can forge a from address with one line. Just type this:
That creates a message that says “firstname.lastname@example.org” in the From field. Type in a subject line and the rest of your message, press Ctrl-D when you’re done, and off the message goes.
This doesn’t work in every version of Unix, and whether it works at all depends on how your system is set up (whether it’s connected to Sendmail, etc.). Still, this is the basic idea and it works in many systems.
Because I’m not very sophisticated about programming I use PHP when I need to code stuff for my personal websites. It’s fast, easy, and used by about 90% of the people (like me) who don’t know any more about programming than they were able to pick up through Google searches and by stealing snippets of code published on various public forums. (Which is also why PHP is often accused of being insecure.) Hey, I built a whole website content management system in PHP. If I can figure it out, how hard can it be?
Without getting into all the pros and cons of PHP, I will say that it is perfect for email purposes. You can forge emails with five lines of very simple PHP code:
<?php $to = 'email@example.com'; $subject = 'the subject'; $message = 'hello'; $headers = 'From: firstname.lastname@example.org' . "\r\n"; mail($to, $subject, $message, $headers); ?>
Note: These are actual lines of code used as an example in the online manual for PHP’s mail() function. I took out a couple of lines you don’t actually need.
Again: configurations vary; maybe this won’t work on every version of PHP on every server.
Email Is a Very Trusting Place
The email world, until quite recently, was an entirely trusting place. Most of it still is. No matter who I am, if I use the Unix mail command or PHP mail(), the email goes off into the internet and the internet obligingly delivers it to whomever, with the exact headers that I specified. Nobody checks to see if I own the address I used in the from field. Nobody cares.
Well, almost nobody: As I noted above, Gmail and some other mail clients are starting to flag mail that looks suspicious, like my anonymailer message. Still, that’s dependent on the client you use and/or the receiving mail server.
Granted, these spoofing tools are pretty simplistic. If I want to do some fancier formatting and make my messages look even more realistic, it takes a little more work. But the basic forgery is just that simple.
The only thing truly stopping fake From addresses is email authentication using a standard called DMARC. But that only works if the domain you’re trying to fake has published a DMARC record and set it to an enforcement policy. Then, and only then, will almost all email servers that receive messages (Gmail, Yahoo Mail, etc.) block the faked emails.
Fortunately for fraudsters, most of the Internet’s domains haven’t done this yet. For example, only about 4% of .gov domains have protected themselves.
As for other 96%? Fraudsters can forge emails from those domains all day long with no repercussions.
Domains like justice.gov. House.gov. Senate.gov. Whitehouse.gov.
And also domains like democrats.org, dnc.org, gop.com, rnc.org. And DonaldJTrump.com.
All of them can be easily faked by email scammers with access to a Unix command line or some rudimentary PHP skills. And, as we are learning, scammers have been taking advantage of that vulnerability. For instance, according to one source, one in four email messages from .gov domains are fraudulent.
And that’s why I am trying to get the message out: It’s way too easy to fake emails from most sources. We need to start authenticating our email, today.
Also published on Medium.