View previous topic :: View next topic |
Author |
Message |
Dr. Dread Professional Member
Joined: 03 Aug 2001 Posts: 1065 Location: Copenhagen, Denmark
|
Posted: Sat Mar 29, 2003 8:54 am Post subject: Spam harvest whacker |
|
|
Well, I'm webmaster for almost a dozen websites. You wouldn't believe the amount of spam
mails that drop in because some bozos run an email address harvester past those sites.
I'd really like to reduce the amount of spam without removing the mail links that legitimate visitors
can use. So I have figured out something that just might make it more difficult to spammers.
Code: |
%%in = @input(Enter the mail address to process)
if @null(%%in)
exit
end
%%inc = 1
repeat
%%out = %%out@asc(@substr(%%in,%%inc,));
%%inc = @succ(%%inc)
until @greater(%%inc,@len(%%in))
clipboard set,%%out
Info Output is in the clipboard |
Basically it takes an email address and converts it to ASCII character codes. That should block most
bots/harvesters etc. from reading the actual address, while still allowing visitors to view and use the proper
address on web pages, mailto links etc.
Usage: Just run this utility, input the mail address that you want "garbled". Output will be in the
Clipboard so you can paste it back into your HTML document, overwriting the original address.
Remember to replace addresses both in mailto anchors AND between anchor tags.
For instance:
<A HREF="mailto:webmaster@mysite.com">webmaster@mysite.com</A>
should become
<A HREF="mailto:webmaster@mysite.com"> webmaster@mysite.com</A>
A webmaster strikes back
Enjoy
Dread _________________ ~~ Alcohol and calculus don't mix... Don't drink and derive! ~~
String.DLL * advanced string processing
Last edited by Dr. Dread on Sat Mar 29, 2003 10:25 am; edited 1 time in total |
|
Back to top |
|
|
Mac Professional Member
Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Sat Mar 29, 2003 9:26 am Post subject: |
|
|
Here's another method Dread...
In the Header
Code: |
<script language="javascript">
<!-- Hide this from old browsers
// hide email address from webcrawlers.
var part1 = "myemail";
var part2 = "hotmail.com";
var mymail = part1 + "@" + part2;
// -->
</script>
|
Example to use it in the body
Code: |
<script language="javascript">
<!-- Hide this from old browsers
document.write("<a href=mailto:"+mymail+">Email me here</a>");
// -->
</script>
|
Cheers, Mac _________________ VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
|
|
Back to top |
|
|
ShinobiSoft Professional Member
Joined: 06 Nov 2002 Posts: 790 Location: Knoxville, Tn
|
Posted: Sat Mar 29, 2003 9:59 am Post subject: |
|
|
Hey Dread,
You have a good idea goin' here, but there is one problem. If you scramble
the address that the end user must see, the address isn't readable. It still
appears like it is within the <a> start tag. Do ya know what I mean? _________________ Bill Weckel
ShinobiSoft Software
"The way is known to all, but not all know it." |
|
Back to top |
|
|
Dr. Dread Professional Member
Joined: 03 Aug 2001 Posts: 1065 Location: Copenhagen, Denmark
|
Posted: Sat Mar 29, 2003 10:17 am Post subject: |
|
|
bweckel wrote: | You have a good idea goin' here, but there is one problem. If you scramble
the address that the end user must see, the address isn't readable. It still
appears like it is within the <a> start tag. Do ya know what I mean? |
Hey Bill!
The thing is that the address is only scrambled in the HTML source code that bots read. When read in the
browser everything is normal - users won't see the difference, and clicks on a mailto link will run as usual.
Sample:
Mail : webmaster@mysite.com
If you view the source of this page you'll see that the address is coded in HTML ASCII codes.
Greetz
Dread _________________ ~~ Alcohol and calculus don't mix... Don't drink and derive! ~~
String.DLL * advanced string processing
Last edited by Dr. Dread on Sat Mar 29, 2003 10:38 am; edited 3 times in total |
|
Back to top |
|
|
Dr. Dread Professional Member
Joined: 03 Aug 2001 Posts: 1065 Location: Copenhagen, Denmark
|
Posted: Sat Mar 29, 2003 10:23 am Post subject: |
|
|
Mac wrote: | Here's another method Dread...
Cheers, Mac |
Thanks, Mac! Should work in javascript-enabled browser.
Greetz
Dread _________________ ~~ Alcohol and calculus don't mix... Don't drink and derive! ~~
String.DLL * advanced string processing |
|
Back to top |
|
|
ShinobiSoft Professional Member
Joined: 06 Nov 2002 Posts: 790 Location: Knoxville, Tn
|
Posted: Sat Mar 29, 2003 10:47 am Post subject: |
|
|
I stand corrected Dread. I must have had an error of some sort when I tried
your code on a web page. Works great ! _________________ Bill Weckel
ShinobiSoft Software
"The way is known to all, but not all know it." |
|
Back to top |
|
|
FreezingFire Admin Team
Joined: 23 Jun 2002 Posts: 3508
|
Posted: Sat Mar 29, 2003 12:38 pm Post subject: |
|
|
Once I found a PHP script that generated e-mail addresses of the host
that visits. I thought it was pretty cool because the spambot would end
up spamming its own ISP.
But I can't find it. _________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
Back to top |
|
|
Garrett Moderator Team
Joined: 04 Oct 2001 Posts: 2149 Location: A House
|
Posted: Sat Mar 29, 2003 8:27 pm Post subject: |
|
|
I've been using the same method that Dread noted here for a some
time now, and it does help greatly.
-Garrett _________________ 'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.) |
|
Back to top |
|
|
Serge Professional Member
Joined: 04 Mar 2002 Posts: 1480 Location: Australia
|
Posted: Sat Mar 29, 2003 10:53 pm Post subject: |
|
|
great idea dr dread
i'll use your idea when i revamp my web site
i've been using mac's idea but wasn't sure if that was totally safe as a smart bot should pick up the email this way...me think...could be wrong...
Serge _________________
|
|
Back to top |
|
|
Mac Professional Member
Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Sun Mar 30, 2003 12:32 am Post subject: |
|
|
Just to clarify - the code I posted isn't my idea, I got it
from the net (somewhere?) a few years ago.
It's only drawback (that I know of), is that javascript must
be ON to see the email link.
However - I'm thinkin' I like Dread's idea better anyway.
Cheers, Mac _________________ VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
|
|
Back to top |
|
|
Serge Professional Member
Joined: 04 Mar 2002 Posts: 1480 Location: Australia
|
Posted: Sun Mar 30, 2003 12:43 am Post subject: |
|
|
no probs mac...i came across the same idea when i bought a cd of javascript scripts for web sites a few years back and i thought that it was a good idea when i first saw it and i then went on to use it at my site
Serge _________________
|
|
Back to top |
|
|
Dr. Dread Professional Member
Joined: 03 Aug 2001 Posts: 1065 Location: Copenhagen, Denmark
|
Posted: Mon Mar 31, 2003 6:59 pm Post subject: |
|
|
Extended version of the anti-spam tool:
Features:
* Generates entire HTML mailto links
* Makes it hard for bots etc. to harvest the address - but in browser view everything is normal
* Mail address AND 'mailto:' sequence in anchor is "scrambled" to thwart address harvesters
* Choice between normal tag or tag output by JavaScript (on the wake of Mac's comment - greater
security, but users without JavaScript-enabled browser will see nothing..)
* Performs mail address validation (this part I made in coop with Garrett some time ago)
Code: |
title Mailto link encoder
dialog CREATE,Mailto link encoder ...by Dread,-1,0,340,130
dialog ADD,EDIT,address,15,10,285
dialog ADD,TEXT,TEXT1,1,10,,,Email address:
dialog ADD,TEXT,TEXT2,40,10,,,Link text:
dialog ADD,EDIT,Link,53,10,285
dialog ADD,STYLE,KNAP,Times New Roman,10,B
dialog ADD,CHECK,JS,112,10,,,Use JavaScript,
dialog ADD,BUTTON,End,80,234
dialog ADD,BUTTON,Go,80,10,100,,Generate !,KNAP
dialog SHOW
:evloop
wait event
goto @event()
:GoBUTTON
if @null(@dlgtext(Link))
%%link = "mail me"
else
%%link = @dlgtext(Link)
end
if @null(@dlgtext(address))
info Please enter an email address!
dialog focus,address
goto evloop
else
%%email = @dlgtext(address)
gosub CheckMail
if @not(@null(%%error))
goto evloop
end
end
%%inc = 1
repeat
%%out = %%out@asc(@substr(%%Email,%%inc,));
%%inc = @succ(%%inc)
until @greater(%%inc,@len(%%Email))
rem Generate mailto
%%start = @CHR(38)#109;@CHR(38)#97;@CHR(38)#105;@CHR(38)#108;@CHR(38)#116;@CHR(38)#111;@CHR(38)#58;"
if @dlgtext(JS)
%%JS1 = "<script language="@CHR(34)"JavaScript"@CHR(34)"> <!-- "
%%JS2 = "// --> </script>"
%%mailto = %%JS1@CR()document.write('<a href=@CHR(34)%%start%%out@CHR(34)>%%link</A>');@CR()%%JS2
else
%%mailto = <A HREF=%%start%%out>%%link</A>
end
clipboard set,%%mailto
info Mailto link is in the clipboard
%%out = ""
goto evloop
:EndBUTTON
:CLOSE
stop
rem ##### SUBs #####
:CheckMail
option DecimalSep,.
option Fieldsep,@chr(64)
parse "%%PreAddy;%%SvrAddy",%%Email
%%svrdomain = @name(%%SvrAddy)
%%svrextention = @ext(%%SvrAddy)
rem Minimum length of an email address is 6, e.g. a@b.cd
if @not(@greater(@len(%%email),5))
%%error = Address too short
goto BadEmail
end
rem The email address must contain an '@' and at least one dot.
if @not(@greater(@pos("@",%%email),0))
%%error = "No '@' character"
goto BadEmail
else
if @not(@greater(@pos(".",%%email),0))
%%error = No valid domain name (no dot)
goto BadEmail
end
end
rem Mail addresses cannot contain '.' and '@' next to each other
if @greater(@pos(".@",%%email),0)@greater(@pos("@.",%%email),0)@greater(@pos("..",%%email),0)@greater(@pos("@@",%%email),0)
%%error = Illegal character sequence detected
goto BadEmail
end
rem Email addresses do not start with '@' or '.'
if @equal(@substr(%%email,1,),".")@equal(@substr(%%email,1,),"@")
%%error = "Email addresses do not start with '@' or '.'"
goto BadEmail
end
rem Email addresses cannot contain '_', '~' or '#' after the @ sign.
if @greater(@pos("_",%%SvrAddy),0)@greater(@pos("~",%%SvrAddy),0)@greater(@pos("#",%%SvrAddy),0)
%%error = "Email addresses cannot contain '_', '~' or '#' after the @ sign"
goto BadEmail
end
rem Email accounts cannot contains commas or spaces
if @greater(@pos(" ",%%Email),0)@greater(@pos(",",%%Email),0)
%%error = "Email addresses cannot contains commas or spaces"
goto BadEmail
end
rem The top-level domain must be at least 2 chars long
if @not(@greater(@len(%%SvrExtention),1))
%%error = "The top-level domain must be at least 2 chars long"
goto BadEmail
end
rem Check for invalid chars
%x = 0
repeat
%x = @succ(%x)
%%char = @substr(%%email,%x,)
if @numeric(%%char)@equal(%%char,".")@equal(%%char,"_")@equal(%%char,"-")@equal(%%char,"~")@equal(%%char,"@")@equal(%%char,"a")
else
if @greater(%%char,z)@not(@greater(%%char,a))
%%error = "Invalid character detected"
goto BadEmail
end
end
until @equal(%x, @len(%%Email))
EXIT
:BadEmail
info Bad address@cr()Error: %%error
dialog focus,address
EXIT
|
Greetz
Dread _________________ ~~ Alcohol and calculus don't mix... Don't drink and derive! ~~
String.DLL * advanced string processing |
|
Back to top |
|
|
Skit3000 Admin Team
Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
Posted: Tue Apr 01, 2003 3:53 pm Post subject: |
|
|
Why don't you use Javascript & heximal numbers? Just double-checking... |
|
Back to top |
|
|
ShinobiSoft Professional Member
Joined: 06 Nov 2002 Posts: 790 Location: Knoxville, Tn
|
Posted: Tue Apr 01, 2003 4:10 pm Post subject: |
|
|
Quote: |
* Choice between normal tag or tag output by JavaScript (on the wake of Mac's comment - greater
security, but users without JavaScript-enabled browser will see nothing..)
|
Mainly because of users that don't have JavaScript enabled for their browsers. _________________ Bill Weckel
ShinobiSoft Software
"The way is known to all, but not all know it." |
|
Back to top |
|
|
Skit3000 Admin Team
Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
Posted: Tue Apr 01, 2003 4:55 pm Post subject: |
|
|
But as an extra function? To choose between heximal, Javascript and Javascript+heximal... |
|
Back to top |
|
|
|
|
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 You can attach files in this forum You can download files in this forum
|
|