LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 09-21-2005, 09:56 PM   #1
hypexr
Member
 
Registered: Oct 2003
Location: USA Fresno Callifornia
Distribution: Gentoo (workstation), ArchLinux (file/mail server), Freebsd (web server), Ubuntu (laptop)
Posts: 115

Rep: Reputation: 16
Bad guys flooding my web server


I have a little photoblog that I am running from my web server at home. Its using pixelpost software, which is coded in php. There is a page photoblogindex.php?x=xref that shows the top refferals to my site.

There are scripts or worms or something that is continously connecting to my site to move the sites they are advertising up to the top of the list.

I first tried getting rid of the xref page and thought that this would help but when they try to connect to it it just brings up a template page and not a 404 or anything and the bots keep connecting thinking that they are working. This is bogging down my oldtimer of a computer and my internet connection.

I am looking for some advise because I can not figure out what to do. Should I do something with tcp wrappers? Special access rules? Something in apache config? The sites that they are promoting change names all fo the time so blocking certain reffering sites is a constant battle.

Scott
 
Old 09-22-2005, 01:41 AM   #2
pembo13
Member
 
Registered: May 2003
Location: Caribbean
Distribution: Fedora Core2
Posts: 403

Rep: Reputation: 30
Could you provide soeme log dumps, and somre more specific data, maybe me or someone here can find a pattern and help you block it.
 
Old 09-22-2005, 06:49 AM   #3
cs-cam
Senior Member
 
Registered: May 2004
Location: Australia
Distribution: Gentoo
Posts: 3,545

Rep: Reputation: 57
So the page they are connecting to no longer exists, ie. a human will never end up there? If so, just auto-ban any address that requests that page.
 
Old 09-22-2005, 10:13 AM   #4
hypexr
Member
 
Registered: Oct 2003
Location: USA Fresno Callifornia
Distribution: Gentoo (workstation), ArchLinux (file/mail server), Freebsd (web server), Ubuntu (laptop)
Posts: 115

Original Poster
Rep: Reputation: 16
I like that Idea. how do I do that? Its a php page so it request for the page is like this example.com/index.php?x=ref
Could I make the php page grab the ip address and then write this to a .htaccess file? or is there an easier way?
 
Old 09-22-2005, 10:49 AM   #5
pembo13
Member
 
Registered: May 2003
Location: Caribbean
Distribution: Fedora Core2
Posts: 403

Rep: Reputation: 30
Quote:
Originally posted by hypexr
I like that Idea. how do I do that? Its a php page so it request for the page is like this example.com/index.php?x=ref
Could I make the php page grab the ip address and then write this to a .htaccess file? or is there an easier way?
That is a good idea, however, it would still be nice if you provided some data.

To supplement that idea, you might as well lof the ips and put them into the ip ban list.
 
Old 09-22-2005, 12:53 PM   #6
XavierP
Moderator
 
Registered: Nov 2002
Location: Kent, England
Distribution: Debian Testing
Posts: 19,192
Blog Entries: 4

Rep: Reputation: 475Reputation: 475Reputation: 475Reputation: 475Reputation: 475
Moved: This thread is more suitable in Linux-Security and has been moved accordingly to help your thread/question get the exposure it deserves.
 
Old 09-22-2005, 06:46 PM   #7
cs-cam
Senior Member
 
Registered: May 2004
Location: Australia
Distribution: Gentoo
Posts: 3,545

Rep: Reputation: 57
Have a look here for some code. That page is very helpful for a different but similar problem but some of the same principals apply.
 
Old 09-22-2005, 10:46 PM   #8
Bruce Hill
HCL Maintainer
 
Registered: Jun 2003
Location: McCalla, AL, USA
Distribution: Arch, Gentoo
Posts: 6,940

Rep: Reputation: 129Reputation: 129
This would probably be considered a bit of a lame way to avoid them, but I have
major hits from Windoze script kiddies trying exploits on my server in China. I just
changed the port from 80 to another port, and since July there have been zero of
those attempts. This does require adding the port to the link, which isn't a problem
as mine is just photos posted for "the folks back home" to view. It did, however,
eliminate the kids who aren't smart enough to do anything more than scan port 80,
and/or use non-intelligent software designed for Windoze. Which freed me up
to spend time on the real bad guys ...
 
Old 09-22-2005, 10:52 PM   #9
hypexr
Member
 
Registered: Oct 2003
Location: USA Fresno Callifornia
Distribution: Gentoo (workstation), ArchLinux (file/mail server), Freebsd (web server), Ubuntu (laptop)
Posts: 115

Original Poster
Rep: Reputation: 16
Yeah, changing the port is a good method for avoiding this kind of thing and I need to do it for ssh (these ssh bots are getting crazy also). I don't really want web visitors having to know about ports, though.

I read through all of those examples on your link cs-cam, they will be easy to modify for my situation. I can't wait to get the time to get that going. Thanks!!
 
Old 09-22-2005, 11:07 PM   #10
slackhack
Senior Member
 
Registered: Jun 2004
Distribution: Arch, Debian, Slack
Posts: 1,016

Rep: Reputation: 47
you should definitely password protect any page that lists referrers. that's what the bad guys are after, and as long as that's public, you're going to keep getting hit with new ones even if you clear out the current ones. do a google for "referrer spam" to find out more, and about prevention tactics and fixes.


>>edit: the wikipedia entry even has a sample blocking script:

http://en.wikipedia.org/wiki/Referer_spam


Last edited by slackhack; 09-22-2005 at 11:09 PM.
 
  


Reply



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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
sorry guys.. grub problems bad superblock linuxbh Linux From Scratch 2 04-12-2005 10:12 AM
can we configure a Linux server with mail server,file server and web server kumarx Linux - Newbie 5 09-09-2004 06:21 AM
setting up password protected web forms on an apache web server AZDAVE Linux - Security 3 07-07-2004 12:03 PM
Please, only you guys can help me. Installing Quake on my server lexington Linux - Games 6 06-30-2004 04:09 PM
Guys/Girls I need your help with redhat mail server CYRUSS612 Linux - General 2 03-20-2004 11:13 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 11:00 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration