Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Program] Obfucate an email address for websites
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
wjholden
l33t
l33t


Joined: 01 Mar 2004
Posts: 825
Location: Augusta, GA

PostPosted: Sat May 06, 2006 7:34 am    Post subject: [Program] Obfucate an email address for websites Reply with quote

I really hate it when I find a website with no contact information, but everybody is scared to post their email address on the web with the spam and worms and whatnot. A simple trick you can pull that seems to work for some people is to use HTML ASCII Special Character codes for their entire email address (I would also recommend using mail@@@example...net or something too). Here's a program you can use to do it for you:
Code:
#include <stdio.h>
#include <stdlib.h>

#define STR_MAX_LENGTH 1024

/**
 * W. John Holden (http://wjholden.com)
 * Save as "convert.c", compile with "gcc convert.c -o convert",
 * run with "./convert", type in your email address and your
 * email address will be printed out in HTML ASCII Special
 * Character codes. Great for obfuscating an email address
 * on a website.
 */

int main (int argc, char * argv[])
{
  char str[STR_MAX_LENGTH];
  int x, y;
  x = y = 0;
  for ( ; x < STR_MAX_LENGTH && str[x-1] != '\n'; x++)
    {
      str[x] = getchar();
    }
  str[x] = '\0';
  while (y < x)
    {
      printf("&#%d;", str[y++]);
    }
  printf("\n");
  return(EXIT_SUCCESS);
}
Back to top
View user's profile Send private message
frostschutz
Advocate
Advocate


Joined: 22 Feb 2005
Posts: 2424
Location: Germany

PostPosted: Sat May 06, 2006 7:51 am    Post subject: Reply with quote

How many worms are there that affect Linux/Gentoo? (Why should I care about Windoze users?) How many spam mails make it through a properly configured SpamAssassin or similar spamfilter? I've got a catchall address on my domain and I still post my email address on many places in the web, in plain text; naturally I get an awful lot of spam every day, but it's a rare mail that makes it through the filters. I'm actually more annoyed by spammers who use my address / domain name in the 'From:' field and the tards who reply to me and demand to stop spamming them... although it's clearly visible from the mail header and common knowledge in general that spammers use fake From: addresses... people are morons.
Back to top
View user's profile Send private message
wjholden
l33t
l33t


Joined: 01 Mar 2004
Posts: 825
Location: Augusta, GA

PostPosted: Sat May 06, 2006 8:24 am    Post subject: Reply with quote

There aren't many viruses/worms that affect Linux/UNIX. There are a handful, but most of them target Apache (actually, some of the most interesting worms in history would attack Apache, then compile themselves into the operating system and compiler itself).

The principal method your email address reaches a spammers database is when your sister-in-law or preacher or district manager or whatever forwards a touching remark about how great the good old (racist, sexist, oops-better get back on topic) days of the 1950's were, using dozens of email addresses in the "To:" field. Of course, if people would have their sysadmin set up a MajorDomo list server, this wouldn't be much of an issue, but it is. And when someone else forwards this message, including your email address, to all their computer-illiterate friends, one of them is bound to have a virus/spyare infected Windows-based PC, which will promptly grab all the email addresses it finds out of IE or Outlook Express and beam that information straight to Russia.

There's no way to keep people from being irresponsible with email. Well, bitch out your district manager the next time he or she forwards you a chain letter, or offer to set up a list server for your whole family.

SpamAssassin works great. We use Sieve Scripts here (at North Carolina State University, where I used to work, today was my last day) to filter email and, although you will get false positives and some things will fall through the cracks, that's what an "INBOX.Spam" folder is for, in general it works (be sure you disable images in your mail client before reading something you aren't sure about). A lot of people think spam isn't a problem anymore because it hardly reaches their AOL mailbox (for the record, AOL has excellent spam filters), but it's simply not true: it's being caught on the backend, and there's a lot of it.

The above program is just to give a webmaster piece of mind about posting his or her email address on their website. Can't hurt...unless somebody is reading it with a different encoding scheme, in which case it'll do something weird.

Oh, and if you want to shut somebody up about "sending you spam" and how they're going to "call the police" (not the FBI, mind you), here's a script I wrote to demonstrate how trivially easy it is to spoof email addresses (like you said, if you look at the header it's obvious it's a fake, but nobody does...):
Code:
#!/usr/local/bin/perl -w
# Save as "mailer.pl", type "perl mailer.pl" to execute after you fill in your SMTP server and address.
use Net::SMTP;

$mySMTPServer = ''; # your SMTP server here
$myFromEmailAddress = ''; # the address you're spoofing and sending to

$smtp = Net::SMTP->new($mySMTPServer);

$address = $myFromEmailAddress;

$smtp->mail($address);
$smtp->to($address);

$smtp->data();
$smtp->datasend("To: $address\n");
$smtp->datasend("Subject: Ever gotten an email from yourself?\n");
$smtp->datasend("\n");
$smtp->datasend("Here's the code for what I did:\n");

open (FH, "mailer.pl");
while ($line = <FH>)
{
    $smtp->datasend($line);
}

$smtp->dataend();

$smtp->quit;
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum