PHP Web Host - Quality Web Hosting For All PHP Applications Free RavenNuke(tm) Add Ons
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
Post new topic   Reply to topic
Author Message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16986
Location: Kansas

PostPosted: Sun Dec 26, 2004 8:41 am Reply with quote Back to top

We have so many good threads on this, I thought I'd recap Wink Through added contributions by VinDSL and Mds, this is a synopsis. Not that this only applies if you are using Apache as a module and not CGI.

.htaccess only applies to Apache
mod_rewrite must be compiled in Apache
The lines to add at the top of .htaccess are (SOME-OTHER-PAGE needs to be replaced with a real redirect page)
Code:
#Check for Santy Worms and redirect them to a fake page
#Variant -1
RewriteCond %{HTTP_USER_AGENT} ^LWP             [NC,OR]
#Variant -2
RewriteCond %{REQUEST_URI} ^visualcoders                [NC,OR]
#Variant -3
RewriteCond %{QUERY_STRING} rush=([^&]+)                [NC]
RewriteRule ^.*$ SOME-OTHER-PAGE.php [L]


This assumes that the user-agent does begin with LWP. If yours is different then make the needed adjustments.
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
sharlein
Member Emeritus


Joined: Nov 19, 2002
Posts: 322
Location: On the Road

PostPosted: Sun Dec 26, 2004 11:05 am Reply with quote Back to top

Raven, what does LWP stand for? I am using Firefox, would I enter mozilla for my agent? Thanks, Steve
View user's profile Send private message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16986
Location: Kansas

PostPosted: Sun Dec 26, 2004 12:10 pm Reply with quote Back to top

No. lwp is the start of many of the user agent's nem, like LWP::Simple and several others. So, ^LWP {NC} means any user agent beginning with LWP. The [NC] makes it case insensitive.
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
sharlein
Member Emeritus


Joined: Nov 19, 2002
Posts: 322
Location: On the Road

PostPosted: Sun Dec 26, 2004 12:13 pm Reply with quote Back to top

Thank you.
View user's profile Send private message
64bitguy
The Mouse Is Extension Of Arm


Joined: Mar 06, 2004
Posts: 1156
Location: Sanbornton, NH USA

PostPosted: Sun Dec 26, 2004 12:14 pm Reply with quote Back to top

