Industry


Ads by TechWords

See your link here


Amir Lev's picture
Amir Lev

Security Levity

Ask Amir: How do spammers send from my email address?

In a previous Security Levity post, I was asked a question that often comes up. A commenter wondered how is it that spammers can send spam from "my" email address? And is that something we should be worried about?

Our anonymous friend asks:

This is probably a neophyte question, but I have always wondered how spammers send spam to my address, using my address as well. I suppose it's not that hard considering I can send myself a message at anytime, but I'm curious as to how the spammers do this.

This is absolutely a frequently-asked question, and not at all "greenhorn" (thanks to my handy thesaurus for that one). To answer it requires an understanding of SMTP -- the standard used for sending email between servers -- which stands for Simple Mail Transfer Protocol.

Like many "mature" Internet standards, SMTP was invented back in the days when the Internet was a kinder, gentler place. A time when there was no spam, and the only users of the network were experimental souls, with good karma, who were trusted by all the other users. Yes, there really was such a time!

Although SMTP has been enhanced quite a bit since then, many mail servers still operate with an assumption of trust. An evil spammer can pretend to be another mail server, connect to your mail server, and offer up a message that's not only addressed to you, but claims to have come from you as well! It's forgery, plain and simple; and forgery that's made simple by the implicit, blind trust that many mail servers have for each other.

In fact, the spammers can send messages that pretend to come from anybody -- that's one of the tricks in the phishers' toolbag, allowing them to forge messages "from" your bank. Not only that, but spammers can send email to your friends and business associates, while pretending to be you. Not good at all.

 
How to prevent the problem

The simple answer is that recipients need a spam filter that will detect and filter out those forged messages. (Well, I would say that, wouldn't I?)

There are also Internet standards that help other people's spam filters to detect forgeries of your email address. The main ones are SPF/SenderID and DomainKeys/DKIM. In simple terms, they allow you to publish information that tells a receiving email system whether a message "from" you is likely to be forged or not.

It's a good idea for email senders to support all these standards, to help prevent spammers forging your email addresses. First, your email administrator should publish an accurate SPF record for each domain you own. Second, your email system should sign all your outgoing email with DKIM. Talk to the people running your email system and ask them if they're doing both these things. (If they're not, ask them why and post their excuses below!)

For various reasons, the standards aren't 100% foolproof, but they're useful as part of the spam filtering process. I don't have enough space to go into much detail in this post, but if you'd like me to talk in more detail about this in the future, do please write in below.

No discussion of sender forgery would be complete without a mention of backscatter (or "outscatter") -- rogue auto-replies that go to the message's forged sender. As I mentioned in a previous comment reply, that's something I plan to talk about soon.

 
I want to make this an interactive place: where I can answer questions and cover topics that you suggest. Feel free to add comments and ask Amir!
 
 
When he's not masquerading as an FBI agent, Amir Lev is the CTO, President, and co-founder of Commtouch (NASDAQ:CTCH), an e-mail and Web defense technology provider. MORE...

What People Are Saying

damn spam ....

I had this case already. Unfortunately, I can do nothing against spam because my email still from 56k modem times (year 1998) and I had no protection for the internet

It's called a 'Joe Job' and

It's called a 'Joe Job' and if I could get my hands on the guy who's done it to me in the past, why, I'd...

Joe Job etymology

Yeah, when there's a deliberate campaign of mass forgery using your address, it's often called a Joe Job. Named after the 1997 attack on Joe Doll by a disgruntled customer.

[Nitpick corner: the original attack spam simply set the Reply-to: headers of spam to Joe Doll's email address. Not exactly a forgery.]

Abusing the power

I think I use the same technique when I send messages from one of my accounts but make it look like it's coming from another. It helps me consolidate yet maintain multiple online identities. I wonder if doing so triggers others' spam filters?

Re: Abusing the power

It can do. Especially if the spam filter is one of the more 'naive' or aggressive ones.

Your best plan is to send using SPF and DKIM, ensuring that they are correctly configured to support your benign forgeries.

Don't forget to setup SPF for any other domains you're sending on behalf of. You might have difficulty using DKIM if you're using several domains.

You might also consider setting the Sender: header to be the "true" email address of the sending account. Although this can be displayed strangely by Microsoft Outlook.

Talk more about concern...

Amir, can you talk a little more about "is that something we should be worried about?"

The symptom I usually see when people are sending email using my email address is bounces in my inbox - or especially in my spam folder - from email servers reporting that an email from me was sent to a bad email address.

Boy that was a bad sentence. Hopefully you get what I'm trying to say.

Is this something people should be concerned about? Are some people targeted more than others for having their email address "spoofed?"

Also, you mentioned having your administrator change your email settings. What if I use a web service like Gmail, Hotmail, Yahoo, etc.? Also, what if I have my own server and am sending email using that?

Thanks for your help...

Your email address will be

Your email address will be used more often if it is publicized (especially on websites) and will be picked up by bots that scan the Internet looking for email addresses to spam and spam from. In addition, it can be used in targeted attacks on your friends to exploit the trust you have between yourself and your friends. For a normal person that doesn't post their email address in forums and their personal website and also are not important enough (monetarily or politically) to be targetted by a hacker, its not something worrying will change.

As for web services, email headers will show who actually sent the email although no one ever seems to read these but signing an email a certain way or putting a custom signature will help prove emails you send are legitimate (to an extent).

Backscatter (or "outscatter")

Yes, that's the backscatter (or "outscatter") I referred to. I'll come to that in a future blog post.

One doubt

Amir, thanks for the interesting and helpful info on the email spam tricks. From what I read elsewhere, the users are advised not to turn on the display of the pictures in the emails from 'bad' senders, since they can signal the senders about the active existence of the users' email and can also execute malicious code. The users are advised to not open any suspicious emails at all, as merely opening the email can execute bad code, even when the display of images is turned off.

Well, I wanted to know what a user should do if the user receives an email that claims to be from someone the user knows. As mentioned in the article, since any email can be from anyone, exactly what is there to know if a user should open it or not?

As suggested in the article, the "email administrator should publish an accurate SPF record for each domain the user owns, and the email system should sign all outgoing email with DKIM". My question applies untill all of the email systems have done this.

As an aside, I'd also like to know more about exactly how a picture can execute a code; a picture format is not something executable, after all. Also, how does just opening the email execute a code? Hope you'll shed some light on these issues in some of your future article. Thanks.

Re: One doubt

Yes, the usual advice to not open "suspicious" email is pretty useless, as you've pointed out.

Simply opening a message can be harmful if you have an older email client. Bad guys could exploit bugs in the JavaScript parser, or redirect you to a malware site. This is the reason that later versions of Outlook use the Word HTML viewer, and no longer use an embedded Internet Explorer HTML control.

We've also seen bugs in some image display code, which could be exploitable.

And, yes, everyone should ideally publish SPF and send using DKIM, but you shouldn't wait until everyone else does before you do. From a purely selfish point of view, it can help your email not become a false positive (i.e., be accidentally filtered as spam).