forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Spam harvest whacker

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Visual DialogScript 3 Source Code
View previous topic :: View next topic  
Author Message
Dr. Dread
Professional Member
Professional Member


Joined: 03 Aug 2001
Posts: 1065
Location: Copenhagen, Denmark

PostPosted: Sat Mar 29, 2003 8:54 am    Post subject: Spam harvest whacker Reply with quote

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:&#119;&#101;&#98;&#109;&#97;&#115;&#116;&#101;&#114;&#64;&#109;&#121;&#115;&#105;&#116;&#101;&#46;&#99;&#111;&#109;"> &#119;&#101;&#98;&#109;&#97;&#115;&#116;&#101;&#114;&#64;&#109;&#121;&#115;&#105;&#116;&#101;&#46;&#99;&#111;&#109;</A>


A webmaster strikes back Evil or Very Mad

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
View user's profile Send private message
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Sat Mar 29, 2003 9:26 am    Post subject: Reply with quote

Here's another method Dread... Wink
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 Smile

_________________
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
View user's profile Send private message Send e-mail
ShinobiSoft
Professional Member
Professional Member


Joined: 06 Nov 2002
Posts: 790
Location: Knoxville, Tn

PostPosted: Sat Mar 29, 2003 9:59 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
Dr. Dread
Professional Member
Professional Member


Joined: 03 Aug 2001
Posts: 1065
Location: Copenhagen, Denmark

PostPosted: Sat Mar 29, 2003 10:17 am    Post subject: Reply with quote

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
View user's profile Send private message
Dr. Dread
Professional Member
Professional Member


Joined: 03 Aug 2001
Posts: 1065
Location: Copenhagen, Denmark

PostPosted: Sat Mar 29, 2003 10:23 am    Post subject: Reply with quote

Mac wrote:
Here's another method Dread... Wink

Cheers, Mac Smile


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
View user's profile Send private message
ShinobiSoft
Professional Member
Professional Member


Joined: 06 Nov 2002
Posts: 790
Location: Knoxville, Tn

PostPosted: Sat Mar 29, 2003 10:47 am    Post subject: Reply with quote

I stand corrected Dread. I must have had an error of some sort when I tried
your code on a web page. Shocked Embarassed Works great ! Laughing Twisted Evil

_________________
Bill Weckel
ShinobiSoft Software

"The way is known to all, but not all know it."
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Sat Mar 29, 2003 12:38 pm    Post subject: Reply with quote

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. Laughing

But I can't find it. Sad

_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
Garrett
Moderator Team


Joined: 04 Oct 2001
Posts: 2144
Location: A House

PostPosted: Sat Mar 29, 2003 8:27 pm    Post subject: Reply with quote

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.)
Necroprogramming FTW! - "Wait.. Is necroprogramming legal?"
http://www.freewarehome.com <-- Freeware listings since 1996
Back to top
View user's profile Send private message
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Sat Mar 29, 2003 10:53 pm    Post subject: Reply with quote

great idea dr dread Smile

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
View user's profile Send private message Visit poster's website MSN Messenger
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Sun Mar 30, 2003 12:32 am    Post subject: Reply with quote

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. Wink

Cheers, Mac Smile

_________________
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
View user's profile Send private message Send e-mail
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Sun Mar 30, 2003 12:43 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website MSN Messenger
Dr. Dread
Professional Member
Professional Member


Joined: 03 Aug 2001
Posts: 1065
Location: Copenhagen, Denmark

PostPosted: Mon Mar 31, 2003 6:59 pm    Post subject: Reply with quote

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
View user's profile Send private message
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Tue Apr 01, 2003 3:53 pm    Post subject: Reply with quote

Why don't you use Javascript & heximal numbers? Just double-checking... Laughing
Back to top
View user's profile Send private message
ShinobiSoft
Professional Member
Professional Member


Joined: 06 Nov 2002
Posts: 790
Location: Knoxville, Tn

PostPosted: Tue Apr 01, 2003 4:10 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Tue Apr 01, 2003 4:55 pm    Post subject: Reply with quote

But as an extra function? To choose between heximal, Javascript and Javascript+heximal...
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Visual DialogScript 3 Source Code 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
You can attach files in this forum
You can download files in this forum




Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group