Raven, pardon the brain cramp, (I'm severely hung-over and it looks like my friends have raided the liquor cabinet again as they have started making another batch of "Christmas Punch" so there's not much hope of sobriety today either...

What would you put in place of

RewriteRule ^.*$ SOME-OTHER-PAGE.php [L]

to redirect to an off site URL?

Thanks
View user's profile Send private message Visit poster's website
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16986
Location: Kansas

PostPosted: Sun Dec 26, 2004 12:21 pm Reply with quote Back to top

PC-Killer, or you could probably just put
RewriteRule ^.*$ [F] which will just give them the standard 403 Forbidden screen.


Last edited by Raven on Sun Dec 26, 2004 6:21 pm; edited 1 time in total
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
64bitguy
The Mouse Is Extension Of Arm


Joined: Mar 06, 2004
Posts: 1156
Location: Sanbornton, NH USA

PostPosted: Sun Dec 26, 2004 12:30 pm Reply with quote Back to top

No standard syntax to redirect to a defined off-site URL though?

Thanks!
View user's profile Send private message Visit poster's website
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16986
Location: Kansas

PostPosted: Sun Dec 26, 2004 12:32 pm Reply with quote Back to top

Sure. RewriteRule ^.*$
Only registered users can see links on this board!
Get registered or login to the forums!
[L] although the FBI might not appreciate it Wink
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
sharlein
Member Emeritus


Joined: Nov 19, 2002
Posts: 322
Location: On the Road

PostPosted: Sun Dec 26, 2004 12:54 pm Reply with quote Back to top

Where can I find my user agent's nem? Completely in the dark here.
View user's profile Send private message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16986
Location: Kansas

PostPosted: Sun Dec 26, 2004 2:13 pm Reply with quote Back to top

Not YOUR user-agent, but THEIR user-agent as Sentinel reports it.
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
Savent
Regular
Regular


Joined: Jun 30, 2003
Posts: 81

PostPosted: Sun Dec 26, 2004 2:15 pm Reply with quote Back to top

Is the santy worm gone now? I haven't heard anything in the news about it, in like a week.
View user's profile Send private message Send e-mail Visit poster's website
sixonetonoffun
Spouse Contemplates Divorce


Joined: Jan 02, 2003
Posts: 2499

PostPosted: Sun Dec 26, 2004 2:20 pm Reply with quote Back to top

Its a safe bet that there is a rip off of it attacking portals whether they have phpbb installed or not.
View user's profile Send private message
Himmel
Regular
Regular


Joined: May 08, 2004
Posts: 77

PostPosted: Sun Dec 26, 2004 5:20 pm Reply with quote Back to top

Raven wrote:
No. lwp is the start of many of the user agent's nem, like LWP::Simple and several others. So, ^LWP {NC} means any user agent beginning with LWP. The [NC] makes it case insensitive.


Hi Raven..
I put those lines in my .htaccess and it didnt stop
User Agent: LWP::Simple/5.79

Any suggestions?


Thx Wink
View user's profile Send private message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16986
Location: Kansas

PostPosted: Sun Dec 26, 2004 5:21 pm Reply with quote Back to top

Is mod_rewrite installed?
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
Himmel
Regular
Regular


Joined: May 08, 2004
Posts: 77

PostPosted: Sun Dec 26, 2004 5:30 pm Reply with quote Back to top

Euh.. i guess not. Is this something that the host should do?
View user's profile Send private message
PHrEEkie
Subject Matter Expert


Joined: Feb 23, 2004
Posts: 358

PostPosted: Sun Dec 26, 2004 5:33 pm Reply with quote Back to top

Himmel wrote:
Euh.. i guess not. Is this something that the host should do?


Seeing as mod_rewrite presents no security concern to the server itself, and instead is a desirable option for any dynamic content site, the answer is a resounding YES, your host should have that enabled...

PHrEEk
View user's profile Send private message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16986
Location: Kansas

PostPosted: Sun Dec 26, 2004 5:37 pm Reply with quote Back to top

Run phpinfo() to verify if it is installed or not.
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
Himmel
Regular
Regular


Joined: May 08, 2004
Posts: 77

PostPosted: Sun Dec 26, 2004 5:47 pm Reply with quote Back to top

Raven wrote:
Run phpinfo() to verify if it is installed or not.


Sorry ..but dont know where and how Embarassed
View user's profile Send private message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16986
Location: Kansas

PostPosted: Sun Dec 26, 2004 5:51 pm Reply with quote Back to top

<?
phpinfo();
?>

Save that as info.php, ftp it to your web server and run it.
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
Himmel
Regular
Regular


Joined: May 08, 2004
Posts: 77

PostPosted: Sun Dec 26, 2004 6:01 pm Reply with quote Back to top

Loaded Modules mod_log_bytes, mod_frontpage, mod_php4, mod_ssl, mod_setenvif, mod_auth, mod_access, mod_rewrite, mod_alias, mod_userdir, mod_actions, mod_imap, mod_asis, mod_cgi, mod_dir, mod_autoindex, mod_include, mod_status, mod_negotiation, mod_mime, mod_log_config, mod_env, http_core

Yep it is...

Maybe i made a mistake in the .htaccess :

#Check for Santy Worms and redirect them to a fake page
#Variant -1
RewriteCond %{HTTP_USER_AGENT} ^LWP [NC,OR]
#Variant -2
RewriteCond %{REQUEST_URI} ^visualcoders [NC,OR]
#Variant -3
RewriteCond %{QUERY_STRING} rush=([^&]+) [NC]
RewriteRule ^.*$ [F} [L]
View user's profile Send private message
Muffin
Client


Joined: Apr 10, 2004
Posts: 649
Location: UK

PostPosted: Sun Dec 26, 2004 6:02 pm Reply with quote Back to top

Raven (and everyone who contributed) thank you so much for the cure, I've not had any pesky emails from Sentinel since I added it to my htaccess file.
View user's profile Send private message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16986
Location: Kansas

PostPosted: Sun Dec 26, 2004 6:11 pm Reply with quote Back to top

Himmel,

Where did you get this? It's wrong
Code:
RewriteRule ^.*$ [F} [L]

It should be
Code:
RewriteRule ^.*$ [F]
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
Himmel
Regular
Regular


Joined: May 08, 2004
Posts: 77

PostPosted: Sun Dec 26, 2004 6:17 pm Reply with quote Back to top

Raven wrote:
PC-Killer, or you could probably just put
RewriteRule ^.*$ [F} which will just give them the standard 403 Forbidden screen.


Sorry.. used that1

and: RewriteRule ^.*$ SOME-OTHER-PAGE.php [L]

Will make the change now Wink


Last edited by Himmel on Sun Dec 26, 2004 6:23 pm; edited 1 time in total
View user's profile Send private message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16986
Location: Kansas

PostPosted: Sun Dec 26, 2004 6:21 pm Reply with quote Back to top

Mad - Stupid fingers SORRY!!!
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
Himmel
Regular
Regular


Joined: May 08, 2004
Posts: 77

PostPosted: Sun Dec 26, 2004 6:24 pm Reply with quote Back to top

Hehehe.. noproblem .. im the 1 who doesnt understand php Wink
View user's profile Send private message
Display posts from previous:       
Post new topic   Reply to topic

View next topic
View previous topic
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
Forums ©
 

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2002-2011 by Raven

You can syndicate our news using the file xml

CSE HTML Validator Helped Clean up This Page! [Valid RSS] valid RSS 2.0 Valid robots.txt Stop Spam Harvesters, Join Project Honey Pot

Website engines core code is © copyright by PHP-Nuke but has been heavily patched and modified by myself and others.
PHP-Nuke is a free software released under the GNU/GPL.


:: fisubice phpbb2 style by Daz :: PHP-Nuke theme by www.nukemods.com ::
:: fisubice Theme Modified by the RavenNuke™ Team ::

:: W3C CSS Compliance Validation :: W3C HTML 4.01 Transitional Compliance Validation ::

zerosum