LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-14-2006, 02:53 AM   #1
Jaysworld
LQ Newbie
 
Registered: Feb 2006
Posts: 2

Rep: Reputation: 0
Deleting directories from a cron


Hey all. I am looking to delete a directory named "olb" from users websites from a cron. It seems this directory is being used by a phishing campaign for a well know uk based bank. Since I run a free hosting service we have recieved several abuse emails asking us to take the offending websites off the internet for phishing for this banks information. The offending websites always share the same setup to mimic the banks setup. This setup resembles

olb/olb/olb/p/LoginMember.do/index.htm

I am looking to setup a cron that will run hourly or every 30 minutes that will delete directories named olb along with all the files they contain. I am however unsure how to do this. I tried rmdir var/www/virtual/*/olb with no success. I also tried varients of this such as /var/www/virtual/*./olb etc with no success. What am I doing wrong? I know there is a way to do this but how?
 
Old 03-14-2006, 06:09 AM   #2
timmeke
Senior Member
 
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 61
You might try something like
Code:
dirs=`find /var/www/virtual -type d -name 'olb'`; for i in ${dirs}; do rm -rf ${i}; done
.
I recommend replacing the "rm -rf" with a simply "echo" first to see what the impact of the code is, just to be safe.

However, your solution is just a temporary one. The more final solution would be to block the offending sites completely and to improve your security agains phishing (if possible).
 
Old 03-14-2006, 07:33 AM   #3
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Testing"
Posts: 6,121

Rep: Reputation: 418Reputation: 418Reputation: 418Reputation: 418Reputation: 418
It is not clear from your post whether it is your users who are phishing (in which case you should terminate their accounts at once, and give their details to the bank concerned) or your users who have been hacked and scammers are using their accounts. In either case you need to take your system offline until you have given some serious thought to security: It is irresponsible for you to allow your server(s) to be used in this way, and by tolerating this behaviour, you are putting yourself at risk of prosecution. There is helpful information in the Security forum of this board.

Simply deleting the olb directory is not the answer: They'll soon be using random names.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Deleting directories NomadABC Linux - Newbie 2 02-10-2005 02:11 PM
Deleting Directories J_Bone Linux - Newbie 4 08-17-2003 04:19 PM
deleting directories AZDAVE Linux - Newbie 1 08-15-2003 10:05 AM
Deleting full directories? AekaGSR Linux - Newbie 5 06-19-2003 05:50 PM
Deleting directories with files in them AMDPwred Linux - General 7 02-16-2003 12:06 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:01 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