GIDForums  

Go Back   GIDForums > Web Hosting Forums > Apache Web Server Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 18-Dec-2004, 04:07
Allowee's Avatar
Allowee Allowee is offline
Regular Member
 
Join Date: May 2003
Location: The Netherlands
Posts: 339
Allowee has a spectacular aura about

Blocking a HTTP_VIA with .htaccess


Since a few weeks my paste.uni.cc is being spammed.

The spammer uses proxies and other stuff.
but for some reason every spam request/post includes a line like this:
Code:
[HTTP_VIA] => 1.1 pinappleproxy, 1.1 dgc-squid:3128 (squid/2.5.STABLE4) or [HTTP_VIA] => 1.1 pinappleproxy
I would like to redirect it to something else, like a dead url or something that won't cost me traffic

I've already blocked this at php level, but it won't stop so i'm going to block this crap at a higher level.

I've been trying to play with it, but my host is kinda slow atm

Any rewriterule help would be nice, of course I checked some sites, but couldn't really find what I was looking for
__________________
Pastebin
PHP Documentation Site
Allowee's Blog http://allowee.net
  #2  
Old 20-Dec-2004, 09:38
JdS's Avatar
JdS JdS is offline
Senior Member
 
Join Date: Aug 2001
Location: KUL, Malaysia
Posts: 3,371
JdS will become famous soon enough
I'll get back to you on this Allowee, now is not a good time for me... if you figure it out all before my reply, just update this thread.
  #3  
Old 21-Dec-2004, 06:15
Allowee's Avatar
Allowee Allowee is offline
Regular Member
 
Join Date: May 2003
Location: The Netherlands
Posts: 339
Allowee has a spectacular aura about
I think I figured it out.. although it might not be perfect

Code:
RewriteCond %{HTTP:VIA} ^.+pinappleproxy RewriteRule .* http://url.to.spammer/ [L]
This seems to block it..

note the
Code:
%{HTTP:VIA}
which is not HTTP_VIA, which I thought first.. but the manual helped me with that

Tested everything with a php script:
PHP Code:

<?php
$fp = fsockopen($host, 80);
$rc = fputs($fp, "GET /3059 HTTP/1.0\r\n" .
                 "Host: ".$host."\r\n" .
                 "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; ALL)\r\n".
                 "VIA: 1.1 pinappleproxy 65764hgfyh\r\n\r\n");
 $line = '';
 for($i=1; $i<=30;$i++) {
    $line .= fgets($fp);
 }
var_dump($line);
?>


very simple code, but it does the job perfectly
__________________
Pastebin
PHP Documentation Site
Allowee's Blog http://allowee.net
 
 

Recent GIDBlogProblems with the Navy (Chiefs) by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
what the heck....how do you make .htaccess file? antimacism Apache Web Server Forum 3 02-Sep-2005 09:27
Clean domain redirect/rewrite with .htaccess DaveBrooke Apache Web Server Forum 2 20-Dec-2004 09:35
Trouble With .htaccess amneziac85 Apache Web Server Forum 2 27-Jan-2004 18:35
Blocking Spambots by .htaccess BobbyDouglas Apache Web Server Forum 2 16-Jan-2004 11:32
Overriding .htaccess toadatrix Apache Web Server Forum 2 02-Jan-2004 23:00

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 11:17.


vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd.