The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> An empty cs(Referer),
Mark2
post Mar 5 2013, 03:14 PM
Post #1


Member
***

Group: Members
Posts: 36
Joined: 2-March 13
Member No.: 18,752



Hi,

ASP problem need your help:

From my log file, I have noticed that sometimes cs(Referer) for a page (say A.asp) is empty. This page is supposed come from a link
<a href="A.asp">......</a> in the first page Index.asp or other pages in my site.
I know one can directly type/paste the address of A.asp and causes an empty cs(Referer), but it would be much easier to click a link in the first page Index.asp or other pages in my site.

Can you guess why sometimes cs(Referer) for the page is empty?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Mar 5 2013, 03:30 PM
Post #2


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,730
Joined: 9-August 06
Member No.: 6



Referer is an optional header. Browsers don't have to send it. Some browsers let you turn it off right from the menu.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Mar 5 2013, 05:58 PM
Post #3


.
********

Group: WDG Moderators
Posts: 9,656
Joined: 10-August 06
Member No.: 7



I've turned it off in some of my browsers.

More commonly, I don't think links that the user opens in new window will send one. Ditto for bookmarked URLs.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Mark2
post Mar 5 2013, 08:40 PM
Post #4


Member
***

Group: Members
Posts: 36
Joined: 2-March 13
Member No.: 18,752



Thanks a lot for helps from you two experts.

That means an empty referer is possible for a good visiter.....
I was trying to block a bad visiter who seems use an empty referer.

The bad visiter keep trying to post sex advertisments in my website for a few years and I don't know how he can get so many IPs, I cannot block him by IPs.

He also posted a lot similar sex advertisments in many websites around the world but seems nobody can or is willing to stop him!
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Mar 5 2013, 09:40 PM
Post #5


.
********

Group: WDG Moderators
Posts: 9,656
Joined: 10-August 06
Member No.: 7



I'm no expert, but you're welcome anyway...

One way to obstruct spambots (but not real, human spammers) is with javascript encryption, like this one: http://www.jottings.com/obfuscator/

Note that the above is for email links. If you use a form you need to edit the document.write line so that it prints the form's ACTION attribute value instead of an email link. You also need to change the URL of the form's server-side script, since its current URL is known by spammers.

Users without javascript will of course be unable to post this way. If you're really ambitious you might let such users post, but keep their posts hidden until you've previewed them. This can be done by not hiding the ACTION value, but instead let the javascript populate a hidden form field with a "password". If the hidden field sends the "password", the server-side script will show the post right away. If the hidden field is empty (because JS is not used), the post is hidden until you've previewed it manually.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Mar 6 2013, 01:56 AM
Post #6


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,730
Joined: 9-August 06
Member No.: 6



No, you can never assume that an empty referer is a bad guy. It's a common mistake with for instance scripts that are preventing image leeching, to allow a list of approved domains but forget the empty referer.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Mark2
post Mar 6 2013, 08:15 AM
Post #7


Member
***

Group: Members
Posts: 36
Joined: 2-March 13
Member No.: 18,752



To Christian J,

Thank you for the way to obstruct spambots.
However, what I meant was not email links .... For example, a bad guy clicked the "NEWTOPIC" button in this page, and then posted many sex page links here. Every time the content of the sex page links were not repeated so difficult to block them.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Mark2
post Mar 6 2013, 08:19 AM
Post #8


Member
***

Group: Members
Posts: 36
Joined: 2-March 13
Member No.: 18,752



QUOTE(pandy @ Mar 6 2013, 01:56 AM) *

No, you can never assume that an empty referer is a bad guy. It's a common mistake with for instance scripts that are preventing image leeching, to allow a list of approved domains but forget the empty referer.


To pandy,

OK, thank you. I will try something else.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Mar 6 2013, 10:01 AM
Post #9


.
********

Group: WDG Moderators
Posts: 9,656
Joined: 10-August 06
Member No.: 7



QUOTE(Mark2 @ Mar 6 2013, 02:15 PM) *

To Christian J,

Thank you for the way to obstruct spambots.
However, what I meant was not email links .... For example, a bad guy clicked the "NEWTOPIC" button in this page, and then posted many sex page links here. Every time the content of the sex page links were not repeated so difficult to block them.

Yes, that's why you must adapt the javascript to work with forms (see my previous post).
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Mar 6 2013, 10:11 AM
Post #10


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,730
Joined: 9-August 06
Member No.: 6



You can ban by IP if he's always using the same. Not with JavaScript but with a .htaccess file if you are on Apache.

But "New Topic" sounds like a forum and they more often than not have banning features built in, so you can probably just add his IP address to the filters from the Admin section.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Mark2
post Mar 6 2013, 12:02 PM
Post #11


Member
***

Group: Members
Posts: 36
Joined: 2-March 13
Member No.: 18,752



Dear Pandy,

He has been using hundreds different IPs. It is difficult to block him by IPs.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Mar 6 2013, 02:27 PM
Post #12


.
********

Group: WDG Moderators
Posts: 9,656
Joined: 10-August 06
Member No.: 7



QUOTE(Christian J @ Mar 6 2013, 04:01 PM) *

that's why you must adapt the javascript to work with forms (see my previous post).

Here's a simple example. First rename the ASP script file. Then give the FORM an ID, and remove the URL in the ACTION attribute:

CODE
<form id="f" method="post" action="">
...
</form>

Next generate the javascript from http://www.jottings.com/obfuscator/ but put the new URL of your ASP script (instead of an email address) in the generator. Then place the generated javascript after the form on your web page, and finally replace this line:

CODE
document.write("<a href='mailto:"+link+"'>"+link+"</a>")

with this:

CODE
document.getElementById('f').action=link;

Now you have a form that will only submit to the correct ASP URL when javascript is enabled.

(In my experience many spambots still don't understand javascript - at least the javascript-obfuscated forms I've tried seem to block them - but that can of course change in the future. The widespread use of CAPTCHA:s may indicate that some spambots may already understand javascript. Personally I'd avoid CAPTCHA if possible, since they are a hassle for human users too.)


User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Mark2
post Mar 6 2013, 06:25 PM
Post #13


Member
***

Group: Members
Posts: 36
Joined: 2-March 13
Member No.: 18,752



Christian J,

Thank you so much and I understand what you mean now. I will have a try!
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 24th April 2024 - 06:35 AM